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.

TMS570LS2124: SafeTI Diag Lib - example

Part Number: TMS570LS2124
Other Parts Discussed in Thread: TMS570LS1227, TMS570LS1224, HALCOGEN, LAUNCHXL2-TMS57012

Hello,

I am working on safety features implementation on TMS570LS1224. I download SafeTI Diagnostic Library and went through example: SL_TMS570LS1227_NoOS.

I use TMS570LS1224 LaunchPad board.

Firstly, I would like to focus on boot time features (sys_startup.c) Therefore, inside main() function I replaced all the code with simple LED blinking function (There was need to make only one additional change in HalCoGen (GIOB1->marked as output). I had ran application and everything worked perfectly. LED was blinking as expected but only during debug session. Unfortunately, outside of the debug session application do not work (LED is not blinking).

What could be the reason? Could you help in this case?

  • Hello Michat,

    How often is the GIO pin toggled? If the toggle speed is too fast, we are not able to see the LED blinking. 

    You can use HALCoGen rtiBlinky example to toggle the GIOB[1] pin in your code. 

    void rtiNotification(uint32 notification)
    {
         /* Toggle GIOB pin 1 */
         gioSetPort(gioPORTB, gioGetPort(gioPORTB) ^ 0x00000002);
    }

  • Hello QJ Wang,
    I suppose that's not the problem.
    My dummy main function:

    void main()
    {
        while(1)
        {
            gioSetBit( gioPORTB, 1, 1 );
            volatile uint32_t i;
            for ( i = 0; i < 9999999; i++ )
            {
            }
            gioSetBit( gioPORTB, 1, 0 );
            for ( i = 0; i < 9999999; i++ )
            {
            }
        }
    }

    It works in debug mode when I go line by line (using step mode)
    It also works in debug mode when app is running. LED is blinking (approx. 1s on/1s off).

    As I posted on the beginning, it does not work outside of the debug session ( I tried power off and power on my LAUNCHXL2-TMS57012.

    I am using example SL_TMS570LS1227_NoOS and try to use it on LAUNCHXL2-TMS57012 (TMS570LS1224).

    Edit1:
    One interesting behavior I now noticed:
    When I push RESET button or PORRST button on LAUNCHXL2-TMS57012 - application works.
    When I power off board by removing the USB plug and put USB plug back - application do not work.

    Edit2:
    I suppose, there is a problem with example somewhere in this section /* USER CODE BEGIN (75) */ (lines 1111 - 1234)
    When I commented it out app works like I expect (even when power off LaunchPad board by removing USB plug an insert it back.

    Edit3:
    Probably, there is an issue with _enable_interrupt_() or the part of the code related to that function in some way.
    When I remove _enable_interrupt_() - app works (even when I power off LaunchPad board by removing USB plug an insert it back).
    I found that similar issues with SafeTI example were reported (https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/920991 ) some time ago.

    Edit4:
    I also noticed strange behavior during debug session. Using 'Step over' is not always step forward but sometimes step backward. This strange behavior also visible in disassembly view. What is the reason of this behavior? 

  • I did a series of tests with the removal of diagnostic tests from the sys_startup.c file and found the problem.
    Line 816 was causing an error - SL_SelfTest_SRAM (SRAM_PAR_ADDR_CTRL_SELF_TEST, TRUE, & failInfoTCMRAM);
    There is no comment for this test in the sample project but inside documentation there is note: 'When performing SRAM_PAR_ADDR_CTRL_SELF_TEST user must ensure to have a special esm_handler routines without any Stack or other RAM access to avoid unexpected error reporting '


    When I removed this test my example application works.
    When this test exists, disabling _enable_interrupt_() was needed.

    Still do not have idea how to fix strange behavior during debug session which I show in previous post (Edit4).