挥码枪的扩展命令

挥码枪是一个比较复杂的调试工具,有比较多的参数和可选功能。使用挥码枪进行调试时,可以在NDB(NanoCode Debugger)中通过扩展命令来观察挥码枪的状态,或者调整它的参数。

1. 基本语法

NDB中的所有扩展命令都以!开头,所以本文介绍的命令都应该以惊叹号开始,其典型格式如下:
!<命令字> [子命令] [参数]

2. 挥码枪设备命令

!ntp是针对挥码枪整体对象的命令,目前支持如下子命令

2.1 !ntp info

显示挥码枪的基本参数,典型结果如下:
[ndb]!ntp info
NTP-DAP: FW Version = 2.0.2
SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1

2.1 !ntp cmd

[警告]此命令发送不当,可能导致挥码枪故障,请慎重操作
向挥码枪发送命令,其命令语法为:
!ntp cmd <NTP命令字> [命令参数]
举例来说,可以使用如下命令关闭NTP的连结指示灯(LED_CONNECT):
[ndb]!ntp cmd 1 0 0
Returned data 00 00 00 00
上面命令中的1代表操作LED的命令字CMD_DAP_LED
第二个参数0代表连结指示灯(LED_CONNECT),第三个参数0代表关闭,换做1则打开,比如
!ntp cmd 1 0 1

3. DAP命令

DAP是arm调试接口中的关键概念,是调试端口与访问端口的合集,即DP + AP的意思。

3.1 !dap info

