搜尋此網誌

About SIP realm .

    

      realm 解釋:reaml為功能變數名稱,用來作用戶端認證用(authenticate.必須是一個有效的 sipuri 如:sip:vision-com.com.cnrealm sip協議棧啟動之前必須設置的選項,一旦協定棧啟動realm就不可以更改,如果不填寫sip代理伺服器位址,則系統會用realm通過 dns NAPTR + SRV 或者DHCP(還沒實現)動態查找機制確定sip 伺服器位址。


UBIFS modify or write content a file HOWTO.


example :

   vi JackyXue.sh

after modify this script.

   try do follow step to make ubifs write cache to flash.

fsync -d JackyXue.sh


                     That's is.

Check Sharelibrary usage for embedded system application





host (x86) 機器上, 使用 arm-linux-readelf -d $target_prog 來查某個目的程式缺什麼庫。
target(arm)機器上,使用 /lib/ld.so.2 --list $prog   列出該 prog 所需的依賴庫。

OpenWrt CCmake linker error (half fixed)

   When build openwrt from trunk 2012/9/26 . i found on one of Linux host
build Cmake always fail , check the configure difference between success linux host,i found is install QT or not.

     But after google for a long time, i can only disable one of the Cmake feature to fix this temporary.

       find CMakeCache.txt edit follow build option from  the

BUILD_CursesDialog:BOOL=ON
   
to

BUILD_CursesDialog:BOOL=OFF

             Ok, don't clean the Cmake package on openwrt, continue build
  make V=s ....

OpenWRT build order change how to

 
          For a openwrt user/development, the build sequence(order) is very important, here i will show you how to change the build order without change your package name :

     First open your package's Makefile , and quicky find the setion:

####################################
define Package/build_order_test_package

endef
#####################################

     please add DEPENDS:= key word.
then decide which should build before your package build

     for example , i want librt build before my build_order_test_package build .

define Package/build_order_test_package
  DEPENDS:=  librt 
endef
         Ok ,after finished the modification of the Makefile.
  please do make menuconfig again .

           make menuconfig ARCH=xxx V=s

      Now just type

              make V=s 

         and  check the build log now ,
     you'll  find the librt will  build before your package been build.
   







 
   


openwrt tool cmake build fail due to lacking /lib/libtinfo.so.5

  
         The cmake make file friendly tell us to add /lib/libtinfo.so.5 into linker command line, but it's didn't
   tell us how in detail.

          I spent a lot of time to figure out it, try follow :

            just export LDFLAGS="-ltinfo"; before you run cmake bootstrap shell script.
     so, it would look like this:

                   export LDFLAGS="-ltinfo"; ./bootstrap; make ;make install.

         on openwrt build root :

       add overlap build target on tools/cmake/Makefile:

define Host/Configure

echo "####################### overlap host configure ###################"
cd $(HOST_BUILD_DIR) && LibArchive_LIBRARY=libtinfo.so.5 LibArchive_INCLUDE_DIR=/lib export LDFLAGS="-ltinfo"; \
./bootstrap --system-libs --no-system-zlib --system-bzip2 --no-qt-gui --no-system-libarchive \
--prefix=$(STAGING_DIR_HOST) --docdir=$(STAGING_DIR_HOST)/doc --mandir=$(STAGING_DIR_HOST)/man
endef

Add private patch build when OPENWRT library dependence build fail

    1. Open your package/Makefile

       add for build opkg ,opkg/host and ncurse
#++++++++++++++++++++++++++++++++++
define Build/Compile/library
    @echo "**************************************************************************"
    @echo "************************ Build VOIP Required Library  ********************"
    @echo "**************************************************************************"
    sleep 3; \
    cd $(TOPDIR) && make package/opkg/install V=s; \
    cd $(TOPDIR) && make package/opkg/host/install V=s; \
    cd $(TOPDIR) && make package/ncurse/install V=99
endef
#++++++++++++++++++++++++++++++++++++

     2. Put our private define on OPENWRT standard package compile build flow

define Build/Compile
    $(call Build/Compile/library)  # Insert call our private compile make target.
   $(MAKE) -C $(PKG_BUILD_DIR)/builtins LDFLAGS_FOR_BUILD= mkbuiltins
    $(MAKE) -C $(PKG_BUILD_DIR) \
        DESTDIR="$(PKG_INSTALL_DIR)" \
        SHELL="/bin/bash" \
        all
endef


                    

Gega MAC & phy ping not working on 10/100 mode debug.

  1. check if your MAC speed mode is set fixed on 1000 mode .
   if yes ->set to 10/100 mode or 100 mode.
  2. cehck phy speed & duplex mode is get correct.

    gega mac  1G mode  setup is different from 10/100 ,most vendor's gega mac design is same ,
  2 mode for speed one for 1000 only one for 10/100  !
     if mac speed is set on 1000 ,the auto negotiation may be not working on 10/100 hub or any 10/100
      network adapter!

Check linux user mode application depend shared libraries

I. Using ldd (source code delong to Linux binutil )
ldd bluetoothd
libgmodule-2.0.so.0 => /usr/local/lib/libgmodule-2.0.so.0 (0xb7f7d000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7f6a000)
librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb7f63000)
libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0xb7e85000)
libdbus-1.so.3 => /usr/local/lib/libdbus-1.so.3 (0xb7e55000)
libbluetooth.so.3 => /home/jacky/bt/root/lib/libbluetooth.so.3 (0xb7e43000)
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7e33000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7cfd000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7f82000)
2. Using readelf -d bluetoothd
readelf -d bluetoothd
Dynamic segment at offset 0x2844c contains 29 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libgmodule-2.0.so.0]
0x00000001 (NEEDED) Shared library: [libdl.so.2]
0x00000001 (NEEDED) Shared library: [librt.so.1]
0x00000001 (NEEDED) Shared library: [libglib-2.0.so.0]
0x00000001 (NEEDED) Shared library: [libdbus-1.so.3]
0x00000001 (NEEDED) Shared library: [libbluetooth.so.3]
0x00000001 (NEEDED) Shared library: [libpthread.so.0]
0x00000001 (NEEDED) Shared library: [libc.so.6]
0x0000000f (RPATH) Library rpath: [/usr/local/lib:/home/jacky/bt/root/lib]
0x0000000c (INIT) 0x7704
0x0000000d (FINI) 0x246c0
0x00000004 (HASH) 0x148
0x00000005 (STRTAB) 0x39f8
0x00000006 (SYMTAB) 0x1328
0x0000000a (STRSZ) 10777 (bytes)
0x0000000b (SYMENT) 16 (bytes)
0x00000015 (DEBUG) 0x0
0x00000003 (PLTGOT) 0x28568
0x00000002 (PLTRELSZ) 2256 (bytes)
0x00000014 (PLTREL) REL
0x00000017 (JMPREL) 0x6e34
0x00000011 (REL) 0x695c
0x00000012 (RELSZ) 1240 (bytes)
0x00000013 (RELENT) 8 (bytes)
0x6ffffffe (VERNEED) 0x68ec
0x6fffffff (VERNEEDNUM) 2
0x6ffffff0 (VERSYM) 0x6412
0x6ffffffa (RELCOUNT) 144
0x00000000 (NULL) 0x0

STM32 bootloader into 3 section.

#include


#define FW_START 0x80000000



static const uint16_t launch_fw_code[] =

{

0xF850, 0xDB04, /* LDR.W SP, [R0], #4 */

0x6800, /* LDR.W R0, [R0] */

0x4700, /* BX R0 */

};



int main(void)

{

((void (*)(uint32_t))(1+ (int)launch_fw_code))(FW_START); // type_A

((void (*)(uint32_t))(1+(unsigned int)launch_fw_code))(FW_START); // type_B

((void (*)(uint32_t))(1+ launch_fw_code))(FW_START); // type_C



return 0;

}

printf 輸出u32/u64 的格式

 d,lx,ld,,lu,這幾個都是輸出32位的


hd,hx,hu,這幾個都是輸出16位元資料的,

hhd,hhx,hhu,這幾個都是輸出8位的,

lld,ll,llu,llx,這幾個都是輸出64位的, 
printf( "%llu ",.....)

%llu 是64位元無符號

%llx才是64位16進制數