cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB - How to add additional/reboot characteristic to bluetooth mesh proxy node?

JFeue.1
Associate

Hello,

I want to be able to perform OTA updates of nodes in a bluetooth mesh network. Therefore I want to add a service and a characteristic to the existing BLE connection between a proxy node and a smartphone/PC. Currently, only the mesh provisioning service (UUID 0x1827) is present on the STM32WB using the example program BLE_MeshLightingPRFNode for the STM32WB55.

Could you please provide some guidance on how to add an additional characteristic to a BLE connection of a mesh node?

I've tried to add an additional service using the functions aci_gatt_add_service(...) and aci_gatt_add_char(...) to add a characteristic. I've tested calling these functions from different places in the program flow. Calling these functions before MESH_Init(...) in Middlewares/.../mesh.c or after MESH_Init(...) both didn't work.

If someone has a suggestion how to do it, I would be very grateful.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Remy ISSALYS
ST Employee

Hello,

OTA update over BLE Mesh network isn't yet available, it will be available in BLE Mesh v1.1. To update via OTA an unprovisioned node, there is no example but you can add OTA support to Mesh project. To do that, you shall add OTA reboot characteristic (look the code under the #define BLE_CFG_OTA_REBOOT_CHAR in BLE_HeartRate project), modify the linker file to flash your application at 0x08007000 (look the difference between stm32wb55xx_flash_cm4.icf and stm32wb55xx_flash_cm4_ota.icf) and remove the following part in SystemInit function:

#if defined(VECT_TAB_SRAM) && defined(VECT_TAB_BASE_ADDRESS)  

 /* program in SRAMx */

 SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAMx for CPU1 */

#else  /* program in FLASH */

 SCB->VTOR = VECT_TAB_OFFSET;       /* Vector Table Relocation in Internal FLASH */

#endif

When the application is expected to be downloaded by OTA, the SCB->VTOR shall not be modified as it has already been set to the correct value by the BLE_Ota application before jumping to the current application.

You need to load BLE_Ota application at 0x08000000 and your Mesh application with OTA at 0x08007000.

Best Regards

View solution in original post

2 REPLIES 2
Remy ISSALYS
ST Employee

Hello,

OTA update over BLE Mesh network isn't yet available, it will be available in BLE Mesh v1.1. To update via OTA an unprovisioned node, there is no example but you can add OTA support to Mesh project. To do that, you shall add OTA reboot characteristic (look the code under the #define BLE_CFG_OTA_REBOOT_CHAR in BLE_HeartRate project), modify the linker file to flash your application at 0x08007000 (look the difference between stm32wb55xx_flash_cm4.icf and stm32wb55xx_flash_cm4_ota.icf) and remove the following part in SystemInit function:

#if defined(VECT_TAB_SRAM) && defined(VECT_TAB_BASE_ADDRESS)  

 /* program in SRAMx */

 SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAMx for CPU1 */

#else  /* program in FLASH */

 SCB->VTOR = VECT_TAB_OFFSET;       /* Vector Table Relocation in Internal FLASH */

#endif

When the application is expected to be downloaded by OTA, the SCB->VTOR shall not be modified as it has already been set to the correct value by the BLE_Ota application before jumping to the current application.

You need to load BLE_Ota application at 0x08000000 and your Mesh application with OTA at 0x08007000.

Best Regards

rdiaz_ice
Associate II

Hey!
Have you been able to add a new service or characteristic to the project? Also, is this OTA update method working for you?


Thanks for advance, 

Ruben.