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: Periodic selftest of CPU

Part Number: TMS570LS3137

When the main function is running, you need to do a CPU cycle diagnosis. What should I design?
1. CPU needs to save the status and register of the CPU before the self-test, how to save, can the diagnostic library have an interface to call? Is there an instance code for reference?
2. I don't quite understand that when calling the CPU self-test, it will generate a reset. Is the program restart, sys_startup.c -> _ c_int00 (), sys_main-> main (), so restart, initialize, The data saved in the previous run is okay, how to recover?
Please answer the above questions, thank you.

  • Hello Xiaohong,

    1. CPU needs to save the status and register of the CPU before the self-test, how to save, can the diagnostic library have an interface to call? Is there an instance code for reference?

    TMS570 devices have lockstep cores. The 2nd core is constantly executing the same instructions as the primary core, and the output of each core are continuously compared through the core compare module (CCM). If there is a malfunction in one of the two cores, this will be caught by the compare. In addition, the code execution is delayed by 2 CPU cycles to provide a temporal diversity and the cores are flipped and rotated from each other to provide a physical diversity. This concept is very well thought out, has been reviewed by many certification entities, and has been widely accepted.

    The CPU Selftest is a destructive test such that the CPU contents may need to be preserved. Performing the CPU self-test periodically will add complexity to your application. Please check with your auditor if the periodic CPU selftest is required. The LBIST (CPU self-test, and STC self-check) is used to check if there is any permanent fault in the logic circuitry. My understanding is that running the LBIST on start-up is enough for most of applications. 

    The SDL doesn't include a function for performing the CPU context save/backup. 

    2. I don't quite understand that when calling the CPU self-test, it will generate a reset. Is the program restart, sys_startup.c -> _ c_int00 (), sys_main-> main (), so restart, initialize, The data saved in the previous run is okay, how to recover?

    The CPU reset will be generated after completion of each test regardless of pas or fail. After reset, the code starts from _c_int00(), and performs most of the initialization procedures in _c_int00().

    If periodic CPU selftest is needed, You need to copy the CPU registers into RAM locations before the STC executes LBIST and then after the completion of the test, reading back from the RAM location to the CPU register. The data in RAM will be protected by ECC for most of the time, but ECC will default to disabled after the CPU reset. This means you should provide some additional safety mechanism such as a CRC on the register data that can be validated prior to using the stored data.

    The preserved CPU content should be copied back in your main().

  • 1. Whether other customers use the CPU and STC cycle self-test function, our products need to meet SIL3, if there is no CPU cycle self-test, there is still other diagnostic ways to ensure the normal work of the CPU, meet our SIL3 level Certification.
    2. The implementation of the CPU cycle self-test function, before the CPU is reset, what is the status of the CPU, which registers, data, and status referring to what state, to be saved to the RAM, then the address of the RAM Is it required? Can any RAM address?
    3. My understanding is that after the CPU is reset, including RAM will also be initialized, is the status of the CPU saved in the RAM is not initialized?

  • Hi Xiaohong,

    1. If the systems will run for long periods of time without a startup/shutdown sequence and the associated BIST tests, and if you have code which is rarely using a memory space or a set of CPU functions (i.e. FPU), there is some possibility to accumulate faults which would not be detected until you used the resource since the lockstep and ECC tests only check the resources which are currently being used. So the periodic BIST execution per time interval may be needed.

    2. As stated in the device TRM (STC chapter), the following registers should be backed up before the LBIST and restored after the BIST:

    • CPU core registers (all modes R0-R15, PC, CPSR)
    • CP15 System Control Coprocessor registers - MPU control and configuration registers, Auxiliary Control Register used to Enable ECC, Fault Status Register etc.
    • CP13 Coprocessor Registers - FPU configuration registers, General Purpose Registers
    • Hardware Break Point and watch point registers like BVR, BSR, WVR, WSR etc.

       After CPU reset, the memory init function should not be called, so the contents of RAM are preserved.

    3. No, If you don't call memInit(), the data in RAM should be fine.