BDI3000仿真器命令

BDI3000仿真器是瑞士Abatron公司开发的BDI系列仿真器(BDI1000/2000/3000)之一,可升级不同的固件,支持不同系列的CPU的仿真调试。该公司成立于1985年,2015年宣布关停,2019年破产清算,其官网被著名的J-Link仿真器的开发公司德国SEGGER接管维护。

支持的CPU列表如下:

通常,仿真器有两个用途:

1)变砖的情况下,升级bootloader

2)分析挂死问题或者关键代码单步调试

 BDI3000可以通过网线或者串口线连接PC。通常是先通过串口线配置主机IP地址和仿真器IP地址,以及配置文件;然后通过网线连接,PC机上搭建TFTP服务器,用于配置导入、文件导入导出。网线连接时,在PC上telnet到仿真器即可敲命令进行仿真调试。

1、配置命令

DELAY  <ms>                  delay for a number of milliseconds
配置主机IP地址 HOST <ip> change IP address of program file host PROMPT <string> defines a new prompt string
显示配置信息 CONFIG display or update BDI configuration
配置配置文件、主机IP地址、仿真器IP地址 CONFIG <file> [<hostIP> [<bdiIP> [<gateway> [<mask>]]]] HELP display command list BOOT [loader] reboot the BDI and reload the configuration JTAG switch to JTAG command mode QUIT terminate the Telnet session

 2、内存命令

查看指定内存段
MD [<address>] [<count>] display target memory as word (32bit) MDH [<address>] [<count>] display target memory as half word (16bit) MDB [<address>] [<count>] display target memory as byte (8bit)

dump指定内存段 DUMP
<addr> <size> [<file>] dump target memory to a file

修改指定内存段 MM
<addr> <value> [<cnt>] modify word(s) (32bit) in target memory MMH <addr> <value> [<cnt>] modify half word(s) (16bit) in target memory MMB <addr> <value> [<cnt>] modify byte(s) (8bit) in target memory

内存测试
MT    <addr> <count>[<loop>] memory test
MC    [<address>] [<count>]  calculates a checksum over a memory range
MV                           verifies the last calculated checksum

示例:

BCM5300X>mm 0x80000010 0xaa 4

BCM5300X>md 0x80000010 4
80000010 : 0x000000aa          170  ....
80000014 : 0x000000aa          170  ....
80000018 : 0x000000aa          170  ....
8000001c : 0x000000aa          170  ....

BCM5300X>dump 0x80000000 32 test.bin
Dumping to test.bin , please wait ....
Dumping target memory passed

 3、寄存器命令

获取通用寄存器值
RD [<name>] display general purpose or user defined register RDUMP [<file>] dump all user defined register to a file
获取CP0协处理器寄存器值 RDCP0
<number> display CP0 register
获取浮点协处理器寄存器值 RDFP display floating point registers DSP display DSP ASE registers
修改通用寄存器值 RM {
<nbr>|<name>} <value> modify general purpose or user defined register
修改协处理器寄存器值 RMCP0
<number> <value> modify CP0 register
修改浮点协处理器寄存器值 RMFP
<number> [<hi>_]<lo> modify floating point register

示例:

BCM5300X>rd
GPR00: 00000000 81000000 00000000 00000000
GPR04: 00000000 00000000 00000000 00000000
GPR08: 566967c0 803d9c40 00000000 00000000
GPR12: 00000000 00000000 00000000 00000000
GPR16: 00000000 00000000 00000000 00000000
GPR20: 00000000 00000000 00000000 00000000
GPR24: 00000000 00000000 803d9c68 1000fc03
GPR28: 80ff3800 56696790 56696790 801664dc
LO   : 00000000      HI: 00000000
BCM5300X>rd sp sp : 0x56696790 1449748368 BCM5300X>rd pc pc : 0x803d9c60 -2143445920 BCM5300X>rdcp0 0 CP0 0 : 0x00000005 5 BCM5300X>rdcp0 1 CP0 1 : 0x00000021 33 BCM5300X>rdcp0 2 CP0 2 : 0x02000007 33554439

 4、Cache命令

显示TLB条目(BCM53003支持64条TLB Entries,编号0~63)
TLB <from> [<to>] display TLB entry
显示DCache条目(BCM53003支持1024条DTAGs,编号0~1023) DTAG
<from> [<to>] display data cache tag
显示ICache条目(BCM53003支持1024条ITAGs,编号0~1023) ITAG
<from> [<to>] display instruction cache tag
删除DCache条目 DFLUSH [
<addr> [<size]] flush data cache
删除ICache条目 IFLUSH [
<addr> [<size]] invalidate instruction cache

