Hi Chris
This looks correct to me and is very similar to my reference.
This is in fact the content of startup_gnu.s
/* The vector table is fixed in FLASH so that the processor can boot to the reset startup code */
.section .vectors, "ax"
.code 32
.align 0
.global _vectors
.global reset_code
.global end
.extern _LowLevelInit
.extern main
/* reset vector followed by exception vectors */
_vectors:
ldr pc, [pc, #_reset_handler - . - 8] /* reset vector */
ldr pc, [pc, #_undef_handler - . - 8] /* undefined instruction */
ldr pc, [pc, #_swi_handler - . - 8] /* swi handler */
ldr pc, [pc, #_pabort_handler - . - 8] /* abort prefetch */
ldr pc, [pc, #_dabort_handler - . - 8] /* abort data */
#ifndef _DEBUG_CODE_
.word 0xB8A06F88 /* LPC boot loader checksum */
#else
nop /* reserved */
#endif
ldr pc, [pc, #_irq_handler - . - 8] /* irq */
ldr pc, [pc, #_fiq_handler - . - 8] /* fiq */
_reset_handler:
.word reset_code
_irq_handler:
.word irq_handler
_undef_handler:
_swi_handler:
_pabort_handler:
_dabort_handler:
_fiq_handler:
.word default_code
/* defines
ARM_MODE_FIQ EQU 0x11
ARM_MODE_IRQ EQU 0x12
ARM_MODE_SVC EQU 0x13
I_BIT EQU 0x80
F_BIT EQU 0x40 */
.section .init, "ax"
.code 32
.align 0
/* Reset code - this is started as first code after a reset */
reset_code:
mrs r0, cpsr /* Read the status register */
bic r0, r0, #0x1f /* Mask out the mode bits */
orr r1, r0, #0x1b /* prepare undefined mode */
msr cpsr_cxsf, r1 /* set mode */
...
It is correct that _vectors is at 0x00000000 since it contains the reset and interrupt vector code. The chip boots from 0x00000000 only when the check sum of the vectors is correct. As you see, this is manually set so that it can be downloaded even by tools that don't calculate and add it themselves.
The code at 0x00000000 is simply jumping to reset_code, which is at .init - 0x00000030. You can also see that reset_code is at the address 0x00000030.
The difference that I do see it
0x00000030 Reset
I wonder where that is coming from, and why it is at the same address as the reset_code???
It may be 'overloading' the code. See whether you have a library linked with additional reset code that may be incompatible.
In my project there are only very few functions that get linked in from GCC libraries:
Archive member included because of file (symbol)
c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.2.3/thumb\libgcc.a(_udivsi3.o)
Build/debug.o (__aeabi_uidiv)
c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.2.3/thumb\libgcc.a(_divsi3.o)
Build/webInterface.o (__aeabi_idiv)
c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.2.3/thumb\libgcc.a(_dvmd_tls.o)
c:/program files/codesourcery/sourcery g++ lite/bin/../lib/gcc/arm-none-eabi/4.2.3/thumb\libgcc.a(_udivsi3.o) (__aeabi_idiv0)
Regards
Mark