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.

CCS/CC1310: Not-initialize Regions in Internal Flash Memory

Part Number: CC1310

Tool/software: Code Composer Studio

Hi all,

I'm working with cc1310f128 under Code Composer Studio last version.

I have some task as I've described and solved there https://e2e.ti.com/support/wireless_connectivity/proprietary_sub_1_ghz_simpliciti/f/156/t/610637 under IAR.

I've make this regions by modifying the CC1310DK_7XD_NoRTOS.cmd file:

#define FLASH_BASE 0x0

#define FLASH_SIZE 0x1BFFF//0x20000

#define HW_ERR_BASE 0x1C000

#define HW_ERR_SIZE 0x1000

#define BANK_0_BASE 0x1D000

#define BANK_0_SIZE 0x1000

#define BANK_1_BASE 0x1E000

#define BANK_1_SIZE 0x1000

#define CCFG_BASE 0x1F000

#define CCFG_SIZE 0x1000

 

MEMORY

{

 ...

/* RFCM parameters and Error Codes stored in internal flash */

BANK_0 (RW) : origin = BANK_0_BASE, length = BANK_0_SIZE

BANK_1 (RW) : origin = BANK_1_BASE, length = BANK_1_SIZE

HW_ERR (RW) : origin = HW_ERR_BASE, length = HW_ERR_SIZE

CCFG (RW) : origin = CCFG_BASE, length = CCFG_SIZE

 ...

}

SECTIONS

{

...

.bank_0 : > BANK_0

.bank_1 : > BANK_1

.hw_err : > HW_ERR

.ccfg : > CCFG (HIGH)

...

}

1) Whereby can I to define those flash regions not-initializing, I mean that the compiler/linker don't put any values and don't erase those regions.

2)Whereby can I to declare in my application the pointers to those regions?

3)For keeping ccfg data on it's original place I've make separate region for this. Which way can I to make a section into the internal flesh memory at specified address without defining separate region for each section

