Hi TI Experts,
I am recently developing SDL (Software Diagnostic Library) Ver. 1.0.0 on our system, during the development of ESM I have some questions shown in the below.
1. I deployed the ESM example (MCU&Wake-up domains) provided by the SDL on MCU1_0 Autosar OS, and found that the VTM events are not triggering the ESM interrupts immediately by observing via the debugger.
In other words, useCaseTrigger() is executed from index i=0 to i=2 without being interrupted, after that the ESM interrupts then are triggered and the callback functions are called.(However, the global variable currTestCase is 3 now which will affect the callback function performance, then the test cases failed).
From my perspective, it is supposed to be like: useCaseTrigger(0) -> ESM interrupt and callback function -> currTestCase++ ->useCaseTrigger(1) -> ESM interrupt and callback function -> currTestCase++ -> ....
If I run the test cases independently, they all work (currTestCase is correct). So, is it possible that the VTM trigger function vtmTriggerTh1() in useCaseTrigger() is not reporting the event immediately? It takes time to set the new temperature threshold hence the ESM interrupt is not up at once?
2. SDL ESM API SDL_ESM_interruptHandler() is provided to handle ESM events, and it keeps reading the interrupt sources until there are no events in the ESM registers (pulse and level):
/* Check on the highest priority event and handle it */
do {
(void)SDL_ESM_getGroupIntrStatus((uint32_t)esmInstBaseAddr,
(uint32_t)esmIntrPriorityLvlType,
&localEsmGroupIntrStatus);
intSrc1 = localEsmGroupIntrStatus.highestPendPlsIntNum;
SDL_ESM_processInterruptSource((uint32_t)esmInstBaseAddr, esmIntType, intSrc1);
intSrc2 = localEsmGroupIntrStatus.highestPendLvlIntNum;
SDL_ESM_processInterruptSource((uint32_t)esmInstBaseAddr, esmIntType, intSrc2);
} while ((intSrc1 != (uint32_t)(NO_EVENT_VALUE)) || (intSrc2 != (uint32_t)(NO_EVENT_VALUE)));
There are a lot of errors in the ESM event lists cannot be recovered, hence in these cases we can do nothing to process the interrupt source and exit the interrupt but reset the system. Anyhow, we still want to log these error events to the Non-volatile Memory.
Does SDL provide any APIs or solutions which enable the event logging in the NvM within the ESM interrupt handler so that we can still read them back after power off reset?
Thank you so much for your patience.