I’m using an LPC2103 and openocd to build a robotics project. I’m having one small problem though. The first instruction out of reset is not being executing and when I use openocd to disassemble it reads nothing at address 0x0. As can be seen below the instruction at reset should be effectively a branch to my reset function. From there I set-up the stack, data, and bss sections, and I make a jump to main code.
_start:
ldr pc,_reset
ldr pc,_undf
ldr pc,_swi
ldr pc,_pabt
ldr pc,_dabt
nop
ldr pc,[pc,#-0xFF0]
ldr pc,_fiq
_reset: .word __reset
_undf: .word __undf
_swi: .word __swi
_pabt: .word __pabt
_dabt: .word __dabt
_irq: .word __irq
_fiq: .word __fiq
__reset: b _init
__undf: b .
__swi: b .
__pabt: b .
__dabt: b .
__irq: b .
__fiq: b .
Instead based on the output of the assemble below there is nothing at 0x00.
> armv4_5 disassemble 0x0 10
0x00000000 0x00000000 ANDEQ r0, r0, r0
0x00000004 0xe59ff018 LDR r15, [r15, #0x18]
0x00000008 0xe59ff018 LDR r15, [r15, #0x18]
0x0000000c 0xe59ff018 LDR r15, [r15, #0x18]
0x00000010 0xe59ff018 LDR r15, [r15, #0x18]
0x00000014 0x9ec04f9c MCRLS p15, 0x06, r4, c0, c12, 0x04
0x00000018 0xe51ffff0 LDR r15, [r15, #-0xff0]
0x0000001c 0xe59ff014 LDR r15, [r15, #0x14]
So far I’ve checked that my linker, my openocd config file, and the command I use to load code into flash in openocd and all are set to load code at an offset of 0x0 at address 0x0. Below is the cmd in openocd I use to load code to flash.
flash write_binary 0x0 /home/phillip/RoboJackets/RoboCup/firmware/robot/robot0.bin 0x0
wrote 3840 byte from file /home/phillip/RoboJackets/RoboCup/firmware/robot/robot0.bin to flash bank 0 at offset 0x00000000 in 1s 219959us (3.073874 kb/s)