I'm new in Code Composer and cannot to find this thinks in CCS Help. 

 

  • The best references for understanding the TI linker command file syntax are linked below.  

    ARM Assembly language Tools Users Guide - see the Linker chapter
    Linker command file Primer

    If your questions are beyond the scope of these references, I would suggest asking specific ones at the CC1310 device forum. I don't have device expertise so would not be able to guide you on what would be the correct/recommended allocations for this device, however the experts in the device forum should be able to help with that.

  • Thanks for suggestion.
    But which way can I to put a variable at a specific flash address?
    Do you can to provide a link to CCS C-compiler too?
  • Igor Natachanny said:
    But which way can I to put a variable at a specific flash address?

    You can do this using the DATA_SECTION pragma. There is a related post here, and more information about the pragma in the Compiler Users Guide.

    This page contains links to all the Users Guides, you would want to look at the ARM Compiler Users Guide: 
    http://processors.wiki.ti.com/index.php/TI_Compiler_Information#Compiler_Manuals

  • I've do all as described and in my source file
    "
    #pragma DATA_SECTION(params_0, "bank_0")
    #pragma DATA_SECTION(params_1, "bank_1")
    FLASH_PARAMS_ST params_0;
    FLASH_PARAMS_ST params_1;
    "
    , but in build I've got a warning "warning #10247-D: creating output section "bank_0" without a SECTIONS specification"
    Besides the code don't run and don't do the work.
    What is wrong there?
  • Igor Natachanny said:
    but in build I've got a warning "warning #10247-D: creating output section "bank_0" without a SECTIONS specification"

    Please see this link for explanation of the warning.

    You need to explicitly allocate "bank_0" to the appropriate memory region where it needs to go by specifying it within the SECTIONS directive in the linker command file.

  • Hi AartiG,

    This is the fragment from my actually linker command file (my_appl.cmd file)

    ...

    #define FLASH_BASE 0x0

    #define FLASH_SIZE 0x1BFFF//0x20000

    #define HW_ERR_BASE 0x1C000

    #define HW_ERR_SIZE 0x1000

    #define BANK_0_BASE 0x1D000

    #define BANK_0_SIZE 0x1000

    #define BANK_1_BASE 0x1E000

    #define BANK_1_SIZE 0x1000

    #define CCFG_BASE 0x1F000

    #define CCFG_SIZE 0x1000

    #define RAM_BASE 0x20000000

    #define RAM_SIZE 0x5000

    /* System memory map */

    MEMORY

    {

    /* Application stored in and executes from internal flash */

    FLASH (RX) : origin = FLASH_BASE, length = FLASH_SIZE

    /* RFCM parameters and Error Codes stored in internal flash */

    BANK_0 (RW) : origin = BANK_0_BASE, length = BANK_0_SIZE

    BANK_1 (RW) : origin = BANK_1_BASE, length = BANK_1_SIZE

    HW_ERR (RW) : origin = HW_ERR_BASE, length = HW_ERR_SIZE

    CCFG (RW) : origin = CCFG_BASE, length = CCFG_SIZE

    /* Application uses internal RAM for data */

    SRAM (RWX) : origin = RAM_BASE, length = RAM_SIZE

    }

    /* Section allocation in memory */

    SECTIONS

    {

    .intvecs : > FLASH_BASE

    .text : > FLASH

    .TI.ramfunc : {} load=FLASH, run=SRAM, table(BINIT)

    .const : > FLASH

    .constdata : > FLASH

    .rodata : > FLASH

    .cinit : > FLASH

    .pinit : > FLASH

    .init_array : > FLASH

    .emb_text : > FLASH

    .bank_0 : > BANK_0

    .bank_1 : > BANK_1

    .hw_err : > HW_ERR

    .ccfg : > CCFG (HIGH)

    .vtable_ram : > SRAM

    .data : > SRAM

    .bss : > SRAM

    .sysmem : > SRAM

    .nonretenvar : > SRAM

    .stack : > SRAM (HIGH)

    }

    ...

    When I comment out in *.c file this line

    #pragma DATA_SECTION(params_0, "bank_0")

    the warning is disappear and program is working.

    This line

    #pragma DATA_SECTION(params_1, "bank_1")

    don't makes this warning .

    What is wrong in my linker command file?

  • The section name in the DATA_SECTION pragma is different from the section name in the linker command file (one has a period, the other does not). Make sure that the two match up.

    #pragma DATA_SECTION(params_0, "bank_0")

    .bank_0 : > BANK_0

     

    Igor Natachanny said:

    This line

    #pragma DATA_SECTION(params_1, "bank_1")

    don't makes this warning .


    Perhaps this section was never generated or got optimized. You can check if a section by that name exists by looking at the generated assembly file for that source file (enable the -k compiler option to keep the generated assembly files). You can also look at the final link map file to see if and where these sections are being allocated.

  • Thanks, AartiG. This "period" was the problem. But now I'm encountered with another one.

    Then one of this strings

      #pragma DATA_SECTION(hwe, ".hw_err")
      #pragma DATA_SECTION(params_0, ".bank_0")
      #pragma DATA_SECTION(params_1, ".bank_1")

    is present in *.c file the build pass completely without warnings but debugger don't  comes to application start point.

    What is wrong there?

  • Igor Natachanny said:
    What is wrong there?

    That depends on many factors and requires an overall understanding of the code/app and how everything should be set up in order for it to work correctly. Unfortunately, that is not something that we, in this CCS forum, have the expertise to help with. Perhaps you could try asking in the CC1310 device forum.

  • Hi AartiG,
    I've resolved this problem by using #pragma location and #pragma NOINIT instead #pragma DATA_SECTION.
    This way I've reached my primary goal: to put my variables at specific addresses in the flash and make its contents non-erasable.
    And the debugger is working now. The problem with #pragma DATA_SECTION remained misunderstood by me until.
    Is it reasonable to left the sections I've made in flash memory or will return to the original linker command file?
    Any way thank you a lot for many useful links you've provided for me
  • I'm glad to hear the problem is resolved. If you don't mind, please go ahead and mark this thread as Answered.

    Igor Natachanny said:
    Is it reasonable to left the sections I've made in flash memory or will return to the original linker command file?

    I think either way should be ok.