ARM Technical Support Knowledge Articles

Examples of AXD and ADW/ADU/armsd scripts

Applies to: ARM Developer Suite (ADS)

Answer

The following are examples of AXD and ADW/ADU/armsd scripts which you may find useful:

1. To debug an embedded system (code in ROM/Flash)

ADW/ADU/armsd:

readsyms embed.axf
pc = 0x0
cpsr = %IFt_SVC (in SDT, this was cpsr = %IFt_SVC32)
$vector_catch = 0
$semihosting_enabled = 0
$top_of_memory = 0x40000

AXD:

loadsymbols embed.axf
setpc 0
sreg cpsr 0xd3
spp vector_catch 0
spp semihosting_enabled 0
let $top_of_memory 0x40000

2. To check correct implementation of memory management (e.g. Byte/short read/write access to memory)

ADW/ADU/armsd:

examine 0x8000, 4         | Display a word in memory
*(char *)0x8000 = 0x99 | Write a byte to that address
print/h *(char *)0x8000 | Display the byte just written
examine 0x8000, 4 | Display the whole word again
*(short *)0x8000 = 0x1234 | Write a half-word to that address
print/h *(short *)0x8000 | Display the half-word just written
examine 0x8000, 4 | Display the whole word again

For byte read/writes, if the value read in step 3 does not match the value written in step 2, then there is byte memory access problem (probably in the memory controller).

Whether this is a read or a write problem is identifiable by comparing the results of steps 1 and 4. Similarly for half-word read/writes for steps 4 to 7.

AXD:

mem 0x8000 +4 32
smem 0x8000 0x99 8
mem 0x8000 +1 8
mem 0x8000 +4 32
smem 0x8000 0x1234 16
mem 0x8000 +2 16
mem 0x8000 +4 32

3. To prepare for DCC semihosting:

ADW/ADU/armsd:

load embed.axf
$semihosting_dcchandler_address = 0x70000
$semihosting_enabled = 2

AXD:

load embed.axf
spp semihosting_dcchandler_address 0x70000
spp semihosting_enabled 2

Note: it is important to set the semihosting_dcchandler_address before setting semihosting_enabled, because the DCC code is downloaded to the target when the semihosting_enabled 2 command is executed.

4. To program the EmbeddedICE logic to chain its RANGEOUT:

ADW/ADU/armsd:

$vector_catch = 0
$semihosting_enabled = 1
cw 0 8 0x00008098 | - Address value, unit 0 (write_cycle)
cw 0 9 0x00000003 | - Address mask, unit 0 (ignore bottom 2 bits)
cw 0 10 0x00000000 | - Data value, unit 0
cw 0 11 0xffffffff | - Data mask, unit 0 (ignore data)
cw 0 12 0x140 | - Control value, unit 0 (enabled, chain SET)
cw 0 13 0x0bf | - Control mask, unit 0 (chain only)
cw 0 16 0x000080a8 | - Address value, unit 1 (flag_addr)
cw 0 17 0x00000003 | - Address mask, unit 1 (ignore bottom 2 bits)
cw 0 18 0x00000006 | - Data value, unit 1 (value 0x6)
cw 0 19 0x00000000 | - Data mask, unit 1 (compare whole value)
cw 0 20 0x001 | - Control value, unit 1 (disabled, writes)
cw 0 21 0x0fe | - Control mask, unit 1 (nRW only)

AXD (ADS 1.0.1 and earlier):

spp vector_catch 0
spp semihosting_enabled 0
sreg "coproc 0|c8" 0x00008098
sreg "coproc 0|c9" 0x00000003
sreg "coproc 0|c10" 0x00000000
sreg "coproc 0|c11" 0xffffffff
sreg "coproc 0|c12" 0x140
sreg "coproc 0|c13" 0x0bf
sreg "coproc 0|c16" 0x000080a8
sreg "coproc 0|c17" 0x00000003
sreg "coproc 0|c18" 0x00000006
sreg "coproc 0|c19" 0x00000000
sreg "coproc 0|c20" 0x001
sreg "coproc 0|c21" 0x0fe

AXD (ADS 1.1 and later):

spp vector_catch 0
spp semihosting_enabled 0
sreg "EICE Watch 0|Address Value" 0x00008098
sreg "EICE Watch 0|Address Mask" 0x00000003
sreg "EICE Watch 0|Data Value" 0x00000000
sreg "EICE Watch 0|Data Mask" 0xffffffff
sreg "EICE Watch 0|Control Value" 0x140
sreg "EICE Watch 0|Control Mask" 0x0bf
sreg "EICE Watch 1|Address Value" 0x000080a8
sreg "EICE Watch 1|Address Mask" 0x00000003
sreg "EICE Watch 1|Data Value" 0x00000006
sreg "EICE Watch 1|Data Mask" 0x00000000
sreg "EICE Watch 1|Control Value" 0x001
sreg "EICE Watch 1|Control Mask" 0x0fe

Article last edited on: 2008-09-09 15:47:28

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential