Variables or data declared and allocated in external SDRAM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Variables or data declared and allocated in external SDRAM

397 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcolando on Wed Jan 27 04:16:30 MST 2016
Hello everybody,
I'm working with an LPC1788 with external SDRAM. The memory is already configured in my code but I'm facing a problem regarding memory access.
Can anyone tell a simple way to declare a variable or a structure (for example a frame buffer for an LCD display...) so that the linker will place them in the external SDRAM?
I tried to specify a new memory region through Project Property -> MCU settings called SDRAM starting at address 0xA0000000 as mapped in the EMC interface but a simple variable declaration of the form
__attribute__((section("SDRAM"))) long my_variable;

doesn't work: my_variable is anyway allocated in internal RAM.

Any comment will be appreciated,
Regards.
0 Kudos
3 Replies

324 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcolando on Wed Feb 10 00:49:09 MST 2016
I just changed my declaration on:
__SECTION(data, SDRAM) long my_variable;

and this seems to be ok.

Thank you guys,
Regards.
0 Kudos

324 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Jan 27 08:31:58 MST 2016
Simplest way in LPCXpresso IDE is to use the macros described in:

[list]
  [*]https://www.lpcware.com/content/faq/lpcxpresso/data-different-ram-blocks
[/list]

For more complex requirements, look at using the Freemarker linker script mechanism :

[list]
  [*]https://www.lpcware.com/content/faq/lpcxpresso/freemarker-linker-script-templates
[/list]

Regards,
LPCXpresso Support
0 Kudos

324 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Wed Jan 27 08:21:32 MST 2016
A memory region is not a section!
Define a section in your linker file.
0 Kudos