cancel
Showing results for 
Search instead for 
Did you mean: 

OTA Firmware Update Bootloader

Emueller
Associate II

I'm working with an STM32WB09KE microcontroller and have implemented a bootloader to handle firmware updates downloaded via Bluetooth. The bootloader copies the downloaded firmware into the active application slot, and it works well for simple applications, such as basic "Hello World" examples. However, I encounter issues when attempting to boot my main Bluetooth (BLE) application.

Specifically:

  • With the debugger connected, the application enters the NMI_Handler() at the first call to a BLE function, BLE_STACK_Init().
    Without the debugger, the application progresses slightly further, reporting some BLE configuration functions (e.g., set_tx_power) as successful before also entering NMI_Handler().
  • I attempted to use the Application Install Manager from STM (Of course i adjusted my Slot Sizes and Boundaries like documented in the Heart_Rate_OTA example), which successfully boots the BLE application from the active slot, but copying the Firmware into the active Slot does not work.

My main questions are:

  1. Is there source code available for the Application Install Manager? Access to this might help me understand its BLE stack initialization process and other mechanisms that ensure stability in the BLE application.
  2. Are there any specific considerations or tips for making the BLE application run successfully when loaded by a custom bootloader? I have implemented a "magic number" check to ensure the integrity of the downloaded firmware before copying it to the active slot.

Here is the code I'm using to jump to the application.

 

 

 

void gotToApplication(void){
	typedef  void (*pFunction)(void);
	pFunction JumpToApplication;
	uint32_t JumpAddress;




	printf("Jumping to Application! \r\n");

    JumpAddress = *(__IO uint32_t*) (APPLICATION_START + 4);


   JumpToApplication = (pFunction) JumpAddress;

   __set_MSP(*(__IO uint32_t*) APPLICATION_START);
   JumpToApplication();
}

 

 

2 REPLIES 2
STTwo-32
ST Employee

Hello @Emueller 

I suggest you take a look at the implementation on the BLE_p2pServer_ota or the BLE_HeartRate_ota together with the BLE_ApplicationInstallManager They should be able to let you know how to implement OTA for a BLE application.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello,

 

thank you for your reply. I already did that.

 

with the both the ota apps it is not even possible for me to connect to the example application via the https://applible.github.io/Web_Bluetooth_App_WBA/ app. (The example code instantly disconnects again).

 

In the example you linked me there is no source code. That is why i was asking for the source code of the application install manager. It is an empty project with just the binary of the ApplicationInstallManager included.

 

Best Regards,

Eric Müller.