How do prevent RTC time from resetting when jumping to application? with IAP (In Application Programming)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-03-13 02:25 AM
I have a project with STM32L432KC, I have printed my custom board.
I made the flash memory into 3 partitions:
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:
- I'll disable USB-FS (PA11, PA12) when jump to application, I init the same pin for CANBus (PA11, PA12) in the Application 1
- I use RTC internal with LSE clock configuration
- I use toggle button to entry bootloader or App1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-03-13 02:31 AM
Make sure there's no code that blindly resets the RTC. As I recall some of the Cube boilerplate code does.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-03-13 02:46 AM
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?