Currently i am trying to get the STM32F405 to jump to bootloader from application code without the use of the boot0 and boot1 pins.
I did already try multiple things to get that done but it always ended with the the firmware jumping to the bootloader (at least it seems like it) and after approximate 18 seconds the firmware restarts (no Watchdog or similar things that could wake the chip up again are used as far as i know). During those 18 seconds if i try to update the firmware the bootloader doesn't get found.
I tested things like:
1. (STM32F4 Jump to Bootloader via SoftReset and without BOOT0 and BOOT1 Pin)
- Set a value in SRAM
- Restart the STM32F405 with NVIC_SystemReset() to get the STM32F405 to close reset condition
- Check for value in SRAM ( if it's set do the following )
- Move stackpointer to bootloader address
- Jump to bootloader address + 4 (0x1FFF0000 + 4)
2.
- During runtime call function JumpToBootloader()
- Within that function disable interupts, reset SysTick, reset SYSCLK, call RCC_DeInit()
- Move stackpointer to bootlader address
- Jump to bootloader address + 4 (0x1FFF0000 + 4)
One approach i found but couldn't test yet was to do basically what i discribed in try 1. but using assembler code within the STM32F4xx startup file. The problem here is that the tutorial i found uses the KEIL assembler syntax which i cant use because i use the Atollic TrueSTUDIO and i have not enough knowlege about assembler to change the KEIL syntax to standard assembler syntax.
The thing that confuses me the most is that in an other project i use an STM32F3xx (cant remeber the correct number) and i do basically the same thing as in try 2. but with the the bootloader address of the STM32F3xx (0x1FFFD800) and it works perfectly fine and i can update the firmware via USB.
So the questions i have:
- What could i try next to get the bootloader running?
- What could be the cause in my current situation for the firmware to restart after X seconds?