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.

TMS570LC4357: flash verification error.

Part Number: TMS570LC4357
Other Parts Discussed in Thread: TMS570LS0432, HALCOGEN

I am getting the flash verification error. But I don't understand any of the responses that I read!
I know the memory map of the device, but where do I fix it? The map file is not the place because it gets overwritten by the tools.

CortexR4: Trouble Reading Register PC: (Error -242 @ 0x0) A router subpath could not be accessed. The board configuration file is probably incorrect. (Emulation package 9.5.0.00143)
CortexR4: GEL Output: Memory Map Setup for Flash @ Address 0x0CortexR4: Error initializing flash programming: Target failed to read 0xFFFFFFF0
CortexR4: Loader: One or more sections of your program falls into a memory region that is not writable. These regions will not actually be written to the target. Check your linker configuration and/or memory map.
CortexR4: File Loader: Verification failed: Values at address 0x00020100 do not match Please verify target memory and memory map.

The very first line is new
Here is the memory map of the device.

Here is contents of the map file:
name origin length used unused attr fill
---------------------- -------- --------- -------- -------- ---- --------
VECTORS 00020100 00000020 00000020 00000000 X
KERNEL 00020120 00008000 00005558 00002aa8 R X
FLASH0 00028120 00037fe0 00012ab4 0002552c R X
STACKS 08000000 00000800 00000000 00000800 RW
KRAM 08000800 00000800 00000104 000006fc RW
RAM 08001000 00007000 00002a1e 000045e2 RW
According to this, flash is 28120 + 37FE0 = 60100
But the datasheet limits the first flash area to 60000 bytes, which is 100h bytes less.
Is this what causes the error? If yes, how do I fix it? I tried editing the map file, but obviously that doesn't work, since CCS overwrites the map file
Where and how do you fix this? Or there is another problem which I don't know?
I also set the limits here, but with no luck. I am still getting the same error.

In the above picture I disabled sectors 9-11 so the flash memory matches the datasheet, again to no avail.

  • Is this what causes the error?

    It sounds like the problem is that the program is larger than than the size of the flash.

    Can you confirm:

    a. Which device is being used? The part number in the thread title is TMS570LC4357, but the datasheet memory map is shown for a TMS570LS0432.

    b. Is HALCoGen being used, and if so which device was selected for the HALCoGen project? I would have expected the linker to report an error if the size of the flash was exceeded, but the HALCoGen device selection tells HALCoGen the size of the flash to specify in the generated linker command file.

  • Hi Depeng,

    Could you please answer Chester's questions? 

    The flash size of TMS570LS0432 is 0x60000, but you code size is 0x60100 which is out of the valid range. This is why you get program error or verification error.

  • They claimed that the code is too large. But that's not the case. It's the allocation that's wrong. I wanted to know where to set memory allocation, if they can point me to that.

  • This is from your map file:

    ---------------------- -------- --------- -------- -------- ---- --------
    VECTORS 00020100 00000020 00000020 00000000 X
    KERNEL 00020120 00008000 00005558 00002aa8 R X
    FLASH0 00028120 00037fe0 00012ab4 0002552c R X
    STACKS 08000000 00000800 00000000 00000800 RW
    KRAM 08000800 00000800 00000104 000006fc RW
    RAM 08001000 00007000 00002a1e 000045e2 RW

    Please change the length of FLASH0 in your CMD file:

    FLASH0  (RX) :  origin=0x00028120  length=0x37ee0