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 Load Issue

Other Parts Discussed in Thread: TMS570LS3137

I recently started getting the following error when loading my TMS570LS3137 HDK:


CortexR4: Flash algorithm returned an error during Flash programming. Operation cancelled.

CortexR4: Unable to terminate memory download: (Error -1003 @ 0x2BC5) Internal error: Invalid parameter passed to function. Restart the application. If error persists, please report the error. (Emulation package 5.1.73.0)

CortexR4: GEL: File: C:\Users\jeremy.henderson\Desktop\workspace\project\Debug\project.out: Load failed.

I can get the program to load if I comment out a couple of functions, then try the load again. This leads me to think there is a constraint on the size of the executable being loaded. I am using the free CCS license with the XDS100v2 USB emulator that is built into the dev board. Is there a size limit when using the free CCS license with the XDS100v2 on a TMS570LS3137?

  • Hi Jeremy, 

    I've referred this to our subject matter expert who will get back to you.

    - Paul B.

  • Hello Jeremy,

    Would you post the memory map of the version that fails?

  • It looks like you are trying to put your .data segment in Flash instead of RAM.  You also have Flash memory region set to RWIX.  Flash should not be considered a writable region when linking.

    I am not sure that is the complete cause of your issue, but it is a first step to look into.

  • I didn't realize that the included rtsv7R4_A_be_v3D16_eabi.lib library used some data space. I've modified my linker cmd file to allocate data space in RAM. I also made flash read only. However I am seeing the same error message.

    Here is the new map file:

    0184.ARM_SS.txt

  • What version of CCS are you using?

    What version of Hercules emulation do you have ( help -> About Code Composer Studio -> Installation Details )?

    What are your Flash tool setting within CCS?

  • CCS version: 5.4.0.00091

    Hercules Emulation: 5.4.0.3

    Flash tool settings

    OSCIN: 16.0

    Auto ECC Generation

    Verify

    Erase Necessary Sectors Only

     

    Interesting note: I have been playing around with enabling Flash ECC. When I uncheck 'Auto ECC Generation' from the flash settings the code loads as expected. Why would Auto ECC Generation cause a problem like that?

  • The reason you are seeing the issue when Auto ECC Generation is turned on is due to the fact your code is not padded to a 64 bit boundary.  Since ECC is calculated on 64bits.  Therefor code used for programming requires this alignment when using Auto ECC Generation.  The workaround for this is to add palign(8), fill = 0xFFFFFFFF option to your Flash memory regions.

    i.e.

    SECTIONS
    {
        .intvecs : palign(8), fill = 0xffffffff {} > 0x0            /* INTERRUPT VECTORS                 */
        .text    : palign(8), fill = 0xffffffff {} > P_MEM                /* CODE                            */
        .cinit   : palign(8), fill = 0xffffffff {} > P_MEM               /* INITIALIZATION TABLES           */
        .const   : palign(8), fill = 0xffffffff {} > P_MEM               /* CONSTANT DATA                   */
        .pinit   : palign(8), fill = 0xffffffff {} > P_MEM                /* TEMPLATE INITIALIZATION TABLES  */

        .bss     : {} > D_MEM               /* GLOBAL & STATIC VARS            */
        .data    : {} > D_MEM               /* GLOBAL & STATIC VARS EXPLICIT   */
        .sysmem  : {} > D_MEM               /* DYNAMIC MEMORY ALLOCATION AREA  */
        .stack     : {} > D_MEM                /* SOFTWARE SYSTEM STACK           */
    }

    I think this issue was fixed in CCS 5.5 by automatically padding to 64 bits, but not positive.