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.

The doubts of STC self-test

Other Parts Discussed in Thread: HALCOGEN

Hi there

My corporation is ready to use the functional safety microprocessor to develop new product, the model of the microprocessor is TMS570LS3137PGE.

Question 1: I’m trying to test the “CPU Self-Test Controller(STC) Module”, but I have many doubts. Now, I want to use the Selt-Test module, I know that I need to save the CPU state. Also, in this manual, I found the “8.8.2 Context Saving” give the register I need to save. the picture follow below.

I also observe that in the sys_selftest.c , it have a function “void selftest(void)”. In my opinion , between the ”USER CODE BEGIN(9)” and “USER CODE END” save the CPU registers, between  the ”USER CODE BEGIN(10)” and “USER CODE END” ,putting saved value to the CPU registers. I wonder is it right?

The question is how do I write code between the ”USER CODE BEGIN(9)” and “USER CODE END” and between the ”USER CODE BEGIN(10)” and “USER CODE END” to save the  corresponding registers. Can you give me an example?

Question 2: Additional, I find the CCM and STC in the HALCoGen(path:TMS570LS3137PGE—SAFETY INIT—Self test Enable) can’t be run in debug mode, So I switch the mode to “Realse” mode, It still can’t run. How do I run the code with “Enbale CPU Self test” and “Enable CCM Self test”?

I have a request that can you give me your e-mail, so that we can have a convenient communication. Additional, my english is poor, I hope you can understand what I mean.

Thanks in advance. Zhu Zhenglong

  • I wonder if you understand what I mean. I use the self-test of STC. In my opinion, I should save the registers of CPU, after the self-test, I should put the saved value to the registers of CPU. Yon give the registers needed to save, but I still have mang doubts. Can you give me the code about how to save the corresponding register.

    thank you

  • Hi,

    STC module is used to test the CPU and in the end since the CPU is no more in the same state it was, CPU is generally reset at the end. Because of these two actions CPU loses all the info on where and what it was doing.

    There are two options if the user is okay to run the program again with a flag to mention it experienced a reset due to STC completion and continue the normal boot process again which doesn't need any context saving.

    Instead if you intend to run from where you really left then certainly all the context saving needs to be done so that you can resume from where you left (This might be the CPU registers, then the banked registers etc.). I'm not sure if we have a sample code as different customers do this differently.

  • Hi,

    I also did find some useful sample code for you which can be used as a reference.

    Please install Hercules safety mcu demos from the below link

    http://www.ti.com/tool/hercules_safety_mcu_demos

    Once installed, please look at the below two files which will help you with some sample code

    <>\ti\Hercules\Hercules Safety MCU Demos\4.0.0\TMS570LS3x_target_sources\demo-app\source\stc.c

    <>\ti\Hercules\Hercules Safety MCU Demos\4.0.0\TMS570LS3x_target_sources\demo-app\source\core.asm

  • Hello

    I use the microchip of TMS570LS3137PGE,and the development environment is “IAR Embedded Workbench IDE”

    1.       According to what you said, I try to save the CPU registers. This is the assembly language I write following the example you give, is it right?

    But I believe that I don’t save all registers needed saved. What I need to save as following(page 341 in technical reference manual)

    My brain is full of doubts. can you solve my problrm

    (1)the “R15” and “PC” are the same things?

    (2)Do I need to save the register--”SPSR”?

    (3)What are the “CP15 System Control Coprocessor Registers” and the “CP13 Coprocessor Registers” ? how do I save them? I really don’t know.

    (4)I don’t know the meaning of the “BVR  BSR  WVR  WSR” and how do I to save these registers?

     

    Can you write the code for me. As you know, there are few people use the TMS570, I really feel helpless

     

    2. In HALCoGen, it said “CCM and STC cann’t be run in debug mode”, I try to run in “release” mode , also it cann’t work. How can I let the STC work?

    Thanks in advance.

  • Hello,

    any update on this question?

    I am facing the similar issue.

    Following are some of the registers that are required to be backed up before and restored after self-test:
    1. CPU core registers (all modes R0-R15, PC, CPSR)
    2. CP15 System Control Coprocessor registers - MPU control and configuration registers, Auxiliary
    Control Register used to Enable ECC, Fault Status Register etc.
    3. CP13 Coprocessor Registers - FPU configuration registers, General Purpose Registers
    4. Hardware Break Point and watch point registers like BVR, BSR, WVR, WSR etc.

    is there any example code available for the saving the above registers?

  • Hello Vijayendra,

    Please see these two posts regarding context save and restore and even the general argument for skipping of executing STC periodically vs. only running at start up. The primary concern for only executing at start up is the potential for latent faults in the CPUs but even with this potential, the CCM and lockstep architecture will continue to protect the safe operation of the system even in the event of a single point fault.

    The other threads that will be helpful are at these links:
    e2e.ti.com/.../391775
    e2e.ti.com/.../1374842