A Data Abort Exception (MCU TMS570LC43)

Hi all,
I am trying to use “portCONFIGURE_TIMER_FOR_RUN_TIME_STATS” to check the execution time of the task its active state time etc.
#define configUSE_TRACE_FACILITY 1
#define configGENERATE_RUN_TIME_STATS 1

But when I use below fuction
vPortRTOSRunTimeISR
data abort exception occurs, can you please guide me to fix the issue.

The related code is as below,

    extern void RTOS_AppConfigureTimerForRuntimeStats(void);
    #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() RTOS_AppConfigureTimerForRuntimeStats()
    extern uint32_t RTOS_AppGetRuntimeCounterValueFromISR(void);
    #define portGET_RUN_TIME_COUNTER_VALUE() RTOS_AppGetRuntimeCounterValueFromISR()

     void RTOS_AppConfigureTimerForRuntimeStats(void)
     {
             RTOS_RunTimeCounter = 0;
     }

     uint32_t RTOS_AppGetRuntimeCounterValueFromISR(void)
     {
         return    RTOS_RunTimeCounter;    /* increment runtime counter */
     }
    void vPortRTOSRunTimeISR(void)
//     void rtiNotification(rtiBASE_t *rtiREG, uint32 notification)
     {
                /* Clear interrupt flag.*/
                //rtiREG1->INTFLAG = 2U;
        //       *((volatile uint32_t *) 0xFFFFFC88) = 2U;
               RTOS_RunTimeCounter++;    /* increment runtime counter */
     }

Another timer setup to measure task execution time.

	 portRTI_CNT0_COMP1_REG = ( configCPU_CLOCK_HZ / 2 ) / (configTICK_RATE_HZ*10); 
	 portRTI_CNT0_UDCP1_REG = ( configCPU_CLOCK_HZ / 2 ) / (configTICK_RATE_HZ)*10; 

	/* Clear interrupts. */
	portRTI_INTFLAG_REG     =  0x0007000FU;
	portRTI_CLEARINTENA_REG	= 0x00070F0FU;

	/* Enable the compare 0 interrupt. */
	portRTI_SETINTENA_REG = 0x00000001U;
	portRTI_SETINTENA_REG |= 0x00000002U; 

Data exception register values

image

image

image

Thank you very much,
Regards,
Kishor

Can you try to determine which line is causing the data fetch abort? If you exclude runtime stats, does it work? We need to determine the offending code.

yes if I disable below ISR then it executes normally

void vPortRTOSRunTimeISR(void)

The ISR has only the following line:

Does removing it has any effect? If not, it seem related to your ISR setup and not FreeRTOS. Do you have any example from your hardware vendor which shows how to use this ISR?

Thanks.

The TMS570 port distributed by TI is a bit different to our port, so the requirements for interrupt service routines may be a bit different, but the doc pages for our port say there are no special requirements for writing an ISR. Also probably depends on the compiler.

Yes its true if I disable the interrupt, as shown in below images code executes normally,


image

As I understand this ISR is required to use get tasks RUN_TIME_STATS

Regards,
Kishor

I’d recommend asking on TI forum about how to setup this ISR.