what to do when bootloader stuck

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

what to do when bootloader stuck

1,483 Views
carleslloret
Contributor II

Hello, first of all I talk from the absolute ignorance in bootloaders so I beg your pardon in advance. I use the MC9S12 mcu family in my embedded system, and every month there is an updating for the firmware. There are many MC9S12 mcu around the world with firmware that needs to be updated periodically. Their firmware is uploaded by can bus. Unfortunately many customers disconnect the can bus while the uploading is taking place or the power supply is disconnected. Then the mcu and firmware are stuck until the "box" is open and the mcu programmed by the debugger/programmer. Is there a way to reset the bootloader or reprogram the microntroller? 

I heard that some cars have updating time that can reach hours, and this rises the same question. Is there a way to reset the bootloader process?

Thanks a lot.

2 Replies

1,364 Views
kef2
Senior Contributor V

Simple, just don't give it a chance to fail to start due to 1) sudden power loss, 2) cable disconnection, uploader PC sudden reboot during bootload etc.

1 - it's quite obvious that bootloader should be not touched and kept unmodified during update. If you really need to make bootloader modified, do it something like modern Android phones do: at least one working bootloader/configuration at time in memory. Update only one of two working copies, so that if one fails, switch to another one. Two copies still would require you to have one very small subbootloader kept unmodified during updates, which should check which one of two big bootloaders are OK and if two are OK start one with higher version number.

2 - bootloader should not jump to application unless update is really complete. Instead, if update is incomplete, it should wait until you send complete image again. It could be as simple as non-FFFF application start vector, provided app start location is always send as a last program location. Of course you may have better protections against start of incomplete application image. If you can provide hidden microswitch or some smart keypress combination or something to force bootloader not to jump to application. This would also help in case some unlikely and hard to repeat condition makes your application stuck. Bootloader switch would let switch back to working version and wait for fix..

1,364 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello Carles,

This is an application problem, so, I can just suggest a possible solution.

However, I need to know which  MCU do you have. Is it MagniV or S12(X) device?

Thank you.

Best Regards,

Diana

0 Kudos
Reply