CYBLE-212019. What happens if there is a power outage during a firmware update?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DhDa_2432241
Level 5
Level 5
5 likes given First like received First like given

Hello,

   

I am using a bootloadable component in my project which points to bootloader.hex. The bootloader.hex is generated from a bootloader project which is a UART bootloader. In short, I can update the firmware in my CYBLE module using an external embedded host via UART.

   

I am using the UART host bootloading code from cypress to update my CYBLE. I was able to update my CYBLE successfully. So far so good. My image is of type .cyacd. 

   

I am interested in knowing how the bootload component works. What happens if I interrupt the firmware update? Will my previous application run because the new image update was interrupted? 

   

Say at 99% if I interrupted the firmware update and restarted the module, what will the CYBLE run? Can I issue an update to CYBLE again in this stage?

   

Can a CYBLE ever enter into a state which causes the bootloader not to kick in?

   

Thanks

   

Dheeraj

0 Likes
1 Solution
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello,

If the bootloader is dual App you will have at least one application in the system. If your bootloader architecture is single App, then incase of interruption while bootload, the App will get corruption. So the code waits in bootloader for a new App.

Thanks,

Hima

View solution in original post

0 Likes
6 Replies
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello,

If the bootloader is dual App you will have at least one application in the system. If your bootloader architecture is single App, then incase of interruption while bootload, the App will get corruption. So the code waits in bootloader for a new App.

Thanks,

Hima

0 Likes

Hello Hima,

Thanks for replying. My bootloader is single app. I understand that app corruption will happen incase of bootloader interruption.

You mentioned that the code waits in bootloader for a new App. How will the CYBLE make this decision incase of app corruption? Is there some logic in the bootloader which will set CYBLE into bootload state? Can it happen that the CYBLE can never trigger bootloader incase of app corruption?

I just want to make sure that a CYBLE chip can successfully enter bootload state incase of app corruption at any level.

Thanks

Dheeraj

0 Likes

Hello,

During startup of bootloader, the application will be check if valid. There is a logic inside in the bootloader component. However if there is a disconnection in time of bootloading, the PSoC will not automatically . But after reset then bootloader will wait for a new image. For this you will need to have some mechanism to detect disconnection/code stuck and issue a reset.

Thanks,

Hima

0 Likes

Hello,

I see.

But after reset then bootloader will wait for a new image.

Will this happen all the time without additional code in bootloader? I mean if there is a disconnect(like power failure) during bootloading, can CYBLE always enter bootloader mode upon keeping reset line low(reset)?

For this you will need to have some mechanism to detect disconnection/code stuck and issue a reset

What can cause this situation? How do I implement the failsafe mechanism?

0 Likes

Will this happen all the time without additional code in bootloader? I mean if there is a disconnect(like power failure) during bootloading, can CYBLE always enter bootloader mode upon keeping reset line low(reset)?

Yes out of hard reset the bootloader will be executed

What can cause this situation? How do I implement the failsafe mechanism?

This is caused when the communication is stuck some how. You can implement a timer kind of mechanism and check the activity on the communication channel. If timeout then perform reset.

Thanks,

Hima