cancel
Showing results for 
Search instead for 
Did you mean: 

Set a flag to test after reset

hbarta2
Associate III
Posted on July 11, 2015 at 00:11

Hi folks,

In my quest to leverage the built in bootloader I am employing code kindly provided by Clive to branch to the built in bootloader on the STM32F429I (As in

/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Calling%20stm32429I-Eval%20Bootloader&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&currentviews=187

.)

I find it works if called before SystemClock_Config() in main() but not afterwards. I suppose the bootloader code expects the processor state to be that following reset and this and SystemClock_Config()  invalidates that. (My app uses Cube libraries)

My next thought is to set some kind of flag in my application that can be tested (and cleared) on the next restart before calling SystemClock_Config() . I have not found that yet. I tried using a backup register in the RTC but the HAL APIs to init, read and write those registers seem not to work before SystemClock_Config()  is called. Any other suggestions for this would be welcome.

I'm going to try GPIO next but I would prefer something the app can set/clear and nothing seems obvious to me.

Thanks!

null
1 REPLY 1
Posted on July 11, 2015 at 01:42

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Threaded.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Jump%20to%20internal%20bootloader&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=1653

In CMSIS the function to do the reset is now NVIC_SystemReset();

With the F429 with 192KB of SRAM (+64K CCM RAM)

*((unsigned long *)0x2002FFF0) = 0xDEADBEEF; // Magic Value End of RAM, shrink arena if it make you happier.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..