cynergizer wrote on Thursday, January 27, 2011:
I have a user app that runs splendidly when I place the app at the start of flash. However, when I instead locate my user app at location 0x00007000 in flash, my user app’s swi handler is no longer found. I have a custom bootloader at the start of flash that always runs upon reboot, then jumps to my user app. The bootloader runs fine, and jumps to my user app no problem. My user app starts running fine, including successfully executing various vectored IRQs, but then crashes when it doesn’t find the swi handler, vPortYieldProcessor. My map file shows that my swi handler, vPortYieldProcessor is at location 0x0000be70. This seems reasonable. My map file also shows my vectors to start at location 0x00007000, and I don’t see any user app code located prior to 0x7000 - all good. I am trying to run directly out of flash - no vectors are remapped to RAM. When it gets a swi, it jumps to my swi_handler for my custom bootloader’s default swi handler at location 0xA8. Yikes!:
swi_handler:
b swi_handler
How could the user app be using the bootloader’s address for the swi handler? I am not using the swi handler for any other purpose. These builds are entirely separate. In my user app, I tried modified the start-up code to explicitly call the handler (instead of relying on overriding the default swi handler), but these changes had no effect. Thanks for any advice you might have! I’m using the lpc2148 on an ngx mini-blueboard, Rowley crossworks IDE, and the freeRtos V6.0.5 gcc port to this processor.
Here are some excerpts from my startup assembly:
_vectors:
ldr pc, /* reset */
ldr pc, /* undefined instruction */
ldr pc, /* swi handler */
ldr pc, /* abort prefetch */
ldr pc, /* abort data */
#ifdef VECTORED_IRQ_INTERRUPTS
.word 0xB9205F88
/* .word 0xB9205F88 boot loader checksum */
ldr pc, /* irq handler */
#else
.word 0xB8A06F60
/* .word 0xB8A06F60 boot loader checksum */
ldr pc, /* irq handler */
#endif
ldr pc, /* fiq handler */
reset_handler_address:
#ifdef STARTUP_FROM_RESET
.word reset_handler
#else
.word reset_wait
#endif
undef_handler_address:
.word undef_handler
swi_handler_address:
.word swi_handler
pabort_handler_address:
.word pabort_handler
dabort_handler_address:
.word dabort_handler
/******************************************************************************
* *
* Default exception handlers *
* These are declared weak symbols so they can be redefined in user code. *
* *
******************************************************************************/
undef_handler:
b undef_handler
swi_handler:
b swi_handler
pabort_handler:
b pabort_handler
dabort_handler:
b dabort_handler
fiq_handler:
b fiq_handler
irq_handler:
b irq_handler
.weak undef_handler, swi_handler, pabort_handler, dabort_handler, fiq_handler, irq_handler