Skip to main content
serhat
Associate
December 27, 2022
Solved

STM32WB55 BLE_Ota erasing the flash when upload is started

Hello everyone,

I'm using BLE_Ota application for STM32WB55 (https://github.com/STMicroelectronics/STM32CubeWB/tree/master/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota)

I can able to run the code successfully. In the OTA code, it erases the flash by Delete_Sectors function in App_BLE_Init. So, it means that the flash is erased when switching the OTA mode.

However, I want to erase the flash only when the upload process is started and if the user doesn't start to upload new firmware in 2 mins, exit the OTA mode and switch back to the application.

Could you please help me how to do?

Best regards.

Serhat.

This topic has been closed for replies.
Remy ISSALYS
Remy ISSALYSBest answer
ST Technical Moderator
January 6, 2023

Hello,

You can start a timer when you start BLE_Ota and move the call to delete_sectors function when the first packet is received, in this case stop the timer and upload the new firmware. If a timeout occurs jump on the app.

Best Regards

2 replies

Remy ISSALYS
Remy ISSALYSBest answer
ST Technical Moderator
January 6, 2023

Hello,

You can start a timer when you start BLE_Ota and move the call to delete_sectors function when the first packet is received, in this case stop the timer and upload the new firmware. If a timeout occurs jump on the app.

Best Regards

serhat
serhatAuthor
Associate
January 9, 2023

Thank you for reply.