cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB OTA upgrade : wireless stack image location + reboot CPU2 into fus mechanism

BPeet.1
Associate

When uploading a wireless stack image via the ble ota application, how is it communicated to the FUS where the image is located in flash ?

At the end of the data transfer, in otas_app.c there is the part where it says in the comments "Request CPU2 to reboot on FUS by sending two FUS command" but as far as I can see image location and size are never communicated to the FUS.

In AN5185 it is mentioned when using the programmer you should put it at DownloadAddress = 0x08000000 + (SFSA x SectorSize) - ImageSize - 1xSectorSize so I am guessing this is also the case then when using the ota update, but even then the FUS does not know the image size so it would not know the start address (unless there is a 'footer' section in the image at a fixed location in the end).

And on a sidenote, what is the deal with the 2 FUS get status commands after another trigger a reboot ?? Do I understand that correctly ? What are the timing requirements thre, if the processor is preempted by some interrupt between those calls maybe no reset will happen and it sits there waiting forever ? And I coincidentially some code does 2 status calls too soon after another you also get a reset ?

1 REPLY 1
Remy ISSALYS
ST Employee

Hello,

When the CPU2 reboot on FUS, the FUS go through the memory to find the image footer (see part 6.4 of AN5185) which contain the binary information like the flash image size, the version...

If the wireless stack is running, it is possible to force FUS to run by sending 2 FUS_GET_STATE commands.

Best Regards