Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Uing SDRAM in AT91SAM9260
PostPosted: Wed Apr 06, 2011 7:22 am 
Offline

Joined: Wed Apr 06, 2011 7:18 am
Posts: 1
i think that all this process explained is for the booting SAM from the SDRAM or in other words storing the program instructions in the SDRAM.
This thing is already being done.

But we have to use SDRAM as a general purpose RAM i.e. storing data into the SDRAM from within the code.


Top
 Profile  
 
 Post subject: Re: Using SDRAM in AT91SAM9260
PostPosted: Wed Apr 06, 2011 3:51 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
>>But we have to use SDRAM as a general purpose RAM i.e. storing data into the SDRAM from within the code.

And how exactly would you do this in C normally? Honestly, how does this normally happen for programs you develop? And how does this differ for the 9260? Do you have a familiarity with compilers, assemblers, linkers and loaders, and their role in the generation and placement of code and data?

You'd probably use dynamic memory allocation from a heap (malloc,realloc,free, etc), or static allocations (globals).

To REITERATE : If you want the compiler/linker to know about memory regions within an embedded part/system, you will need to define those, typically in a scatter file or linker script, depending on the tool chain. If you don't understand this you will need to review the documentation for the tools, because the compiler is pretty much agnostic to type and placement of RAM within the system.

The booting part is also important because you have to initialize the system and get your initial code/data into the SDRAM.

Suggest you review C startup code, and the boot process of the AT91 parts.


Top
 Profile  
 
 Post subject: Re: Using SDRAM in AT91SAM9260
PostPosted: Wed Apr 06, 2011 6:19 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
Depending on your tool chain

/*------------------------------------------------------------------------------
* Linker script for running in external SDRAM on the AT91SAM9260
*----------------------------------------------------------------------------*/

OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(entry)

MEMORY
{
sram0 (W!RX) : ORIGIN = 0x200000, LENGTH = 0x1000
sram1 (W!RX) : ORIGIN = 0x300000, LENGTH = 0x1000
sdram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x4000000
}

SECTIONS
{
.fixed :
{
. = ALIGN(4);
_sfixed = .;
*(.text*)
*(.rodata*)
*(.glue_7)
*(.glue_7t)
*(.data)
. = ALIGN(4);
_efixed = .;
} >sdram

.prerelocate : AT (_efixed)
{
. = ALIGN(4);
_sprerelocate = .;
. = ALIGN(4);
_eprerelocate = .;
}

.postrelocate : AT (_efixed + SIZEOF(.prerelocate))
{
. = ALIGN(4);
_spostrelocate = .;
*(.vectors)
*(.ramfunc)
. = ALIGN(4);
_epostrelocate = .;
} >sram0

.bss (NOLOAD) : {
_szero = .;
*(.bss)
. = ALIGN(4);
_ezero = .;
} >sdram

_sstack = 0x24000000;
}
end = .;


OR


; *------------------------------------------------------------------------------
; * Linker scatter for running in external SDRAM on the AT91SAM9260
; *----------------------------------------------------------------------------*/

Load_region 0x20000000 0x4000000 {

Fixed_region 0x20000000 {
*(cstartup +First)
.ANY (+RO +RW +ZI)
}

Relocate_region 0x200000 0x1000 {
*.o (VECTOR, +First)
}

ARM_LIB_HEAP 0x23FFE000 EMPTY 0x1000 {
}

ARM_LIB_STACK 0x24000000 EMPTY -0x1000 {
}
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: