modify data placement from RAM to SDRAM using the script icf file

Hello I am using e2 studio Version: AND ssp1.2.2 with a custom board and a Synergy S5D9. And IAR compiler and lkinker . I get this error when I build the Project: Error[Lp011]: section placement failed unable to allocate space for sections/blocks with a total estimated minimum size of 0xa0f50 bytes (max align 0x8) in <[0x1ffe0000-0x2007ffff]> (total uncommitted space 0x9fe40).

I have shown in the *.map file, that the GUIX_XXXXX_especifications.o is placed in the SRAM región and it has grown a lot. I would like to place it in SDRAM región.

I m trying to do that, typing the S5D9.icf file. 


place at start of VECT_region  { ro section .vectors };
place in VECT_region           { ro section .vector.* };
place in ROMREG_region         { ro section .rom_registers };
place at start of FLASH_region { block VECT_INFO };
place in FLASH_region   { block LOCK_LOOKUP,
                          ro section .rodata,
                          block QSPI_NON_RETENTIVE_INIT_BLOCK,
                          block RAM_INIT_CODE,
                          block USB_DEV_DESC_BLK };
/* If DTC is used, put the DTC vector table at the start of SRAM.
This avoids memory holes due to 1K alignment required by it. */
place at start of RAM_region   { rw section .ssp_dtc_vector_table };                       
place in RAM_region     { rw,
                          rw section .noinit,
                          rw section .bss,
                          rw section .data,
                          block HW_LOCK,
                          rw section HEAP,
                          rw section .stack,
                          block RAM_CODE }
                 except { rw section .bss object GUIX_XXXXX_specifications.o };
place in DF_region      { ro section .data_flash };
place in SDRAM_region   { rw section .sdram, rw section .frame ,
                          rw section .bss object GUIX_XXXXX_specifications.o };
place in QSPI_region    { section .qspi_flash };
place in QSPI_region    { block QSPI_NON_RETENTIVE_BLOCK};
place in QSPI_region    { ro section .rodata object GUIX_XXXXX_resources.o };
place in RAM_region     { last section FREE_MEM};


But it doesn´t work. The map file doesn´t change.

Can you help me,please?

  • Hi aochoa,

    Were you now able to relocate data from RAM to SDRAM?

    RenesasRulz Forum Moderator

  • In reply to JB:

    Not yet. I am waiting for some help from you.
  • In reply to aochoa:

    Hi Amaia-
    Have you looked over the IAR Guide?

  • In reply to WarrenM:

    This answerd didn't help me at all.
  • One way to do it is:-

    1) For the files in question change sections names, e.g.:-

    --section .bss=.guix_bss
    --section .data=.guix_data
    --section .rodata=.guix_rodata

    Right click on the file, select "Options", C/C++ Compiler->Extra Options.

    Then , check "override inherited settings", check "use command line options" and enter the text:-


    2) In the linker script, add the sections .guix_bss .guix_data and .guix_rodata where you want them to be located, and the initialisation method (the example below will place the .rodata into QSPI, and the .data and .bss into SDRAM) :-

    initialize manually { section .guix_data };
    initialize manually { section .guix_bss };
    do not initialize   { ro section .guix_rodata };


    place in SDRAM_region   { last rw section .sdram, rw section .frame, rw section .guix_data, rw section .guix_bss };                          
    place in QSPI_region    { section .qspi_flash, ro section .guix_rodata };

    3) The sections in SDRAM will need to be initialised. This has to be done after the BSP code has initialised the SDRAM itself (e.g. in tx_application_define_user()) :-

    #include "bsp_api.h"
    #include "string.h"

    #pragma section = ".guix_data"
    #pragma section = ".guix_data_init"

    #pragma section = ".guix_bss"

    void Guix_Data_Init(void);
    void tx_application_define_user(void * first_unused_memory);

    void Guix_Data_Init(void)
            char * from;
            char * to;
            uint32_t section_size;
            from = __section_begin(".guix_data_init");
            to = __section_begin(".guix_data");
            section_size =  __section_size(".guix_data_init");

            memcpy(to, from, section_size);

            to = __section_begin(".guix_bss");
            section_size =  __section_size(".guix_bss");

            memset(to, 0, section_size);


    void tx_application_define_user(void * first_unused_memory)
            /* The ROM to RAM copy of ".guix_data" section and the zeroing of */
            /* ".guix_bss" section need to take palce after the SDRAM has been setup */
            /* by the BSP code */