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.

Firmware branches to flashErrorReal after integrating SafeTI

Other Parts Discussed in Thread: HALCOGEN, TMS570LS1115

Hello,

I have a perfectly working system with me. My task is to integrate SafeTI library to it. The system runs on a TMS570LS1115 microcontroller. But as soon as I integrate the SafeTI library based start up code (which is derived from the example code available with Halcogen 4.5.2) the application branches to flashErrorReal n dabort.asm.

I have debugged the issue and it seems like the failing API is TI_Fee_Init(). I would like to know possible causes for this type of failure. It looks like some change occurred during the SafeTI diagnostics caused this issue. I have attached the startup code I used herewith.

Please let me know your thoughts on this.

Thank you.

8738.sys_startup.c

  • Hi Pradeepa,
    The TI_Fee_Init() is called after the main() is called, right?

    Can you check the Data Fault Status register and the Data Fault Address register in the CPU? What do they read?

    What I suspect happens is that if the ECC checking remains active and you are trying to access flash bank for which there is no corresponding ECC then you can get a real ECC error.
  • Charles Tsai said:

    The TI_Fee_Init() is called after the main() is called, right?

    Yes

    Charles Tsai said:

    Can you check the Data Fault Status register and the Data Fault Address register in the CPU? What do they read?


    Is it the FEDACSTATUS and FUNC_ERR_ADD values you meant?

    Charles Tsai said:

    What I suspect happens is that if the ECC checking remains active and you are trying to access flash bank for which there is no corresponding ECC then you can get a real ECC error.

    Can I disable some test in SafeTI and check this? As I mentioned this happens only if I initialize the MCU using the SafeTI based initialization code. This works if I directly use the HALCoGen generated startup file.

  • The Data Fault Status register and Data Fault address Register are inside the CPU. See below.

    You can disable some safeTI tests to narrow down which one causes the later TI_Fee_init() to fail with ECC errors. 

  • Hello,

    CP15_DATA_FAULT_STATUS 0x00000409

    CP15_DATA_FAULT_ADDRESS 0x00000100

    I'm removing tests to see what causes this issue.

    Thank you

  • You have an ECC error at address 0x100. 0x100 is a flash location in bank0. Can you show the disassembly what is stored at this address? Also where in your C code that creates the read access from 0x100? The question to ask is why are you reading from this location? If this read is part of the TI_FEE_init() then we need to understand why the TI_FEE_Init() is reading here. Also if you are intending to use FEE API to program bank7 then do you plan to also program the ECC along with the data. If you don't plan to program bank7 with ECC then you should disable ECC checking in the CPU. Or you need to program bank7 with both the data and the corresponding ECC if you intend to keep the ECC enabled. 

  • Hello,

    I found out that that the program execution fails if I add following function call.

    SL_Init_ECCFlash(10, FLASHECC_DEFAULT); /* Enable Flash ECC */

    I cannot fully understand why though.

    I am also looking into this, in the meantime if you got any idea please let me know.
  • Hi,
    You enable ECC checking in the CPU for the Flash memory. This is fine if you also program ECC along with your program into the flash. But if you don't have ECC but only the program image loaded into the flash the you will get ECC error as soon as you call SL_Init_ECCFlash(). The moment you call SL_Init_ECCFlash, the ECC checking is enabled in the CPU. Every instruction fetch and data read from flash will go through ECC checking. It will fail if you don't have the ECC. Again this is what I said. If you don't plan to run your project with ECC then you don't want enable it. If you do, make sure you use the auto-ECC feature in CCS when you load your program.