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: TMS570LS3137 code loaded using Flash F021 API stuck at CheckFlashECC()

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Hello,

We are using below tool in our development:

CCS version       : 8.0

Flash API           : 02.01.01

HALCOGEN       : 04.06

We have two images,

1. one which is generated using HALCOGEN tool and

2. another images which executes from RAM with Flash F021 libraries and API's calling to flash images.

Both the images work independently. when we flash HALCOGEN generated image (i.e. image mentioned in 1) using the image executing in RAM (i.e. image mentioned in 2), code is stuck at CheckFlashECC() which is generated by HALCOGEN. can you please help us in identifying the issue?

Thanks,

Kalyan

  • Hello Kalyan,

    This is a diagnostic to test the ECC logic. If an ECC is detected then the flag ERR_ZERO_FLG in the FEDACSTATUS register is expected to be set. If it is not set, then there is something wrong with the ECC logic.

    CheckFlashECC() does check the single bit ECC error and 2-bit ECC error. When CPU detects an uncorrectable 1-bit ECC error or an uncorrectable 2-bit ECC error, it will signal the error event to the flash module. The flash module FEDACSTATUS register should be updated for bit 1 or bit 8. Do you see those bit getting set?

    If you run the CheckFlashEcc() twice and the ECC error is forced at the same location (bit 0 of ECC in the example code), the CPU will not able to detect the ECC error, and run into the infinite loop:

    if ((flashWREG->FEDACSTATUS & 0x2U) == 0U)
    {
    selftestFailNotification(CHECKFLASHECC_FAIL1);
    }
  • Hi Wang,

    Thanks for your response. I think i haven't conveyed the issue correctly.

    We are flashing an image (Image generated by HALCOGEN) using F021 library functions. Below are the PASS and FAIL scenarios:

    PASS Scenario:

    After successful flashing of image if i power cycle there is no issue in execution of the code.

    FAIL Scenario:

    After successful flashing of image  if i reset just the controller code execution is stuck at CheckFlashECC() function.

    NOTE: we are using "Fapi_issueProgrammingCommand" with "Fapi_AutoEccGeneration" as argument of FAPI function.

    Can you please let  us know why this scenario might happen?

    Thanks,

    Kalyan

  • Hello Kalyan,

    If you run CheckFlashECC() twice, the 2nd call will not capture the ECC error.

    In PASS Scenario: doesn't the 2nd image call CheckFlashECC() before jumping to the 1st image?
  • Hi Wang,

    Question: In PASS Scenario: doesn't the 2nd image call CheckFlashECC() before jumping to the 1st image?
    Answer: 2nd image just has flash loading functionality and doesn't have CheckFlashECC() function call.

    Thanks,
    Kalyan
  • Hello Kalyan,

    The sys_startup.c in 2nd image might call CheckFlashECC(), and 1st image may call CheckFlashECC() this function again in its sys_startup.c. 

    In the PASS Scenario, what is the value in the ESM status registers before jumping to the 1st image? 

  • Hi Wang,

    Question: In the PASS Scenario, what is the value in the ESM status registers before jumping to the 1st image?
    Answer: PASS Scenario is after loading new image each time we have to power cycle to execute successfully.

    Thanks,
    Kalyan
  • Hello Kalyan,

    Thanks for providing more info. Is the code stuck at the below if(..) statement?

       if ((flashWREG->FEDACSTATUS & 0x2U) == 0U)

       {

           selftestFailNotification(CHECKFLASHECC_FAIL1);

       }

    What is the ESM value before calling CheckFlashECC(), and the ESM value when the code is stuck?