2022-12-14 03:19 PM
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
2023-01-06 01:23 AM
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
2023-01-06 03:46 AM
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
2023-01-06 09:50 AM
Hello,
Indeed, there is a typo in AN5247, thanks for your feedback, it will be updated in the next version.
Best Regards