2020-09-09 04:29 AM
As far as I see, the wireless stack can be installed at any location.
Currently the Release Notes for the Coprocessor Binaries give an address to install them to, depending on the part flash memory size.
For example the BLE_Stack_light install location changed from version 1.6.0 to 1.8.0
When updating the wireless stack in the product (i.e. without deleting the old stack) and the new stack is larger than the previous one, AN5185 states:
If new image size > current image size: WirelessStackAddress - (2xImageSize – WirelessStackSize
Is the additional storage used temporarily? Or is the new stack installed below the current one?
In the latter case: would it be sensible to initially install the stack at a lower address to allow updates "in place" when the wireless stack size changes?
2020-09-15 09:26 AM
Hello,
The new stack replaces always the old one .
Eg:
If the current wireless stack is 100K and the new one is 120K, the FUS will secure 20K additionnal flash to install the new FW.
There is no lost/spare sectors in the secure flash after a wireless firmware is installed. The secure flash just fits what is needed.
Regards.
2020-09-15 10:40 AM
Hello Christophe,
thank you for the details on this one.
One further question:
if new image size > current image size: WirelessStackAddress - (2xImageSize – WirelessStackSize)
still is true? I assume the additional space is used temporarily while extending the secure flash area?
Is it in general a problem to use any lower installation address during an update (meaning the formula just gives an upper bound)? This seems to work fine for me now, but I would appreciate it if you could confirm this.
2020-09-15 12:27 PM
If you do not intend to upgrade the FW stack via OTA, I recommend you just perform a fwdelete command first and then load the stack just below the FUS area.(0x080F4000).
2020-09-15 12:58 PM
I indeed intend to upgrade the wireless stack via OTA, so running a fwdelete is not an option.
2020-09-18 04:17 PM
I tried testing this with the only test subject available: The BLE Light Stack. Its the only one that is available that changed it's install address with it's releases that are supported on the STM32WB55CE (512KB).
I installed the 1.5.0 stm32wb5x_BLE_Stack_light_fw.bin at the recommended address 0x08065000. Then I flashed the binary at address 0x08040000. This is LESS than the documented space needed during an update (violating the 2x ImageSize constraint). While the Stm32CubeProgrammer gave me an error message (FUS_STATE_ERR_UNKNOWN) the update worked (SFSA was changed to 0x62 and my firmware read the correct version 1.8.0).
if new image size > current image size: WirelessStackAddress - (2xImageSize – WirelessStackSize)
So is this constraint not needed? This is important for me since whith SBSFU there wouldn't be enough space to adhere to it on a 512kB device for the FULL stack.
2020-09-24 06:52 AM
Since no answer was given I investigated further on my own:
It seems that if new image size > current image size: WirelessStackAddress - (2xImageSize – WirelessStackSize) is not a requirement.
What I observed though is, that all memory between the download address of the image up until the address denoted by SFSA will get erased in the process. Probably because of this, ST is recommending to install the new image as close as possible to the final address.
An official statement would be much appreciated though.
2020-09-24 07:05 AM
Hard to answer as this rule was given for the very first version of FUS V0.5.3.
It appears there is no relevant reason to apply this rule for the most recent versions.
In the end, the best way is to delete the previous FW and load the new one as close as possible from the base address of the FUS area (mostly 0x080F4000)
When the upgrade is performed via OTA, it is possible to load the new RF FW anywhere in memory at an address higher than 0x0807000. The BLE_OTA application will then scan the Flash memory to detect the start address of the new FW, decrypt it and finally install it in place of the current RF FW, which means at the closest area from the base address of the FUS area.
2020-09-25 06:59 AM
Just got confirmation that this constrint is valid for all FUS version when the old RF stack is not erased.
if new image size > current image size: WirelessStackAddress - (2xImageSize – WirelessStackSize)
The reason is that during copy and move, FUS shall have enough space to copy the new stack entirely.
Let’s take an example:
But after installation is finished, FUS relocate the new stack at the optimum position @0x080CB000, which is 0xF4 - 0x29 =0xCB.
So no space is wasted!!!
2020-09-28 03:34 AM
Thanks for comming back at this. But this is not what I observe in reality. I can install a larger stack while violating the 2xImageSize constraint.
My scenario:
STM32WB55CE (512k = 0x80000 Flash)
1 Image SBSFU installed (user area starts at 0x08016000)
Upgrading from 1.8.0 Light (4k rounded size: 0x1E000, installed at 0x08062000) to Full stack (4k rounded size: 0x29000, should be installed at 0x08057000).
while adhering to the constraint, this should not be possible.
I followed these steps
With the constraint, the maximum install address in step 4 must be (0x08080000 - 0x1E000 - 2*0x29000 = 0x08010000) which I clearly break by downloading it at 0x08016000
Could you please explain?