Link to home
Start Free TrialLog in
Avatar of JohnSantaFe
JohnSantaFe

asked on

Using two types of memory on a board

I'm programming an embedded system using a custom board that has two types of memory on the board, 2MB of SRAM and 128 MB of SDRAM.

My operating system and application have broken the 2MB limit and so I need to start using the SDRAM too.  I have some large data structures that if I could just get those into SDRAM it would probably solve the problem.

I know the address for both types of memory.  How do I get my data structures to be store in the SDRAM?

Thanks.
Avatar of JohnSantaFe
JohnSantaFe

ASKER

As a follow up, I found that there is a gcc option to define where the text is located.  I could run my entire application out of SDRAM.  That would be ok too.

Anybody know how to use the gcc option to do that?

Thanks.
Not gcc but maybe the linker.
But it depends on the platform and SDK - this is usually a customized feature.
what are you using?

I'm using a Sparc 8 based processor called a Leon3.  
I thought this was a standard feature of the linker that comes with GCC?
ASKER CERTIFIED SOLUTION
Avatar of HappyCactus
HappyCactus
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Kind of worked still getting strange behavior.
Thanks
Which kind of "strange behaviour", related to this question (my comment doesn't solve this issue, that's why it's only "B" rated?) ? can you open a new question?
I appreciate the help.  
With your suggestions the linker would relocate the text but it would still not run. Eventually I figured out that on this architecture you also have to set the stack pointer to the top of the SDRAM for this to work.  Also I found that there is a more direct way to get the linker to relocate.  Instead of modifying the linker script you can just use -Wl -Ttext 0x60000000 in the call to the linker script.  
With those issues and a meaningful response taking two days, I didn't feel this deserved an "A".