Question of STM32WB OTA reboot problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-15 12:06 AM - edited ‎2023-08-15 12:08 AM
Hello, I have a question about OTA in the stm32wb series.
I'm testing to add the OTA function to the board I'm developing.
After full erase of MCU, I succeeded in downloading application bin file to MCU with STBLE Toolbox application.
Afterwards, to update another bin file, I sent 01 07 FF to the application service and tried to download another bin file by entering OTA application mode.
However, when entering OTA application mode, it was confirmed through debugging that it enter low power mode and did not operate normally, and entered low power mode while the shci_send function was operating inside the APP_BLE_Init function.
I don't know why this is happening.
I have modified the linker file, checked the magic keyword, and modified SCR->VTOR, but do I need to more modify other sources?
If there's anything you need to check, I'll capture it and upload it right away.
- Labels:
-
BLE
-
STM32WB series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-16 10:39 AM
I don't have a solution, but I believe I'm having the same issue: https://community.st.com/t5/wireless-mcu/stm32wb-fota-practical-questions/td-p/572725
And I think the same issue was seen here, but with no particular resolution shared: https://community.st.com/t5/wireless-mcu/stm32wb-cpu1-stuck-waiting-cpu2-at-init/m-p/580103#M16082
Really interested in understanding what's going on and how to fix it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-24 1:24 AM
I can confirm this issue. Just to be clear, I am using a Nucleo-WB55 and tried OTA with the p2p example and the ST BLE Sensor App, which worked fine. However, when I send "01077F" with my own app, it boots to OTA but gets stuck somehow, doesn't delete the user code and also doesn't advertise.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-26 6:04 AM - edited ‎2023-09-26 6:07 AM
I'm also struggling, how did you even manage to get there "I send ""01077F" with my own app, it boots to OTA".
I have custom template, added ota reboot char, but whatever I send to the char it doesn't even reboot (do I have to process it in code?!).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-27 2:52 AM - edited ‎2023-10-02 5:34 AM
After sending "01077F" the board does something, but gets stuck somewhere. I know that because the LEDs toggle, and it doesn't advertise anymore. After power toggling, it starts advertising again (via the old firmware) which means user code isn't deleted.
edit:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-28 8:00 PM
Yep, you have to handle that write in custom_stm.c and custom_app.c, just like any other BLE data transaction. In custom_app.c, you should have a block that looks like this:
(The while(1) isn't necessary)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-02 5:32 AM - edited ‎2023-10-02 5:34 AM
@TBran.3I have that, and I think that is exactly where the problem lies. I noticed the flash isn't erased, because when I power toggle the board, the board loads the firmware I was trying to delete. And firmware should be deleted before rebooting, right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-04 7:30 PM
Nope, the OTA loader application should erase the user application flash before writing the new program.
If you think about it, you can't really erase the user application while you're still *in* it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-12 10:50 PM - edited ‎2023-10-12 10:51 PM
You're right, but the problem still is that the user code isn't even deleted. Am I the only one or do you also see this behavior? Do you have any updates on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-18 7:28 PM
Yeah I mean in my case (which IIRC is same as yours), the user app is never deleted because the OTA bootloader never makes it to the point of "erase and write". So on power cycle, the previous user FW indeed loads. It never makes it deep enough into the OTA application to do anything meaningful, it's just waiting for an event to be triggered by CPU2.
I haven't gotten anywhere with ST support yet, but the first zip file I sent them was missing files. Just pinged them again and hoping for an update soon.