这个命令用于观察描述DAP关键信息的ROM表,典型执行结果如下:
AP ID register 0x24770002
Type is MEM-AP APB
MEM-AP BASE 0x80000000
ROM table in legacy format
Component base address 0x80000000
Peripheral ID 0x0000080000
Designer is 0x080,
Part is 0x0, Unrecognized
Component class is 0x1, ROM table
MEMTYPE system memory not present: dedicated debug bus
ROMTABLE[0x0] = 0x1000003
Component base address 0x81000000
Peripheral ID 0x04004bb4a3
Designer is 0x4bb, ARM Ltd
Part is 0x4a3, Cortex-A53 ROM (v7 Memory Map ROM Table)
Component class is 0x1, ROM table
MEMTYPE system memory not present: dedicated debug bus
[L01] ROMTABLE[0x0] = 0x10003
Component base address 0x81010000
Peripheral ID 0x04004bbd03
Designer is 0x4bb, ARM Ltd
Part is 0xd03, Cortex-A53 Debug (Debug Unit)
Component class is 0x9, CoreSight component
Type is 0x15, Debug Logic, Processor
[L01] ROMTABLE[0x4] = 0x11003
Component base address 0x81011000
Peripheral ID 0x04004bb9d3
Designer is 0x4bb, ARM Ltd
Part is 0x9d3, Cortex-A53 PMU (Performance Monitor Unit)
Component class is 0x9, CoreSight component
Type is 0x16, Performance Monitor, Processor
[L01] ROMTABLE[0x8] = 0x12003
Component base address 0x81012000
Peripheral ID 0x04004bbd03
Designer is 0x4bb, ARM Ltd
Part is 0xd03, Cortex-A53 Debug (Debug Unit)
Component class is 0x9, CoreSight component
Type is 0x15, Debug Logic, Processor
[L01] ROMTABLE[0xc] = 0x13003
Component base address 0x81013000
Peripheral ID 0x04004bb9d3
Designer is 0x4bb, ARM Ltd
Part is 0x9d3, Cortex-A53 PMU (Performance Monitor Unit)
Component class is 0x9, CoreSight component
Type is 0x16, Performance Monitor, Processor
[L01] ROMTABLE[0x10] = 0x14003
Component base address 0x81014000
Peripheral ID 0x04004bbd03
Designer is 0x4bb, ARM Ltd
Part is 0xd03, Cortex-A53 Debug (Debug Unit)
Component class is 0x9, CoreSight component
Type is 0x15, Debug Logic, Processor
[L01] ROMTABLE[0x14] = 0x15003
Component base address 0x81015000
Peripheral ID 0x04004bb9d3
Designer is 0x4bb, ARM Ltd
Part is 0x9d3, Cortex-A53 PMU (Performance Monitor Unit)
Component class is 0x9, CoreSight component
Type is 0x16, Performance Monitor, Processor
[L01] ROMTABLE[0x18] = 0x16003
Component base address 0x81016000
Peripheral ID 0x04004bbd03
Designer is 0x4bb, ARM Ltd
Part is 0xd03, Cortex-A53 Debug (Debug Unit)
Component class is 0x9, CoreSight component
Type is 0x15, Debug Logic, Processor
[L01] ROMTABLE[0x1c] = 0x17003
Component base address 0x81017000
Peripheral ID 0x04004bb9d3
Designer is 0x4bb, ARM Ltd
Part is 0x9d3, Cortex-A53 PMU (Performance Monitor Unit)
Component class is 0x9, CoreSight component
Type is 0x16, Performance Monitor, Processor
[L01] ROMTABLE[0x20] = 0x18003
Component base address 0x81018000
Peripheral ID 0x04004bb9a8
Designer is 0x4bb, ARM Ltd
Part is 0x9a8, Cortex-A53 CTI (Cross Trigger)
Component class is 0x9, CoreSight component
Type is 0x14, Debug Control, Trigger Matrix
[L01] ROMTABLE[0x24] = 0x19003
Component base address 0x81019000
Peripheral ID 0x04004bb9a8
Designer is 0x4bb, ARM Ltd
Part is 0x9a8, Cortex-A53 CTI (Cross Trigger)
Component class is 0x9, CoreSight component
Type is 0x14, Debug Control, Trigger Matrix
[L01] ROMTABLE[0x28] = 0x1a003
Component base address 0x8101a000
Peripheral ID 0x04004bb9a8
Designer is 0x4bb, ARM Ltd
Part is 0x9a8, Cortex-A53 CTI (Cross Trigger)
Component class is 0x9, CoreSight component
Type is 0x14, Debug Control, Trigger Matrix
[L01] ROMTABLE[0x2c] = 0x1b003
Component base address 0x8101b000
Peripheral ID 0x04004bb9a8
Designer is 0x4bb, ARM Ltd
Part is 0x9a8, Cortex-A53 CTI (Cross Trigger)
Component class is 0x9, CoreSight component
Type is 0x14, Debug Control, Trigger Matrix
[L01] ROMTABLE[0x30] = 0x1c003
Component base address 0x8101c000
Peripheral ID 0x04004bb95d
Designer is 0x4bb, ARM Ltd
Part is 0x95d, Cortex-A53 ETM (Embedded Trace)
Component class is 0x9, CoreSight component
Type is 0x13, Trace Source, Processor
[L01] ROMTABLE[0x34] = 0x1d003
Component base address 0x8101d000
Peripheral ID 0x04004bb95d
Designer is 0x4bb, ARM Ltd
Part is 0x95d, Cortex-A53 ETM (Embedded Trace)
Component class is 0x9, CoreSight component
Type is 0x13, Trace Source, Processor
[L01] ROMTABLE[0x38] = 0x1e003
Component base address 0x8101e000
Peripheral ID 0x04004bb95d
Designer is 0x4bb, ARM Ltd
Part is 0x95d, Cortex-A53 ETM (Embedded Trace)
Component class is 0x9, CoreSight component
Type is 0x13, Trace Source, Processor
[L01] ROMTABLE[0x3c] = 0x1f003
Component base address 0x8101f000
Peripheral ID 0x04004bb95d
Designer is 0x4bb, ARM Ltd
Part is 0x95d, Cortex-A53 ETM (Embedded Trace)
Component class is 0x9, CoreSight component
Type is 0x13, Trace Source, Processor
[L01] ROMTABLE[0x40] = 0x0
[L01] End of ROM table
ROMTABLE[0x4] = 0x0
End of ROM table

4. 适配器命令

!adapter用于观察硬件调试(也叫连接器或者适配器)的信息

4.1 !adapter name

显示适配器名称,典型执行结果如下:
[ndb]!adapter name
NTP-DAP

4.2 !adapter list

显示适配器列表,典型执行结果如下:
[ndb]!adapter list
The following debug adapters are available:
1: NTP-DAP

4.2 !adapter speed

显示适配器速度,典型执行结果如下:
[ndb]!adapter speed
adapter speed: 12000 kHz

[ndb]!aarch64 cache_info
L1 I-Cache: linelen 64, associativity 2, nsets 256, cachesize 32 KBytes
L1 D-Cache: linelen 64, associativity 4, nsets 128, cachesize 32 KBytes
L2 D-Cache: linelen 64, associativity 16, nsets 256, cachesize 256 KBytes

作者:admin  创建时间:2022-06-29 14:51
最后编辑:admin  更新时间:2024-04-23 09:02