Showing results for 
Search instead for 
Did you mean: 

Question of STM32WB OTA reboot problem


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.

Associate III

I don't have a solution, but I believe I'm having the same issue:

And I think the same issue was seen here, but with no particular resolution shared:

Really interested in understanding what's going on and how to fix it.

Associate III

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.

Associate III

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?!). 

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.


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)

Associate III

@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?

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.

Associate III

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?

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.