cancel
Showing results for 
Search instead for 
Did you mean: 

Launch FUOTA in custom application for a STM32WB5MMG

jorgazam
Associate II

Hi,

I'm currently working to start the FUOTA on a STM32WB, so I've spent several time following the Application Note AN5247 and watching the MOOC - STM32WB Firmware Update Over the Air (FUOTA) videos that explain how to run the OTA on a P-NUCLEO-WB55 board. Following the steps, I've managed to get everything working without problem.

I want to launch the OTA on a STM32WB5MMG Discovery board, so the main issue I have is that doesn't seems to be too many information on how to do this outside of the examples.

The Application Note is a really guided example for the NUCLEO board, same goes for the videos. Even after having followed it, I'm still not sure what I should do in my project if I want to be able to do the same thing in a different MCU with a custom application. The examples that I find in CubeIDE are not configurable, and doesn't include an .ioc file that allows me to see what changes have been made here so the OTA works on the MCU. Finally, I haven't been able to find information about generating a .bin file of my custom application to send it to the MCU through BLE.

Is there any more information on how to make it work in this microcontroller? Or an editable example project in order to check how to do it in my project. I'll be grateful if I can find this information. Any comment or suggestion is welcome.

Thank you very much, Jorge.

1 REPLY 1
Remy ISSALYS
ST Employee

Hello,

To support FUOTA in your custom application, follow these steps:

  • Add the REBOOT OTA MODE CHARACTERISTIC, in order to do this you can look each part of the code which is under BLE_CFG_OTA_REBOOT_CHAR define in BLE_HeartRate_ota example.
  • Delete the VTOR table configuration, indeed when the application is expected to be downloaded by OTA, the SCB→VTOR must be not modified, as it has already been set to the correct value by the BLE_Ota application. So, in SystemInit function replace this code:
#if defined(VECT_TAB_SRAM) && defined(VECT_TAB_BASE_ADDRESS)  
  /* program in SRAMx */
  SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET;  /* Vector Table Relocation in Internal SRAMx for CPU1 */
#else    /* program in FLASH */
  SCB->VTOR = VECT_TAB_OFFSET;              /* Vector Table Relocation in Internal FLASH */
#endif

By this:

/**
   * When the application is expected to be downloaded by OTA, the SCB->VTOR shall not be modified
   * as it has already been set to the correct value by the BLE_Ota application before jumping
   * to the current application
   */
  • Modify your linker file to take into account the new memory placement of the user application (above OTA application), the binary is generated with a reset vector moved up from seven sectors. See the difference between the linker file of BLE_HeartRate and BLE_HeartRate_ota projects.

Best Regards