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.

TMS570LS3137: There was a delay in timing when using RTI

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Hi Team,

The program calls the RTI for timing, the timer is set to 100ms, then the flag bit is set in the interrupt function, and the flag bit is detected in the background while loop. If the condition is true, send one CAN data out. The time has increased significantly after 5 to 6 can frames.

RTI configuration is as follows:

The interrupt functions are as follows: 

INT8U	GL_SEND_FLAG = CODFALSE;
void rtiNotification(uint32 notification)
{
/*  enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (9) */
	GL_SEND_FLAG = CODTURE;
/* USER CODE END */
}

The background functions are as follows: 

int main(void)
{
/* USER CODE BEGIN (3) */
    canInit();
    
	rtiInit();
	
	rtiEnableNotification(rtiNOTIFICATION_COMPARE0);
	
	rtiStartCounter(rtiCOUNTER_BLOCK0);

	vimInit();

	while(1)        /* continious desplay        */
   {
		if(CODTURE == GL_SEND_FLAG){
			GL_SEND_FLAG = CODFALSE;
			for(int i = 0; i < 8;++i)
				rx_data[i] = i*0x05;
			canTransmitWithDLC(canREG1, canMESSAGE_BOX1, rx_data,8);
		}
   };
/* USER CODE END */
}

The data received through the CAN receive tool is as follow, the time stamp in the red box has a significant increase, around 20ms:

Could you help check this case? Thanks.

Best Regards,

Cherry

  • Hi Cherry,

    I am suspecting it should not be the issue of RTI peripheral. Instead of it should be delay occurs in CAN module.

    So, to confirm the same, can you please ask customer to do one small testing.

    That is instead of setting a flag in RTI interrupt handler, can you please ask customer to toggle one GIO and ask them to monitor that GIO in either logic analyzer or CRO.

    If in monitor the difference between two toggles always close to the 100mS then it should not be the issue of RTI otherwise it should be issue of RTI.

    --

    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    Thank you for the support.

    Modify the program to change GPIOs in RTI interrupts, set RTI to 1ms, and change the GPIO state every 100ms. It can be seen that the time interval for this phenomenon is not fixed.

    The code is as follows:

    INT8U	GL_DOG_VAL = 0x00;
    INT32U	GL_RTI_CNT = 0;
    void rtiNotification(uint32 notification)
    {
    /*  enter user code between the USER CODE BEGIN and USER CODE END. */
    /* USER CODE BEGIN (9) */
    
    	GL_RTI_CNT++;
    	if(GL_RTI_CNT>999){
    		GL_RTI_CNT = 0;
    	}
    	if(0x00 == (GL_RTI_CNT%100))
    	{
    		GL_DOG_VAL = (~(GL_DOG_VAL))&0x01;
    		gioSetBit(DOG_WDI_GPIO_PORT,DOG_WDI, GL_DOG_VAL);
    	}
    /* USER CODE END */
    }

    The captures of oscilloscope are as follows, the interval is not very accurate, there is 110ms and some are 100ms:

    Thanks and regards,

    Cherry

  • Hi Cherry,

    I just tested customer code on my LS3137 HDK board:

    And i didn't see the issue customer talking about:

    I can see toggling for every 100ms only.

    I am attaching my project and tested waveform for your reference.

    RTI_TEST_LS3137.zip

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/RTI_5F00_100mS_5F00_TEST.sal

    --

    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    Since they don's have LS3137 HDK board so it's hard to tell if there's anything different.

    CCS8.3 is being used. And they are using a custom board that generates Keil version of code from HALCoGen, the HALCoGen configuration file is as follows:

    https://e2echina.ti.com/cfs-file/__key/communityserver-discussions-components-files/96/halgen.zip

    The main function is as follows: 

    int main(void)
    {
    /* USER CODE BEGIN (3) */
    	
    	gioInit();
    	
    	rtiInit();
    	
    	rtiEnableNotification(rtiNOTIFICATION_COMPARE0);
    	
    	rtiStartCounter(rtiCOUNTER_BLOCK0);
    
    	vimInit();
    	
    	while(1)        /* continious desplay        */
       {
       };
    	
    /* USER CODE END */
    
    }

    Thanks and regards,

    Cherry

  • Hi Cherry,

    Can you please ask customer to provide his project/any sample project with the issue?

    Because i have to test and recreate the issue at my end for further analysis on this issue.

    --

    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    The development environment is Keil5.25, which integrates the Legacy package and uses HALCoGen to generate call code. And please see the test demo: https://e2echina.ti.com/cfs-file/__key/communityserver-discussions-components-files/96/TestRTI.zip

    In this test code, the measured waveform has a deviation.

    Pls let me know if any information required.

    Thanks and regards,

    Cherry

  • Hi Cherry,

    I just verified the customer code with my code, the only discrepancy i saw with the customer code is "CPUCx" values for counter-0 and counter-1

    In customer code it is 4

    And in my code it is 8

    I know this value is just depends on the RTICLK we are using, and counter frequency required, like as below in my case:

    I don't see any other discrepancy, so can you ask customer to modify this setting as per my settings?

    --

    Thanks & regards,
    Jagadish.