cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55CG/NUCLEOf-WB55RG Firmware update OTA- Bluetooth. How to go to the BLE_OTA bootloader from the user application using a button.

PMana.1
Associate II

Hello,

I am working on an STM32WB55CG project and testing it on the NUCLEO-WB55RG board. I would like to do the firmware update over the ST BLE sensor app. I have loaded the bootloader program provided by st that is BLE_OTA file from the example. I have made the necessary changes to the user application such as editing the linker script, implementing reboot request characteristics, checking magic keywords, and so on. the user application is something similar to the heart_rate_ota example. I am able to flash this file using the st BLE sensor app. Since my app and code don't have a reboot button on the app similar to the heartrate_ota example I would like to do it with a user button. I am not able to figure this out. I tried different methods and doesn't work. my code in the interrupt look like this. This code only reset the board. what all changes need to be done for deleting the sectors and get an advertisement from the ota bootloader program. For example, when I press the button the existing user application must be deleted and the control should go to ota bootloader and it should advertise. then I should be able to connect it with st ble app and write new bin file. basically the reboot button would be the user button .

my user button code look like this.

void usr_button_irq_handler( void* obj )

{

button_int_count++;

printf( "Button Int Count : %d\r\n", button_int_count );

P2PS_STM_App_Notification_evt_t Notification;

#if(BLE_CFG_OTA_REBOOT_CHAR != 0)

       Notification.P2P_Evt_Opcode = P2PS_STM_BOOT_REQUEST_EVT;

       //Notification.DataTransfered.Length=attribute_modified->Attr_Data_Length;

       //Notification.DataTransfered.pPayload=attribute_modified->Attr_Data;

       P2PS_STM_App_Notification(&Notification);

#endif

uint32_t button_state = hal_gpio_get_value(USER_BUTTON);

if(button_state == 1){

leds_off( LED_RX_MASK );

usr_button_irq_state = false;

button_int_count = 0;

      button_reset_timer_stop();

}

else if(button_state == 0){

HAL_DBG_TRACE_PRINTF("Button pressed.\r\n");

leds_on( LED_RX_MASK );

usr_button_irq_state = true;

    button_reset_timer_start();

}

}

Thanks in advance

0 REPLIES 0