2019-01-22 07:01 AM
I'm building an application where the flash is divided to facilitate firmware upgrades from a self written bootloader. If I try and run run the code without the bootloader on the MCU with the start address 0x08008000 the SysTick does not run. I assume none of my interrupt will fire as the vector table isn't in the right place. The examples ST offers for launching applications from bootloaders is very vague and does not mention anything about this. Simply set the MSP, cast your flash address to a function pointer and call it.
Is there anything else I should be doing? Any pointers would be great.
Thanks
2019-01-22 07:17 AM
You said it - vector table. You should relocate it. Read about it in Programmer's Manual of your microcontroller. The register is called SCB->VTOR.
See example projects here:
https://www.st.com/en/embedded-software/x-cube-iap-usart.html
Also read its accompanying application note (AN4657) - https://www.st.com/resource/en/application_note/dm00161366.pdf
2019-01-22 07:41 AM
Usually addressed by a constant in SystemInit(), better to use a symbol and let the linker fix-up
2019-01-22 08:44 AM
Thanks guys, got it.
2019-01-22 09:26 AM
Also check out my solution here:
Additionally to that VTOR should be set in application code also. It should be done at least for debugging purposes, if debugger starts execution from application base address and therefore bootloader is not executed.
2019-01-23 04:10 AM
I'm having another problem now. It doesn't seem to matter which application I load it always crashes in the following startup code at the adds instruction. I have no idea why this is the case. Again any ideas of where to look for the problem would be great, thank you.
__libc_init_array:
...
...
adds r6, #1
...