2022-07-08 07:18 AM
Good day,
As an extension of this discussion, I'm having trouble updating the BLE stack using the BLE_Ota code.
From the linked discussion, I should be downloading my new stack to 0x0809D000 (I'm also going from an older, smaller stack at 0x080CB000 to 1.13.X).
However, I'm having the following issue:
To my understanding the FUS should find the firmware automatically by looking for some magic word. If this were true, then there is no reason why it should not find the image at 0x08060000 or 0x08080000.
Any thoughts as to what is going wrong i.e. why is the image not found?
More information:
Thanks in advance.
2022-07-11 02:52 AM
I've done more testing, but to no avail.
Here's what I've tested:
2022-07-12 01:31 AM
Okay, so it turns out it could not find the image because, well, it wasn't there after all.... I moved around the Delete_Sectors() functions and in so doing it erased the flash memory when it rebooted onto the FUS. Moving Delete_Sectors back to where it was means I no longer get FUS_STATE_ERROR_IMG_NOT_FOUND.
However, I now get FUS_STATE_ERROR_IMG_NOT_AUTHENTIC. I've tried changing the read out protection bytes from AA to BB and back to AA, but the issue remains. I am able to update the stack through STM32CubeProgrammer, so I suppose that means my options bytes are correct.
Any thoughts on what I can try next?
2022-07-13 02:57 AM
Hello,
First, I see in your screenshot that you have a board with the FUS version v1.1.1.0, I recommend you to update the FUS with v.1.2.0, you can look this wiki page which describe how to update the FUS.
Once it's done, in order to update the BLE Stack using OTA, you should used an address between the end of application address and the secure part (see SFSA option byte) minus the image size. On ST BLE Sensor application, an offset is used (start from 0x08000000), so if you want to download your stack is 0x0800A000 for example, you should enter 0xA000 on the application. Image start address must be aligned to sector start address (this is a multiple of 4-kbytes). This address is the download address, not the install address.
For more information about OTA firmware update on STM32WB, you can look the application note AN5247 (see part 3.1.5 Wireless firmware update).
Best Regards
2022-07-14 02:02 AM
Hi @Remy ISSALYS , thank you for your response and for the clarity on where the BLE Stack may be located.
I'm still not having any luck, unfortunately.
This is what I've tried:
This is what I get:
FUS_STATE_ERROR_IMG_CORRUPT = 0x02,
FUS_STATE_ERROR_IMG_NOT_AUTHENTIC = 0x03,
and the return value of
0x10 = FUS_STATE_VALUE_FW_UPGRD_ONGOING.
This is what I used:
Either I'm missing something, or there appears to be a bug in the BLE_Ota project that prevents the firmware stack update from working. This is problematic since it means that units in the field cannot receive FUS or Stack updates. I'm concerned that at some point the latest STM32WB firmware will no longer be compatible with the old BLE stack on field devices, and so they will not benefit from added features and security fixes introduced in the latest versions of STM32WB firmware.
Can anyone at ST (or anyone out there on the internet) reproduce the issue?
Any suggestions?
Is it possible to file a bug report somewhere for the STM32WB firmware?
printToSvw function:
void printToSwv (char *text, uint16_t len)
{
uint16_t count = 0;
while ((count < len) && (text[count] != '\0'))
{
ITM_SendChar(text[count]);
count++;
}
}
2022-07-21 06:11 AM
Hello,
Be careful to the size of BLE_Ota project if your perform some modification inside it. This size should not exceed 28 KB (7 sectors of 4 KB).
Can you retry the following steps on P-NUCLEO-WB55.Nucleo ?
Best Regards