Jump to addres memory
Hi,
I have CrossStudio (Release 2.3.0.2012111600.16701) and Nuvoton chip NUC140. I want to do own bootloader (load to address 0 of APROM ), which can call Application program (load to address 0x1800 of APROM).
Test Application code toggles pins value.
Application code setting:
Selection Placement Macros: FLASH_START=0x1800
Preprocessor Definition: USE_PROCESS_STACK
STARTUP_FROM_RESET
Entry Point reset_handler
Memory map file
.init 0x000019e4 0x50 THUMB Flash Debug/NUC100_Startup.o
0x000019e4 reset_handler
Test Bootloader code:
int main(void)
{
void (*foo)(void);
foo = (void (*)(void)) 0x19e5;
foo();
}
Bootloader code setting:
Selection Placement Macros: FLASH_START=0x00
Preprocessor Definition: USE_PROCESS_STACK
STARTUP_FROM_RESET
Entry Point reset_handler
Calling Application code from Bootloader code, it works OK. But I don’t know, why I must call address 0x19e5, when entry point of Application code is reset_handler (0x19e4).
Everytime I must call reset_handler + 1, didn't it depend on setting project for example Optimalize level, other FLASH_START value of application code,…?
Thank you for reply.
Best Regards
Martin
-
As I understand it, the least significant bit of the address gets loaded into EPSR register 'T' bit and must be a one for the command to address to be executable. There are references to this in the ARM Cortex user guide.
DUI0552A_cortex_m3_dgug.pdf (at the bottom of the web page:)
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0552-
Please sign in to leave a comment.
Comments
1 comment