This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LC4357: DWD - Reset through Interrupt

Part Number: TMS570LC4357


Hey,

I am currently working on the RTI Digital Watchdog of the TMS570 and I am struggling to find the right information on my problem.

I want to be able to read out the last return address, before the DWD reset had been triggered so that I can see, where the code went "wild". To do so, I am currently setting the DWD up, so that it triggers an Interrupt instead of a direct reset. From the esmGroup2Notification Interrupt routine I than write the r14 Register Value to the eeprom so that I can access it, after the system is reset and memory gets reinitialized. After storing the address to eeprom I trigger a reset by writing to the SYSECR register. Furthermore I edited the HL_system.getResetSource function to also check the Watchdog Status Register so that it can determine, that the reset has actually been caused by a watchdog violation. After the reset is done and the system is reinitialized I simply read the address from the eeprom.

So far this seems to be working fine and it feels like a good workaround but my three questions would be:

Q1: Is there any other way that would be recommended, to get the latest return address before a dwd reset has been triggered?

Q2: To my understanding the NMI caused by the dwd violation is an FIQ which already has high priority. Does that mean it will interrupt all IRQs that might be running while the violation occurred?

Q3: What about possible FIQs that might have been running at the time of the violation?

Q2 and Q3 are more or less connected since I want to make sure, that the dwd violation is of highest priority and will most definitely be handled to than cause the reset inside of the esmGroup2Notification Handler. My concern is, that another Interrupt could run "wild" and cause the system to hang itself up, which should be noticed and handled by the dwd. So far I could not fully get the answers to this from the manuals.

Cheers, Alex   

  • Hi Alex,

    Q1. 

    After storing the address to eeprom I trigger a reset by writing to the SYSECR register.

    what is the purpose you trigger SW reset after servicing the NMI interrupt?

    Q2. The interrupt from the Windowed Watchdog is mapped to ESM group 2 channel 24. The ESM group2 flag will then generate a non-maskable interrupt (FIQ) to the CPU via the VIM interrupt channel 0 (mapped to ESM high-priority interrupt). FIQ has higher priority then IRQ, so It will arbitrate out all the pending and running IRQ interrupts 

    Q3. When a FIQ is serviced the FIQ and IRQ are disabled. So the new coming FIQ will get in pending until the current FIQ has been serviced. 

  • Well I want the watchdog to cause a system reset but at the same time I want to know the last address of execution (basically where the system hung itself up) after the system is reset. I couldn't figure out how to to this with only resetting via the watchdog so I am using the interrupt to store the value in eeprom to than read it once the system is reset and running again.

  • Hi Alex,

    Ok, thanks.