Bootloader <-> Application Recovery when crash

Hi there,

I’ve made an bootloader for the LPC1788 based on KEIL TCPnet stack and FlashFS (fat library)

with this bootloader I can update my application code and program settings like IP Address etc.

I can also jump from the application back to my bootloader to use the “update” mode.

One of my priorities is stability. for example, when my programmed application crashes, I want it to count the crashes (maybe different types of crashes) and decide to reflash the application code with an previous working version from a SDCard.

So what I want is a: Self recovering bootloader

Does something like this exist? I can’t find anything like this.
Does somebody have an idea on how to make this work?

I’ve thought about saving some counting in the flash (it will work, but you don’t want this, programming the flash to much)

Maybe some communication to a FPGA watchdog, but then it’s outside the ARM.

Thanks,

Wouter

I (and many others) do what you speak of, in our profession. Some concepts are:

Use watchdog timer in application - if it crashes, watchdog invokes the bootloader. Bootloader attempts to communicate to get new firmware. If not available, it restarts the existing app.

Bootloader runs at power-up. Checks for new firmware, as above.

Bootloader and/or App look at the cause of the reset. Most micros have a reset cause register with bits like power-on, watchdog timeout, illegal memory access, etc.

So it’s a system design problem - assuming your microprocessor has the means for the above.

Most recently, I’ve done the above and more for a project using an ARM7.