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.

TMS320F2800132: Only half the available flash seems available.

Part Number: TMS320F2800132
Other Parts Discussed in Thread: C2000WARE

Tool/software:

I am getting the following error: 

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.

Upon further investigation it appears it is related to the .const section string data:

(from the .map file)

.const 0 00088000 000007ac
00088000 00000457 <whole-program> (.const:.string)
00088457 00000001 --HOLE-- [fill = 0]
00088458 0000009c driverlib.lib : flash.obj (.const:.string)
000884f4 0000009b : epwm.obj (.const:.string)
0008858f 00000001 --HOLE-- [fill = 0]
00088590 0000009b : gpio.obj (.const:.string)
0008862b 00000001 --HOLE-- [fill = 0]
0008862c 0000009b : sysctl.obj (.const:.string)
000886c7 00000001 --HOLE-- [fill = 0]
000886c8 00000098 : sci.obj (.const:.string)
00088760 0000004c : adc.obj (.const:.string)

However, when I change the xxx_flash_lnk.cmd file to place this section after the .text section (within 32K), the problem disappears.

In other words, the part is behaving as if it only has 32K of flash rather than the 64K it actually does.

How do I access the other 32K and why can't the loader write to the upper 64K as instructed by the linker output?

Thank you,

-Sergio

  • Hi Sergio, 

    Please check the memory allocation tool and identify the distribution of the memory. You can also have a look at the generated .map file which will have the details of the memory sections used.

    Thanks

    Aswin

  • Here's the error when I don't relocate the .const (i.e. leave it at FLASH_BANK0_SEC_32_39 to use flash above 32K)

    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.
    File Loader: Verification failed: Values at address 0x088000@Program do not match (expected: 0x0025, actual: 0xFFFF) Please verify target memory and memory map.
    GEL: File: C:\Users\sergi\AppData\Local\Temp\ti_cloud_storage\monsoon_project.out: a data verification error occurred, file load failed.

    And here's the memory allocation tool:

    And here's the memory allocation display when I change it to FLASH_BANK0_SEC_24_31 (no errors)

    By the way, I tried this on two different boards with the same results.

  • Sergio, 

    Can you try out the linker cmd files present in our SDK and rebuild your project, or can you also provide the linker cmd file in your project - 

    C:\ti\c2000\C2000Ware_5_04_00_00\device_support\f280013x\common\cmd\280013x_generic_flash_lnk_noLS1_noM1.cmd

    Thanks

    Aswin

  • Aswin, I did use the linker command file that came with the SDK:

    MEMORY
    {
       BEGIN            : origin = 0x00080000, length = 0x00000002
       BOOT_RSVD        : origin = 0x00000002, length = 0x00000126
    
       RAMM0            : origin = 0x00000128, length = 0x000002D8
       RAMM1            : origin = 0x00000400, length = 0x000003F8
       // RAMM1_RSVD       : origin = 0x000007F8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    
       RAMLS0           : origin = 0x00008000, length = 0x00002000
       RAMLS1           : origin = 0x0000A000, length = 0x00001FF8
       // RAMLS1_RSVD      : origin = 0x0000BFF8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    
       RESET            : origin = 0x003FFFC0, length = 0x00000002
    
       /* Flash sectors */
       FLASH_BANK0_SEC_0_7     : origin = 0x080002, length = 0x1FFE  /* on-chip Flash */
       FLASH_BANK0_SEC_8_15    : origin = 0x082000, length = 0x2000  /* on-chip Flash */
       FLASH_BANK0_SEC_16_23   : origin = 0x084000, length = 0x2000  /* on-chip Flash */
       FLASH_BANK0_SEC_24_31   : origin = 0x086000, length = 0x2000  /* on-chip Flash */
       FLASH_BANK0_SEC_32_39   : origin = 0x088000, length = 0x2000  /* on-chip Flash */
       FLASH_BANK0_SEC_40_47   : origin = 0x08A000, length = 0x2000  /* on-chip Flash */
       FLASH_BANK0_SEC_48_55   : origin = 0x08C000, length = 0x2000  /* on-chip Flash */
       FLASH_BANK0_SEC_56_63   : origin = 0x08E000, length = 0x2000  /* on-chip Flash */
       FLASH_BANK0_SEC_64_71   : origin = 0x090000, length = 0x2000  /* on-chip Flash */
       FLASH_BANK0_SEC_72_79   : origin = 0x092000, length = 0x2000  /* on-chip Flash */
       FLASH_BANK0_SEC_80_87   : origin = 0x094000, length = 0x2000  /* on-chip Flash */
       FLASH_BANK0_SEC_88_95   : origin = 0x096000, length = 0x2000  /* on-chip Flash */
       FLASH_BANK0_SEC_96_103  : origin = 0x098000, length = 0x2000  /* on-chip Flash */
       FLASH_BANK0_SEC_104_111 : origin = 0x09A000, length = 0x2000  /* on-chip Flash */
       FLASH_BANK0_SEC_112_119 : origin = 0x09C000, length = 0x2000  /* on-chip Flash */
       FLASH_BANK0_SEC_120_127 : origin = 0x09E000, length = 0x1FF0  /* on-chip Flash */
    
       // FLASH_BANK0_SEC_127_RSVD : origin = 0x0A0FF0, length = 0x0010  /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    }
    
    SECTIONS
    {
       codestart        : > BEGIN
    
       .text            : >> FLASH_BANK0_SEC_8_15 | FLASH_BANK0_SEC_16_23 | FLASH_BANK0_SEC_24_31, ALIGN(8)
    
       .cinit           : > FLASH_BANK0_SEC_0_7, ALIGN(8)
       .switch          : > FLASH_BANK0_SEC_0_7, ALIGN(8)
    
       .reset           : > RESET,  TYPE = DSECT /* not used, */
    
       .stack           : > RAMM1
    
    #if defined(__TI_EABI__)
       .bss             : > RAMLS0
       .bss:output      : > RAMLS0
       .init_array      : >> FLASH_BANK0_SEC_0_7, ALIGN(8)
       .const           : >> FLASH_BANK0_SEC_32_39, ALIGN(8)
       .data            : > RAMLS0
       .sysmem          : > RAMLS0
      .bss:cio          : > RAMLS0
    #else
       .pinit           : >> FLASH_BANK0_SEC_0_7, ALIGN(8)
       .ebss            : > RAMLS0
       .econst          : >> FLASH_BANK0_SEC_32_39, ALIGN(8)
       .esysmem         : > RAMLS0
       .cio             : > RAMLS0
    #endif
    
    #if defined(__TI_EABI__)
       .TI.ramfunc      : LOAD = FLASH_BANK0_SEC_0_7,
                          RUN = RAMLS0,
                          LOAD_START(RamfuncsLoadStart),
                          LOAD_SIZE(RamfuncsLoadSize),
                          LOAD_END(RamfuncsLoadEnd),
                          RUN_START(RamfuncsRunStart),
                          RUN_SIZE(RamfuncsRunSize),
                          RUN_END(RamfuncsRunEnd),
                          ALIGN(8)
    #else
       .TI.ramfunc      : LOAD = FLASH_BANK0_SEC_0_7,
                          RUN = RAMLS0,
                          LOAD_START(_RamfuncsLoadStart),
                          LOAD_SIZE(_RamfuncsLoadSize),
                          LOAD_END(_RamfuncsLoadEnd),
                          RUN_START(_RamfuncsRunStart),
                          RUN_SIZE(_RamfuncsRunSize),
                          RUN_END(_RamfuncsRunEnd),
                          ALIGN(8)
    #endif
    
        /*  Allocate IQ math areas: */
       IQmath           : > FLASH_BANK0_SEC_32_39, ALIGN(8)
       IQmathTables     : > FLASH_BANK0_SEC_32_39, ALIGN(8)
    }
    

    However, it didn't work as such so I had to modify the .const section as mentioned earlier.

  • Hi Sergio,

    Which ccs and SDK version are you using?

  • Sergio is out of the office until 5/22 but I can answer this.

    We are using CCS 20.0.2 

    And the SDK is C2000Ware 5.04

  • Hi Eric,

    Is it possible to share the example in zip format for further analysis?

    Thanks

    Aswin

  • I'll email to our reps. Thanks!