2014-10-20 11:49 PM
Hi,
I have couple binaries packed as one Intel hex format and flashed using KEIL. Bootrom and application are placed at 0x08000000 and 0x081C00000 respectively in STM32F427. My bootrom will copy the application code from flash to RAM and verifies CRC. If CRC fails it jumps to bootrom main(). I have verified that it is copying to RAM from flash and CRC is also correct. how will I jump to application start address so that application main() executes and bypassing bootrom's main(). Both bootrom and application uses same start_xxx.s file. Can anyone give me pointers how to jump to application main(). I tried modifying SCB->VCTR to jump to application but it failed. #st #keil2014-10-21 01:01 AM
I think you need to understand that you can't just jump to main(), the C runtime environment (stack, statics, etc) need to be initialized first, and this is what __main does in Keil and _cstartup (sic) in IAR
2014-10-21 07:43 AM
Hi Clive,
Thanks for the reply. I referred to your link, trying to understand whether that part of assembly code just points to RAM location or copies the flash contents to RAM too. Since I have part of code copying flash to RAM done in 'C' and validating with CRC. Trying to link these two modules. Another thing to understand what are trying to invalidate in these two following linesLDR R2, [R0, #0]
STR R0, [R0, #0] ; Invalidate2014-10-21 08:55 AM
The SRAM based magic number constant I'm using to direct/control the boot execution path.
The value is first loaded into the R2 register, then the value in the SRAM is destroyed.