Coprocessor Binary upgrade procedure from CPU1 (without using bootloader/SWD)
AN5185 mentions the process to install a new/updated version of the coprocessor binary.
My setup:
STM32WB5xxE(512K)
stm32wb5x_BLE_Stack_full_fw.bin (v1.6.0)
I'm able to program the BLE stack using a debug probe (SWD) using the description given in the Copro_Wireless_Binaries Release Notes.
AN5185 gives the following instructions to calculate the program address:
- If new install (no wireless stack currently installed): 0x08000000+(SFSA x 4KB) - ImageSize
- If a wireless stack is already installed:
- If new image size <= current image size: WirelessStackAddress - ImageSize
- If new image size > current image size: WirelessStackAddress - (2xImageSize – WirelessStackSize
It is advised to perform a FUS_FW_DELETE operation before starting a wireless stack
installation. (This is performed by CubeProgrammer when option -firstinstall=0 is selected)
For case 1 (no stack currently installed) the calculation yields a different address than the release notes:
SFSA: 0xF4
ImageSize: 164.816 bytes
--> Program Address = 0x08000000 + (0xF4 * 4KB) - 164816 = 0x80C BC30
Which is different from the (working) 0x805 7000
Not surprisingly when trying to install the stack with address 0x80C BC30 it fails.
For case 2.1 (a version of the wireless stack is already installed, new image smaller or equal in size):
Wireless Stack Address (i assume current): 0x805 7000
ImageSize: 164.816 bytes
--> Program Address = 0x805 7000 - 164816 = 0x802 EC30
Trying to update the stack with this address fails.
Case 2.2 I didn't try yet.
All the attempts to program were made with the Stm32CubeProgrammer tool, supplying the firstinstall=1 argument for it not to erase the stack previous to installing/updating.
So the questions are:
- Why do the calculated addresses differ from what is listed (and working) in the Release Notes?
- What is the correct procedure to update (without deleting) the wireless stack
- How does the FUS find a newly installed image? Which address is it looking at to find it?
Regarding question 3: AN5185 also states in the footnotes of Table 9 that when sending a FW_UPGRADE IPCC command to CPU2, the source and destination address fields are currently not supported. This is also seen in the BLE_OTA demo application, which supplies these parameters as 0, which then does not include them in the IPCC message. How will CPU2 find the encrypted image in case of an update (i.e. old stack not deleted)?
Your help on this topic is highly appreciated!