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.
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