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.

Flash ECC Enable for TMS570LS3137

Other Parts Discussed in Thread: TMS570LS20216, HALCOGEN, TMS5703137, NOWECC

Hello,

I have been writing drivers for TMS570 in the past year and not long ago I moved from TMS570LS20216 Development kit to TMS5703137 development kit. On the new development board my software began to crash until I fount that the reason was enabling the ECC on the flash. In our software we have three separate code projects that build and load into the flash individually, but run all together. The projects are Boot software, Operational software and Constants. The Boot and the Operational software are loaded into 0 - 0x0007FFF region, taking only up to 0x17A50+ area (for now), and the constants are loaded into 0x00080000 address (occupying very small area). The problem that I'm having now (which I didn't have before with the previous development board) is that after I enable Flash ECC, the Flash adresses that are beyond the BOOT and the Operational software (over 0x17A50) change their values and most contain 0xBAD0BAD0 instead of 0xFFFFFFFF. This is shown in the two attached screen snapshots of the debugger (before Flash ECC enable and after). After a system reset the 0xFFFFFFFF values come back. Since my constants, which are located at 0x00080000, are modified by this strange pattern, my software is crashing. My flash ECC enable routine is same as generated by HALCOGEN.

.global uP_coreEnableFlashEcc_
.asmfunc
uP_coreEnableFlashEcc_:
   mrc p15, #0x00, r0, c1, c0, #0x01

   orr r0, r0, #0x02000000

   mcr p15, #0x00, r0, c1, c0, #0x01

   bx lr

.endasmfunc 

 Can someone help and explain to me why this is happening?

Thanks,

 

Alex

  • Alex, You must program the correct ECC codes for the entire flash contents. The contents shown by the debugger indicate that the CPU received a bus error when accessing these locations in debug mode. This would have resulted in a data abort if any of these locations were accessed in the code. Regards, Sunil
  • Suni,

    Thanks for quick response.

    I understand that you are saying, I didn't program the ECC for my constants and that is why the software crashes when it is trying to read them. Is that correct?

    I thought that I did program all correctly as I did for the other processor. Here is my ECC batch file:

    C:\ti\nowECC\v2.17\nowECC -f021 16M_ADD -r4 -a X_OPS\Debug\X_OPS.out -o X_OPS_ECC.out
    C:\ti\nowECC\v2.17\nowECC -f021 16M_ADD -r4 -a X_BOOT\Debug\X_BOOT.out -o X_BOOT_ECC.out
    C:\ti\nowECC\v2.17\nowECC -f021 16M_ADD -r4 -a X_CT\Debug\X_CT.out -o X_CT_ECC.out

    Below are the snapshots for the nowFlash settings. 

    Did I incorrectly set something?

  • Alex,

    Can you read the ECC locations for the flash memory with the debugger before you enable the flash ECC checking? Then you can be sure that the ECC did in fact get programmed correctly. You can also convert the nowECC output .out files to .x0 files and check the contents of the ECC region.

    Use this command: hex470 -romwidth 32 <filename.out>

    Regards,

    Sunil

  • Sunil,

    This was the problem. The code to ECC size ratio in my first processor is 2:1, but in this processor it is 8:1, so I misplaced my constants ECC in nowFlash.

    Thanks for help.

     

    Did you have time to look again at my MibSPI/DMA issue?

    Alex 

  • Alex, I have a reply from the design team now on the SPI question. I will post it there. Regards, Sunil