cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB15CC update application with OTA

FWX
Associate III

Hello,
I'm writing an application running on Windows and Linux, using Qt to update STM32WB15CC application.

I have read AN5247 document and implement it, but my Qt application never receive the last Reboot Indicatatione ( characteristic uuid: "{0000fe23-8e22-4541-9d4c-21edae82ed19}"). I have configured it by writing [0x01,0x00] to descriptor of {00002902-...}.

First question: how to determine the value of the second byte in the BOOT REQUEST (Sector Index) for characteristic {0000FE11-8e22-4541-9d4c-21edae82ed19} ? How to caluate it?
Second question: after reboot and connect to OTA service, do I need to wait before sending command, or after sending command and before sending data?

Thank you for help.

1 ACCEPTED SOLUTION

Accepted Solutions
Remy ISSALYS
ST Employee

Hello,

Indeed the "Base address" characteristic mode is "Write without response", not "Write". For characteristic "File upload confirmation reboot" there is not error, the mode is "Indicate". The AN5247 will be update for the next revision. 

On WB15, the wireless coprocessor update is possible only with the BLE Light stack (stm32wb1x_BLE_Stack_light_fw.bin). Let's take an example of an update from BLE Light stack v1.17.3 to BLE Light stack v1.18.0. 

According to the release note, the BLE Light stack v1.17.3 is flashed at 0x08029000. So, SFSA address (see option byte) is equal to 0x08029000. The BLE Light stack v1.18.0 binary size is equal to 116 916 bytes => 58 sectors of 2 KB (0x1D000).

Download Addr = OldStackAdd(=SFSA) - NewStackSize(sector aligned) - 1 Sector

                         = 0x08029000 - 0x1D000 - 0x800

                         = 0x0800B800

So, the offset of the download address is 0xB800. 0xB800 / 0x800 = 0x17 => Sector index is equal to 0x17.

Best Regards

 

View solution in original post

5 REPLIES 5
Remy ISSALYS
ST Employee

Hello,

To enable the indication, you have to write the [0x02,0x00] to descriptor of "File upload confirmation reboot" characteristic.  

On WB55, the sector size is equal to 4 KB (0x1000) and for WB15, the sector size is equal to 2 KB (0x800). BLE_Ota application is located between 0x08000000 and 0x08007000. So, if you perform an application update, you should be on top of BLE_Ota loader, so you download the update at 0x08007000 which correspond to sector 14 for WB15. If you perform a wireless coprocessor update, you should calculate the download address and deduce the sector index using the following formula:

Download Addr = OldStackAdd(=SFSA) - NewStackSize(sector aligned) - 1 Sector

For your last question, no specific constraint.

Best Regards

FWX
Associate III

Hi Remy,

Thank you for your answer and all informations.

It is a shame that these details are not included in the document AN5247.

 

And I think there are two small errors in this document:

- § 3.2.2: for characteristic "Base address", mode is "Write without response", not "Write"

               for characteristic "File upload confirmation reboot", mode is "Notify", not "Indicate"

 

Now, I'm able to download application to my STM32WB15CC board. Thank you.

 

For the last point, to use the formula to calculate the download address and deduce the sector index, how to know what is the value for SFSA and the value for the new stack size ?

 

Thank you for your help.

Remy ISSALYS
ST Employee

Hello,

Indeed the "Base address" characteristic mode is "Write without response", not "Write". For characteristic "File upload confirmation reboot" there is not error, the mode is "Indicate". The AN5247 will be update for the next revision. 

On WB15, the wireless coprocessor update is possible only with the BLE Light stack (stm32wb1x_BLE_Stack_light_fw.bin). Let's take an example of an update from BLE Light stack v1.17.3 to BLE Light stack v1.18.0. 

According to the release note, the BLE Light stack v1.17.3 is flashed at 0x08029000. So, SFSA address (see option byte) is equal to 0x08029000. The BLE Light stack v1.18.0 binary size is equal to 116 916 bytes => 58 sectors of 2 KB (0x1D000).

Download Addr = OldStackAdd(=SFSA) - NewStackSize(sector aligned) - 1 Sector

                         = 0x08029000 - 0x1D000 - 0x800

                         = 0x0800B800

So, the offset of the download address is 0xB800. 0xB800 / 0x800 = 0x17 => Sector index is equal to 0x17.

Best Regards

 

Hi Remy,

Thank you very much for your detailed answer.

"On WB15, the wireless coprocessor update is possible only with the BLE Light stack" : perhaps this is the explanation why I can't download firmware stm32wb1x_BLE_Stack_full_fw.bin to the WB15CC using the STM32Cube programmer. I have posted a message this morning:

"Error: failed to download Segment[0]" while downloading firmware to STM32WB15CC with STM32CubeProgr

Best regards,

                                                  FWX.

Remy ISSALYS
ST Employee

Hello,

The constraint for BLE Light stack concerns only the FUOTA. Of course, you can use the BLE Full stack on WB15. I will check your post of this morning.

Best Regards