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: Reading out ECC memory

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Tool/software:

Hello,

I am using the TI cgt tools linker to generate flash ECC data for this part. This part is working fine. I am then trying to read out the data from the ECC addresses within the program itself (in the 0xf0430000 range) - but the data being returned does not match the file which was flashed onto the chip.

Data from the hex file uploaded into the chip:

Data shown in CCS memory browser while program is executing - the same data as returned by program reads. Note that the least significant two bytes are copies of the most significant two bytes in each four byte word here.

If I pause the program in the debugger, data in the memory browser changes - now it matches the data loaded onto the chip during flashing! But this does not help with accessing the data during runtime.

I am using mostly default halcogen settings - the MPU configuration is default including this:

Also, Flash ECC (enforcement) is disabled. RAM ECC is enabled, although I have tried calling _coreDisableRamEcc_() after startup to see if this made any difference after reading another e2e thread - it did not. Any suggestions would be appreciated.

All the best,

Alan

  • Hi Alan,

    I am not sure how you calculate the ECC for the executable file (*.out file). Normally I use either CCS or linker cmd to generate ECC.

    1. Linker ECC:

    7.1. Linker Generated ECC — Hercules Safety MCUs Documentation

    example of linker cmd file to generate ECC:

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/1007.sys_5F00_link.cmd

    You need to change the linker option for generating ECC with the linker cmd file:

    The debug setting for loading the out file:

  • You can use _coreEnableRamEcc_() and  _coreDisableRamEcc_() to enable and disable the RAM ECC.

  • Hi QJ,

    Thanks for following up. I have the linker generating the ECC output using the option you mentioned. This output is what is pictured in the first screenshot.

    The problem is that the data in the ECC memory region output by the linker does not match the data at the same address shown in the debugger Memory Browser window - but only in some cases - see above. When the program is halted, the data does match. Reads by the actual program itself do not match. I am trying to figure out why this would be the case. I have other reasons to believe the data is being programmed correctly (such as, if flash ECC is actually enabled, the chip does not generate ECC errors)

    All the best,

    Alan

  • HI Alan,

    If flash ECC is enabled and there is no ECC error when CPU reads the content or fetches the instructions from flash, I am sure that the flash is programmed correctly with correct flash content and ECC value. 

    Data shown in CCS memory browser while program is executing - the same data as returned by program reads. Note that the least significant two bytes are copies of the most significant two bytes in each four byte word here.

    The memory content in CCS memory browser window is not updated dynamically during code execution. Please check the value in CCS memory browser window after the code execution is done or paused. 

  • Hello,

    I was able to fix this by following the requirements in the user manual:

    Apparently reading ECC memory locations as words (as memcpy does) results in wrong values being read.

    An example read routine for reading as bytes:

    uint8_t read_ptr_b(uint8_t *pu8Data);

    All the best,

    Alan