Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

"__attribute__((section(".SDRAM")))" problem

Hi all,

I'm trying to allocate a buffer in SDRAM using the declaration:

volatile int buff1_app[1280] __attribute__((section(".SDRAM")));

in SOPC i've defined a SDRAM controller named "sdram".

I've set the reset address of my system in flash, exception address,program and data memory resides in SDRAM. When i compile i receive the error message:

*** [ext_flash.flash] Error 5

H320_prove Error 5-mag-2005 12.29.36 - * *** [ext_flash.flash] Error 5 Boot copier overlaps data in flash H320_prove line 0 Error

5-mag-2005 12.29.36 - * Boot copier overlaps data in flash Error generating Flash file, exiting H320_prove line 0

if i define the buffer:

volatile int buff1_app[1280] ;

everything works fine.

Any suggestion?

14 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I've verified a strange behaviour: if i download my code (with "attribute") in SDRAM, it works;instead if i download my code in flash and than boot, it doesn't work.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    One possible explanation is that in your application code you are over running the end of buff1_app, or have some other kind of memory over write. If this was the case then the changes in memory organisation could cause the otherwise apparently harmless over write to cause a problem.

    However that doesn't tie with it working on JTAG download, but not when booting from flash. If it only fails on boot from flash, then that would suggest the problem is related to how the bootloader loads the code.

    Could this be a cache coherency problem? Do you have any cache in your system? If so, try disabling the caches and see if that changes the behaviour.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I usually get a similar error when I try to use the attribute compiler flag, putting in a section name that does not exist.

    for example, writing

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    volatile int my_shared_data __attribute__ ((section (".fake")));;[/b]

    --- Quote End ---

    gives me the following error:

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    16-mag-2005 12.26.47 - (GRAVE) elf2flash: Boot copier overlaps data in flash

    16-mag-2005 12.26.48 - (GRAVE) elf2flash: Error generating Flash file, exiting[/b]

    --- Quote End ---