>本文档基于windows下的dtools.exe进行编写。 # remote tools > 这一部分的命令,都需要连接板子进行操作,连接mode可从以下根据需要8选1 --uart uart port and baud --debughost debughost port and baud --debuguart debuguart port and baud --coolhost coolhost socket server, host:port --diagport diag uart port and baud --channelserver channelserver socket server, host:port --cmm cmm file for offline mode --mips mips offline mode > 需要选择elf文件的命令,应保证选择的elf文件与板子中烧录的pac文件版本一致 ## bsdump * blue screen dump >该命令用以dump蓝屏数据,需在chip panic状态下才可使用该命令,根据不同芯片从对应的芯片文件夹下读取配置,如8850则从setting/chip/8850/8850_bsdump.xml中读取相关配置,最终生成cmm文件,以供后续死机分析。该命令对应dtools_win.exe中的blue screen dump功能。 Options: --profile profile in XML file >在setting/bgdump.xml文件中支持的profile,可用--profile list列出所有支持的profile项 Arguments: output output directory For example: $ dtools.exe bsdump --profile list supported profiles: 8910DM, 8811, 8850 $ dtools.exe bsdump --diagport COM43,2000000 ./outputdir/bs --profile 8811 ## memdump * memory dump >该命令用以dump memory指定address与size的数据,并存放于指定的output路径文件中。该命令对应dtools_win.exe中的memory dump功能。 Options: --lod write lod file rather than bin //最终输出lod而非bin文件 Arguments: address memory starting address size memory size output output dump file For example: $ dtools.exe memdump 0x00000 512 ./outputdir/memdump.bin --diagport COM43,2000000 ## memwrite * memory write Arguments: type memory write type(w32/w16/w8) address memory write address value memory write value For example: $ dtools.exe memwrite w8 0x0 0x55 --diagport COM43,2000000 write ok ## memrecdump * heap malloc/free record dump >该命令用以查看内存申请/释放记录,并输出到output路径下,需要指定与chip烧录的同版本elf文件的存放路径。该命令对应dtools_win.exe中的misc dump中的heap malloc/free records (memory records)功能。 Arguments: output output file name elf elf file name For example: $ dtools.exe memrecdump --debuguart COM51,921600 \ ./outputdir/memrec ./pac/8910DM_cat1_v2.elf ## pmdump * power management information dump >该命令用以dump电源管理相关信息。该命令对应dtools_win.exe中的misc dump中的power managements功能。 Options: --debughost debughost port and baud --debuguart debuguart port and baud --coolhost coolhost socket server, host:port --diagport diag uart port and baud --channelserver channelserver socket server, host:port >此命令只支持live连接模式,因此连接方式5选1 Arguments: elf elf file name output output file name For example: $ dtools.exe pmdump --debuguart COM51,921600 ./pac/8910DM_cat1_v2.elf ./outputdir/pmdump timer dump nbtimer dump sxtimer dump PM source dump clock constraint dump ## heapreport * heap analysis report >该命令用以dump堆栈信息。该命令对应dtools_win.exe中的heap report功能。 Options: --type heap report type Arguments: output output file name elf elf file name For example: $ dtools.exe heapreport --type list supported types: 8910AP, 8910CP, 8811, 8850AP, 8850CP $ dtools.exe heapreport --type 8910AP --debuguart COM51,921600 \ ./outputdir/heapreport ./pac/8910DM_cat1_v2.elf ## profile * profile dump Options: --ignore-jump ignore tick jump --dump-raw dump raw events Arguments: elf elf file name output output file name For example: $ dtools.exe profile ./pac/8910DM_cat1_v2.elf ./outputdir/profile --debuguart COM51,921600 find symbol gProfileCtx at 0x80c21c0c Profile buffer: 0x80c15c0c Profile size: 12288 Profile start: 2562 Profile count: 12288 cannot find symbol g_spalProfileControl spal profile will not dump cannot find symbol gRfdigProfileCtxPtr RFDIG/RISCV profile will not dump //具体profile文件存储在设定的outputdir文件夹路径下 ## heapinfo * heap usage info dump Options: --uart uart port and baud --debughost debughost port and baud --debuguart debuguart port and baud --coolhost coolhost socket server, host:port --diagport diag uart port and baud --channelserver channelserver socket server, host:port //mode 6 选 1;但是目前只支持8811选择diagport mode Arguments: output output file name For example: $ dtools.exe heapinfo ./outputdir/heapinfo --diagport COM43,2000000 ## irqinfo * IRQ info dump Options: --uart uart port and baud --debughost debughost port and baud --debuguart debuguart port and baud --coolhost coolhost socket server, host:port --diagport diag uart port and baud --channelserver channelserver socket server, host:port //mode 6 选 1;但是目前只支持8811选择diagport mode Arguments: output output file name For example: $ dtools.exe irqinfo ./outputdir/irqinfo --diagport COM43,2000000 ## readefuse * read efuse word Options: --uart uart port and baud --debughost debughost port and baud --debuguart debuguart port and baud --coolhost coolhost socket server, host:port --diagport diag uart port and baud --channelserver channelserver socket server, host:port //mode 6选1 Arguments: id efuse id, bit 15 for double bit. When not specified, read all efuse words. ## writeefuse * write efuse word Options: --uart uart port and baud --debughost debughost port and baud --debuguart debuguart port and baud --coolhost coolhost socket server, host:port --diagport diag uart port and baud --channelserver channelserver socket server, host:port //mode 6选1 Arguments: id efuse id, bit 15 for double bit val value to be written For example: $ dtools.exe writeefuse id value --diagport COM43,2000000 ## readnv * read nv Options: --uart uart port and baud --debughost debughost port and baud --debuguart debuguart port and baud --coolhost coolhost socket server, host:port --diagport diag uart port and baud --channelserver channelserver socket server, host:port //mode 6选1 Arguments: nvid nvid output output file name For example: $ dtools.exe readnv 620 ./outputdir/nv --diagport COM43,2000000 //nvid需填写对应id ## writenv * write nv Options: --uart uart port and baud --debughost debughost port and baud --debuguart debuguart port and baud --coolhost coolhost socket server, host:port --diagport diag uart port and baud --channelserver channelserver socket server, host:port //mode 6选1 Arguments: nvid nvid input input file name For example: $ dtools.exe writenv 620 ./outputdir/nv --diagport COM43,2000000 //nvid需填写对应id # remote system command >remote system command这一部分的命令,都需要连接板子进行操作,且chip处于live状态。 ## ping * ping remote target Options: --uart uart port and baud --debughost debughost port and baud --debuguart debuguart port and baud --coolhost coolhost socket server, host:port --diagport diag uart port and baud --channelserver channelserver socket server, host:port //mode 6选1 Arguments: ping For example: $ dtools.exe ping --debughost COM51,921600 ## panic * force panic >该命令是chip操作。该命令对应dtools_win.exe中的命令行panic功能,即对应菜单栏“chip->Force panic”功能。 Options: --uart uart port and baud --debughost debughost port and baud --debuguart debuguart port and baud --coolhost coolhost socket server, host:port --diagport diag uart port and baud --channelserver channelserver socket server, host:port //mode 6选1 Arguments: panic For example: $ dtools.exe panic --debughost COM51,921600 //此处发送数据为包头+FD 02 00 00 ## reboot * normal reboot >该命令是chip操作,重启chip。该命令对应dtools_win.exe中的命令行chip功能,即对应菜单栏“chip->Reboot”功能。 Options: --uart uart port and baud --debughost debughost port and baud --debuguart debuguart port and baud --coolhost coolhost socket server, host:port --diagport diag uart port and baud --channelserver channelserver socket server, host:port //mode 6选1 Arguments: reboot For example: $ dtools.exe reboot --debughost COM51,921600 //此处发送数据为包头+FD 03 00 00 ## rebootdnld * reboot to download mode >该命令是chip操作,重启chip并进入下载模式。该命令对应dtools_win.exe中的命令行rebootdnld功能,即对应菜单栏“chip-> Reboot to download”功能。 Options: --uart uart port and baud --debughost debughost port and baud --debuguart debuguart port and baud --coolhost coolhost socket server, host:port --diagport diag uart port and baud --channelserver channelserver socket server, host:port //mode 6选1 Arguments: rebootdnld For example: $ dtools.exe rebootdnld --debughost COM51,921600 //此处发送数据为包头+FD 03 44 52 ## shutdown * shutdown device >该命令是chip操作。该命令对应菜单栏“chip-> shutdown”功能。 Options: --uart uart port and baud --debughost debughost port and baud --debuguart debuguart port and baud --coolhost coolhost socket server, host:port --diagport diag uart port and baud --channelserver channelserver socket server, host:port //mode 6选1 Arguments: shutdown For example: $ dtools.exe shutdown --debughost COM51,921600 //此处发送数据为包头+FD 03 46 4f ## profilesmode * set profile mode >该命令用来控制UE记录profile的方式,有0,1两种模式,0表示循环记录,1表示当记录满时停止profile。 Options: --uart uart port and baud --debughost debughost port and baud --debuguart debuguart port and baud --coolhost coolhost socket server, host:port --diagport diag uart port and baud --channelserver channelserver socket server, host:port //mode 6选1 Arguments: mode profile mode, 0/normal, 1/stop on full For example: $ dtools.exe profilesmode 0 --debughost COM51,921600 //此处发送数据为包头+FD 1d 00 00 # app image ## flashimgget //todo * get parameter from flash appimg ## flashimgset //todo * set parameter to flash appimg ## fileimgget //todo * get parameter from file appimg ## fileimgset //todo * set parameter to file appimg # remote file system tools * 此部分板子需与PC连接,且板子正常运行程序(live)状态 * remote指板子那一端,获取板子文件系统中的文件状态.此组命令对应dtools_win.exe中file manager中的相关功能。 Options: //连接方式从以下6选1 --uart uart port and baud --debughost debughost port and baud --debuguart debuguart port and baud --coolhost coolhost socket server, host:port --diagport diag uart port and baud --channelserver channelserver socket server, host:port ## filesize * remote file size and crc Arguments: remote remote file name For example: $ dtools.exe filesize modem/cp.bin.001 --debuguart COM51,921600 modem/cp.bin.001 mode/0x81ff size/42032 crc/0x4cabfd4a ## getfile * get file from remote Arguments: remote remote file name local local file name For example: $ dtools.exe getfile modem/cp.bin.000 ./outputdir/cp.bin.000 --debuguart COM51,921600 read remote file, 8192/40592 read remote file, 16384/40592 read remote file, 24576/40592 read remote file, 32768/40592 read remote file, 40592/40592 ## putfile * put file to remote Arguments: remote remote file name local local file name For example: $ dtools.exe putfile /memdump.bin outputdir/memdump.bin --debuguart COM51,921600 write remote file, 512/512 上传file后,可通过以下命令查看远程文件列表,检验是否成功 $ dtools.exe listdir ./ --debuguart COM51,921600 ./prepack/ ./nvm/ ./modemnvm/ 6292 ./simlock_data.bin 37204 ./sms_dm_nv.bin 8 ./cis_fw_context ./fota/ 512 ./memdump.bin //此文件为putfile上传的文件 ## rmfile * delete remote file Arguments: remote remote file name For example: $ dtools.exe rmfile ./memdump.bin --debuguart COM51,921600 ## rename * rename remote file or directory Arguments: remote-src remote source file or directory name remote-dst remote destination file or directory name For example: $ dtools.exe rename ./memdump.bin ./mem.bin --debuguart COM51,921600 //修改文件名 $ dtools.exe rename ./mem ./memdump --debuguart COM51,921600 //修改文件夹名 ## listdir * list remote directory Arguments: remote remote directory For example: $ dtools.exe listdir modem --debuguart COM51,921600 12104 modem/bcpu_gsm.bin.000 40592 modem/cp.bin.000 42032 modem/cp.bin.001 ... 50056 modem/cp.bin.063 18304 modem/cp.bin.064 896 modem/mem_index_list modem/nvm/ 17928 modem/riscV.bin.000 43144 modem/zsp.bin.000 42904 modem/zsp.bin.001 ... 10672 modem/zsp.bin.010 ## listpart * list remote partition For example: $ dtools.exe listpart --debuguart COM51,921600 / f_bsize/500 f_blocks/2751 f_bfree/2463 f_bavail/2463 f_flag/0 /modem f_bsize/500 f_blocks/6527 f_bfree/189 f_bavail/189 f_flag/1 /factory f_bsize/244 f_blocks/495 f_bfree/280 f_bavail/280 f_flag/1 ## mkdir * create remote directory Arguments: remote directory in target For example: $ dtools.exe mkdir ./test --debuguart COM51,921600 ## rmdir * delete remote directory Arguments: remote directory in target For example: $ dtools.exe rmdir ./test --debuguart COM51,921600 ## mkpath * create remote directory recursive Arguments: remote directory in target For example: $ dtools.exe mkpath ./test1/test2/3/4 --debuguart COM51,921600 ## rmpath * delete remote directory recursive Arguments: remote directory in target For example: $ dtools.exe rmpath ./test1 --debuguart COM51,921600 # elf tools ## elf2lod * create lod from elf * Usage: dtools.exe [options] elf2lod elf lod >该命令用以将elf文件转换为lod文件,该功能只针对8909和8955,8910以后的芯片使用pac包。 Options: --start start symbol name, default to __flash_start --end end symbol name, default to __flash_end --param parameters to be added in lod header in: key=val, default to __flash_end --mips convert address to mips physical address --boot insert BOOT_SECTOR param Arguments: elf elf file lod output lod file For example: $ dtools.exe elf2lod ./pac/8910DM_cat1_v2.elf ./pac/elf2lod.lod ## elf2bin * create bin from elf * Usage: dtools.exe [options] elf2bin elf bin Options: --start start symbol name, default to __flash_start --end end symbol name, default to __flash_end --allow-empty allow output empty file Arguments: elf2bin elf elf file bin output bin file For example: $ dtools.exe elf2bin ./pac/8910DM_cat1_v2.elf ./pac/elf2lod.bin ## elf2romhex * create romhex from elf Options: --start start symbol name, default to __flash_start --end end symbol name, default to __flash_end --padding pading 0/1, default 0 --size list of rom block size, by comma Arguments: elf input elf file hex output romhex file For example: $ dtools.exe elf2romhex ./pac/8910DM_cat1_v2.elf ./pac/elf2lodhex ## sectdump * dump elf sections Arguments: elf elf file name out output directory For example: $ dtools.exe sectdump ./pac/8910DM_cat1_v2.elf ./pac/elfsectdump ## mkuimage * create uimage file from elf Options: --start start symbol name, default to __flash_start --end end symbol name, default to __flash_end --name image name, default UIMAGE --timestamp