Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Using two types of memory on a board

Posted on 2011-02-15
7
295 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:JohnSantaFe
  • 4
  • 3
7 Comments
 

Author Comment

by:JohnSantaFe
ID: 34902667
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.
0
 
LVL 12

Expert Comment

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

0
 

Author Comment

by:JohnSantaFe
ID: 34911911
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?
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 12

Accepted Solution

by:
HappyCactus earned 500 total points
ID: 34914131
You need to change the linker script. The linker script is a file that defines the memory layout used for the program.
According to the documentation (see: memory organization), the default linker script defines a .text segment starting at address 0x40000000.
According to this post, you can change the linker script directly from your project directory, by using the "-X" and "-T" options in bcc.
I do not have any way to check if this works.

Hope that helps.
0
 

Author Closing Comment

by:JohnSantaFe
ID: 34931306
Kind of worked still getting strange behavior.
Thanks
0
 
LVL 12

Expert Comment

by:HappyCactus
ID: 34932305
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?
0
 

Author Comment

by:JohnSantaFe
ID: 34948595
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".
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ShoreTel PBX blocking incoming number 1 88
Is my HP C7000 enclosure failing? 2 60
Calibrating x & y screen  pixel coordinates 1 39
Power supply fan not spinning 12 65
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Stuck in voice control mode on your Amazon Firestick?  Here is how to turn it off!!!
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question