AnsweredAssumed Answered

Help to create large buffers in RAM

Question asked by B3rsui on Aug 12, 2013
Latest reply on Aug 13, 2013 by B3rsui
Hello guys,

I need some help. I want to create a large buffer in the sram and I'm having some problems with the compiler. I want to use the 112KB SRAM memory (pag 52 - RM0090) for my buffer. But when I want to create a buffer of 35000Bytes I get this error:

CoIDE errors:
    [...]/arm-none-eabi/bin/ld.exe: uIP 1.elf section `.co_stack' will not fit in region `ram'
    [...]/arm-none-eabi/bin/ld.exe: region `ram' overflowed by 3232 bytes

After search and read a lot I found a couple of helpful topics, like this one. The thing is that my linker looks different and, as I don't know anything about lkr files, I don't know what to do. This is my lkr.

OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
/* Internal Memory Map*/
MEMORY
{
    rom (rx)  : ORIGIN = 0x08000000, LENGTH = 0x00100000
    ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00020000
    ram1 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x00010000
}
 
_eram = 0x20000000 + 0x00020000;
/* Section Definitions */
SECTIONS
{
    .text :
    {
        KEEP(*(.isr_vector .isr_vector.*))
        *(.text .text.* .gnu.linkonce.t.*)       
        *(.glue_7t) *(.glue_7)                     
        *(.rodata .rodata* .gnu.linkonce.r.*)                                
    } > rom
     
    .ARM.extab :
    {
        *(.ARM.extab* .gnu.linkonce.armextab.*)
    } > rom
     
    __exidx_start = .;
    .ARM.exidx :
    {
        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
    } > rom
    __exidx_end = .;
     
    . = ALIGN(4);
    _etext = .;
    _sidata = .;
             
    .data : AT (_etext)
    {
        _sdata = .;
        *(.data .data.*)
        . = ALIGN(4);
        _edata = . ;
    } > ram
 
    /* .bss section which is used for uninitialized data */
    .bss (NOLOAD) :
    {
        _sbss = . ;
        *(.bss .bss.*)
        *(COMMON)
        . = ALIGN(4);
        _ebss = . ;
    } > ram
     
    /* stack section */
    .co_stack (NOLOAD):
    {
        . = ALIGN(8);
        *(.co_stack .co_stack.*)
    } > ram
        
    . = ALIGN(4);
    _end = . ;
}

And I use the same declaration as van_hooft.frank.001 


volatile uint8_t buffer[35000] __attribute__((section(".buffram")));

I'm very confused because I know I don't have a buffram section defined in my lkr. So I used this other declaration: 

volatile uint8_t buffer[35000] __attribute__((section(".co_stack")));  

with same results.

So please, does anyone can help me to create a buffer as big as possible?

Best Regards!

Outcomes