cancel
Showing results for 
Search instead for 
Did you mean: 

How to boot the OTA program at address 0x08000000 with a custom program at address 0x08007000 from the ST BLE Toolbox app. I have the P2P Server service with the OTA Reboot Characteristic.

DSaci.2
Associate II

From the ST BLE Toolbox app, I see the OTA Reboot Characteristic on my connected BT device. I type in 01 and the following code is executed:

void P2PS_STM_App_Notification(P2PS_STM_App_Notification_evt_t *pNotification)

{

/* USER CODE BEGIN P2PS_STM_App_Notification_1 */

/* USER CODE END P2PS_STM_App_Notification_1 */

 switch(pNotification->P2P_Evt_Opcode)

 {

/* USER CODE BEGIN P2PS_STM_App_Notification_P2P_Evt_Opcode */

#if(BLE_CFG_OTA_REBOOT_CHAR != 0)

  case P2PS_STM_BOOT_REQUEST_EVT:

   APP_DBG_MSG("-- P2P APPLICATION SERVER : BOOT REQUESTED\n");

   APP_DBG_MSG(" \n\r");

   *(uint32_t*)SRAM1_BASE = *(uint32_t*)pNotification->DataTransfered.pPayload;

   NVIC_SystemReset();

   break;

#endif

When the reset occurs, the program at address 0x08007000 and not the OTA program at 0x08000000 is executed. According to the app note AN5247, the Reboot request characteristics is:

Field 0 - Boot mode 0x00 for application boot and 0x01 for OTA boot

Field 1 - Sector Index 0xXX -> 0x080XX000

Field 3 - Number of sectors to erase 0x00 – 0xFF

The only way the above code is executed if I type in 01 into the OTA Reboot Request field.

Any Ideas?

Don

3 REPLIES 3
Remy ISSALYS
ST Employee

Hello,

To boot on BLE_Ota, you have to send the value 0x0107yy with yy the number of sectors to erase (depend on your application) in OTA reboot characteristic. I recommend to you to use ST BLE Sensor application to perform OTA, on ST BLE Toolbox you can perform OTA but you need to send the binary "by hand".

Best Regards

DSaci.2
Associate II

Remy,

Thank you. I was confused on the Field 1 size, since field 3 was is after field 1. To me, this implies Field 2 is 2 bytes long.

Anyways, this works for me

Don

Remy ISSALYS
ST Employee

Hello,

Indeed, there is a typo in AN5247, thanks for your feedback, it will be updated in the next version.

Best Regards