示例:

BCM5300X>tlb 0 63
 0 : 00 e0000000  64MB -> 0_40000000 C2DVG 0_44000000 C2DVG
 1 : 00 c0000000  64MB -> 0_40000000 C0DVG 0_44000000 C0DVG
 2 : 00 20000000 256MB -> 0_10000000 C0--- 0_20000000 C2DV-
 3 : 00 00000000 256MB -> 0_10000000 C0--- 0_20000000 C0DV-
 4 : 00 60000000 256MB -> 0_80000000 C2DVG 0_90000000 C2DVG
 5 : 00 40000000 256MB -> 0_80000000 C0DVG 0_90000000 C0DVG
 6 : 00 8000c000   4KB -> 0_00000000 C0--- 0_00000000 C0---
 7 : 00 8000e000   4KB -> 0_00000000 C0--- 0_00000000 C0---
 8 : 00 80010000   4KB -> 0_00000000 C0--- 0_00000000 C0---
 9 : 00 80012000   4KB -> 0_00000000 C0--- 0_00000000 C0---
10 : 00 80014000   4KB -> 0_00000000 C0--- 0_00000000 C0---
11 : 00 80016000   4KB -> 0_00000000 C0--- 0_00000000 C0---
12 : 00 80018000   4KB -> 0_00000000 C0--- 0_00000000 C0---
13 : 00 8001a000   4KB -> 0_00000000 C0--- 0_00000000 C0---
14 : 00 8001c000   4KB -> 0_00000000 C0--- 0_00000000 C0---
15 : 00 8001e000   4KB -> 0_00000000 C0--- 0_00000000 C0---
16 : 00 80020000   4KB -> 0_00000000 C0--- 0_00000000 C0---
17 : 00 80022000   4KB -> 0_00000000 C0--- 0_00000000 C0---
18 : 00 80024000   4KB -> 0_00000000 C0--- 0_00000000 C0---
19 : 00 80026000   4KB -> 0_00000000 C0--- 0_00000000 C0---
20 : 00 80028000   4KB -> 0_00000000 C0--- 0_00000000 C0---
21 : 00 8002a000   4KB -> 0_00000000 C0--- 0_00000000 C0---
22 : 00 8002c000   4KB -> 0_00000000 C0--- 0_00000000 C0---
23 : 00 8002e000   4KB -> 0_00000000 C0--- 0_00000000 C0---
24 : 00 80030000   4KB -> 0_00000000 C0--- 0_00000000 C0---
25 : 00 80032000   4KB -> 0_00000000 C0--- 0_00000000 C0---
26 : 00 80034000   4KB -> 0_00000000 C0--- 0_00000000 C0---
27 : 00 80036000   4KB -> 0_00000000 C0--- 0_00000000 C0---
28 : 00 80038000   4KB -> 0_00000000 C0--- 0_00000000 C0---
29 : 00 8003a000   4KB -> 0_00000000 C0--- 0_00000000 C0---
30 : 00 8003c000   4KB -> 0_00000000 C0--- 0_00000000 C0---
31 : 00 8003e000   4KB -> 0_00000000 C0--- 0_00000000 C0---
32 : 00 80040000   4KB -> 0_00000000 C0--- 0_00000000 C0---
33 : 00 80042000   4KB -> 0_00000000 C0--- 0_00000000 C0---
34 : 00 80044000   4KB -> 0_00000000 C0--- 0_00000000 C0---
35 : 00 80046000   4KB -> 0_00000000 C0--- 0_00000000 C0---
36 : 00 80048000   4KB -> 0_00000000 C0--- 0_00000000 C0---
37 : 00 8004a000   4KB -> 0_00000000 C0--- 0_00000000 C0---
38 : 00 8004c000   4KB -> 0_00000000 C0--- 0_00000000 C0---
39 : 00 8004e000   4KB -> 0_00000000 C0--- 0_00000000 C0---
40 : 00 80050000   4KB -> 0_00000000 C0--- 0_00000000 C0---
41 : 00 80052000   4KB -> 0_00000000 C0--- 0_00000000 C0---
42 : 00 80054000   4KB -> 0_00000000 C0--- 0_00000000 C0---
43 : 00 80056000   4KB -> 0_00000000 C0--- 0_00000000 C0---
44 : 00 80058000   4KB -> 0_00000000 C0--- 0_00000000 C0---
45 : 00 8005a000   4KB -> 0_00000000 C0--- 0_00000000 C0---
46 : 00 8005c000   4KB -> 0_00000000 C0--- 0_00000000 C0---
47 : 00 8005e000   4KB -> 0_00000000 C0--- 0_00000000 C0---
48 : 00 80060000   4KB -> 0_00000000 C0--- 0_00000000 C0---
49 : 00 80062000   4KB -> 0_00000000 C0--- 0_00000000 C0---
50 : 00 80064000   4KB -> 0_00000000 C0--- 0_00000000 C0---
51 : 00 80066000   4KB -> 0_00000000 C0--- 0_00000000 C0---
52 : 00 80068000   4KB -> 0_00000000 C0--- 0_00000000 C0---
53 : 00 8006a000   4KB -> 0_00000000 C0--- 0_00000000 C0---
54 : 00 8006c000   4KB -> 0_00000000 C0--- 0_00000000 C0---
55 : 00 8006e000   4KB -> 0_00000000 C0--- 0_00000000 C0---
56 : 00 80070000   4KB -> 0_00000000 C0--- 0_00000000 C0---
57 : 00 80072000   4KB -> 0_00000000 C0--- 0_00000000 C0---
58 : 00 80074000   4KB -> 0_00000000 C0--- 0_00000000 C0---
59 : 00 80076000   4KB -> 0_00000000 C0--- 0_00000000 C0---
60 : 00 80078000   4KB -> 0_00000000 C0--- 0_00000000 C0---
61 : 00 8007a000   4KB -> 0_00000000 C0--- 0_00000000 C0---
62 : 00 8007c000   4KB -> 0_00000000 C0--- 0_00000000 C0---
63 : 00 8007e000   4KB -> 0_00000000 C0--- 0_00000000 C0---

