Skip to main content
kweisi50
Associate III
December 12, 2019
Question

Custom bootloader based on AN3990 firmware updgrade via USB key

  • December 12, 2019
  • 2 replies
  • 710 views

Hi,

I followed the AN3990 and managed to update the code supplied to use HAL and get it working correctly on our custom board. But in my readings on custom bootloaders in the forums, it mentions things like disabling interrupts before jumping to the program location in flash. The example code with the application code did not do the latter, so for the sake of good practices and reliability, what are correct actions before and after the jump to the code in flash.

Thanks in advance.

MikeZ

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
December 12, 2019

The RAM utilization in the app will be different in the loader, so peripheral instance structures and IRQ and callback functions will likely malfunction unless efforts are made to pass this data.

You should turn off interrupting sources prior to transfer, and reestablish them within the new operational context.​

You can establish a contract both side, for example pass data or determine which side should establish clocks and external memory interfaces, then not repeat that initialization.​

The expectations are not STM32 specific.​ Think through the logic and consequences.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
kweisi50
kweisi50Author
Associate III
December 16, 2019

Hi Clive1,

Thanks.

MikeZ