I wrote a custom bootloader for STM32F4. I'm able to write the user app to the mcu, but I have trouble running it. When I try to jump to the user application, nothing happens and I don't get a message to the console from the user application.
I wrote a custom bootloader for STM32F4. I'm able to write the user app to the mcu, but I have trouble running it. When I try to jump to the user application, nothing happens and I don't get a message to the console from the user application.
These two are overlapping, no idea what the linker makes out of this.
Double check addresses, the .map files, and verify the flash with st-link.
The bootloader disables interrupts and sets PRIMASK, will the application restore them?
Stock STM32 startup code sets SCB->VTOR in system_stm32f4xx.c, verify the offset there.
If all the above fails to cure the problem, follow the jump to the application in the disassembly window, see whether the code there is resembling startup_stm32*.s or it's complete junk.
Next time, please paste text in a code block instead of screenshots. Post the complete part number, STM32F4 has many variants.
> Stock STM32 startup code sets SCB->VTOR in system_stm32f4xx.c, verify the offset there.
Clive proposed a good patch for this.
Basically, patch system_stm32f4xx.c to always put to SCB->VTOR the address of the vector table, which is exported by the startup asm file (the name depends on compiler - gcc or Keil).