This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C51 : 8051 Crash Handler

Hi guys,

I have a product based on an AT89C51 form Atmel and a lot of code on board (GSM Modem connection, I/O, CAN Interfaces etc). 99.99% of the time it is all fine and works reliably BUT very occasionally we get a crash.

We recover from it and restart successfully and in most cases no one even knows it happens.

I was wondering if anyone knows of any way of getting any crash data out of the 51? I have FRAM and EEPROM that could be usef for storage but the reset (of course) resets all the registers and any trace of the fault is lost.

Is there anyway of suspending the core here in the test lab so that we can catch the crash?

Cheers for any help,

Dirk

Parents
  • One thing to consider, is to let all ISR write the stack pointer to a specific location in the FRAM and check the highwater mark after a crash and the highwater mark before a crash.

    if the SP at the ISR entry is less than the startuo SP value go to PANIC if you have an ICE, or write to the FRAM .

    I always have
    PANIC:
    jnb button,$
    read the stack

    this, of course only works when ICEing, when the debug flag is not set, I check at start and display "Crash at x...."

    Erik

Reply
  • One thing to consider, is to let all ISR write the stack pointer to a specific location in the FRAM and check the highwater mark after a crash and the highwater mark before a crash.

    if the SP at the ISR entry is less than the startuo SP value go to PANIC if you have an ICE, or write to the FRAM .

    I always have
    PANIC:
    jnb button,$
    read the stack

    this, of course only works when ICEing, when the debug flag is not set, I check at start and display "Crash at x...."

    Erik

Children
No data