cancel
Showing results for 
Search instead for 
Did you mean: 

How do prevent RTC time from resetting when jumping to application? with IAP (In Application Programming)

IMahe.1
Associate

I have a project with STM32L432KC, I have printed my custom board.

I made the flash memory into 3 partitions:

0693W00000aIn3hQAC.png 

So far I've successfully create and running the code, but I found issue.

Bootloader allow to receive new firmware (Application 1), synchronize RTC time, and reset the board via USB-FS (CDC).

I've successfully to sync RTC time in bootloader and keep the time from resetting if the board is in standby/reset mode, but when I jump to Application 1 RTC time will reset. and when I go back to bootloader the time in BootLoader will also reset.

So how do prevent RTC time from resetting when jumping to application?

Note:

  1. I'll disable USB-FS (PA11, PA12) when jump to application, I init the same pin for CANBus (PA11, PA12) in the Application 1
  2. I use RTC internal with LSE clock configuration
  3. I use toggle button to entry bootloader or App1
2 REPLIES 2

Make sure there's no code that blindly resets the RTC. As I recall some of the Cube boilerplate code does.​

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

Actually after jumping to app 1 the RTC time will reset because it can't get time from bootloader, I use HAL_RTCEx_BKUPWrite() to keep time in bootloader.

You have references for me to read?