BCM5300X>itag 0 4
000 : 00778000 V--  007b2000 V--  00166000 V--  0072c000 V--
001 : 00778020 V--  00736020 V--  00166020 V--  007b2020 V--
002 : 00166040 V--  007b2040 V--  00158040 V--  00778040 V--
003 : 00158060 V--  00778060 V--  00166060 V--  007b2060 V--
004 : 00166080 V--  005dc080 V--  007b2080 V--  00158080 V--

BCM5300X>dtag 0 4
000 : 00000000 V--  967b2000 V--  99df4000 V--  99dfa000 V--
001 : 99dee020 V--  00000020 V--  99e00020 V--  99de8020 V--
002 : 00000040 V--  01cfa040 V--  01cf8040 V--  01cf6040 V--
003 : 99df0060 V--  00000060 V--  99dfc060 V--  99dea060 V--
004 : 01cfa080 V--  99df6080 V--  99de4080 V--  00fee080 V--

 5、调试命令

RESET [HALT | RUN [time]]    reset the target system, change startup mode
BREAK [SOFT | HARD]          display or set current breakpoint mode
GO    [<pc>]                 set PC and start target system
GO    <n> <n> [<n>[<n>]]     start multiple cores in requested order
TI    [<pc>]                 trace on instuction (single step)
HALT  [<n>[<n>[<n>[<n>]]]]   force core(s) to debug mode (n = core number)
BI  <addr> [<mask>]          set instruction breakpoint
CI  [<id>]                   clear instruction breakpoint(s)
BD  [R|W] <addr> [<mask>]    set data breakpoint
CD [<id>]                    clear data breakpoint(s)
SELECT    <core>             change the current core
TCSELECT  <thread>           change the current MT ASE thread
INFO                         display information about the current state
TCINFO                       display information about the MT ASE threads

6、Flash命令

LOAD   [<offset>] [<file> [<format>]] load program file to target memory
VERIFY [<offset>] [<file> [<format>]] verify a program file to target memory
PROG   [<offset>] [<file> [<format>]] program flash memory
                                      <format> : SREC or BIN or AOUT or ELF
ERASE  [<address> [<mode>]]  erase a flash memory sector, chip or block
                   <mode>  : CHIP, BLOCK or SECTOR (default is sector)
ERASE  <addr> <step> <count> erase multiple flash sectors
UNLOCK [<addr> [<delay>]]    unlock a flash sector
UNLOCK <addr> <step> <count> unlock multiple flash sectors
FLASH  <type> <size> <bus>   change flash configuration
原文地址:https://www.cnblogs.com/justin-y-lin/p/13793455.html