Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Problem using SDRAM

Altera_Forum
Honored Contributor II
1,141 Views

Hello, 

I have problem using SDRAM on my custom board. 

 

My program won't run when I map program memory(.text) to SDRAM. 

 

I have no trouble reading/writing SDRAM from my program if .text is mapped to internal RAM. 

 

I kind of have a feeling that this has got to do with 

my setting SDRAM controller to:  

"controller shares dq/dqm/addr I/O pins". 

 

If I disabled this setting, not use external flash, and map .text to SDRAM. 

then my program runs fine. 

 

I had to choose "controller shares dq/dqm/addr I/O pins" 

because my hardware shares data/address bus with external flash. 

 

Any advice to solve this problem?
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
445 Views

 

--- Quote Start ---  

originally posted by fuji@Oct 20 2005, 06:40 AM 

i had to choose "controller shares dq/dqm/addr i/o pins" 

because my hardware shares data/address bus with external flash. 

--- Quote End ---  

 

Usually, folks give the SDRAM its own bus so other things won't slow it down. 

 

That said, I think there's a section in the SDRAM controller manual that says what you have to do to make the shared pins work, besides checking that box. SOunds to me like the SDRAM and Flash are conflicting with each other, being selected at the same time, or something. If it were happening to me, I'd have to hook up SignalTap or a logic analyzer to see what was happening. Sorry I'm not more help.
0 Kudos
Altera_Forum
Honored Contributor II
445 Views

Thank you, Mike. 

 

We some how managed to solve the problem 

by shifting the phase of altpll. 

 

I don't know quite why... 

I will post again if I find anything new.
0 Kudos
Altera_Forum
Honored Contributor II
445 Views

 

--- Quote Start ---  

originally posted by fuji@Oct 21 2005, 06:42 AM 

we some how managed to solve the problem 

by shifting the phase of altpll. 

--- Quote End ---  

 

Yeah, you have to set that on a per-design basis. That phase shift compensates for delay in the non-clock lines to the SDRAM.
0 Kudos
Altera_Forum
Honored Contributor II
445 Views

hello! 

 

i have a very similar problem, my code is not running from my external RAM (SSRAM) and i am using a custom board. i cud not follow how u solved the problem, can u please explain what i should do to get it working. 

 

my opcode fetches are happening fine, but the stack pointer (fp) is pointing to an absurd address location. 

 

Thanks in advance, 

Raghu
0 Kudos
Altera_Forum
Honored Contributor II
445 Views

What I think fuji did, is shift the phase of the clock feeding the external memory. 

Since there is a significant delay going off-chip to fetch data, and the memory is supposed to be synchronous with your processor, the clock-skew because of this delay is affecting the behavior. 

The clock therefore has to be phase shifted to compensate for this delay. For an example on how this is done, see altera documentation (http://www.altera.com/education/univ/materials/manual/labs/tut_de2_sdram_verilog.pdf

 

Since you are using a custom board, you will have to somehow figure out what the number (-3 ns in the above document) is for your board. 

 

 

--- Quote Start ---  

originally posted by raghuraman@Oct 24 2005, 04:06 AM 

hello! 

 

i have a very similar problem, my code is not running from my external ram (ssram) and i am using a custom board. i cud not follow how u solved the problem, can u please explain what i should do to get it working. 

 

my opcode fetches are happening fine, but the stack pointer (fp) is pointing to an absurd address location. 

 

thanks in advance, 

raghu 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=10535) 

--- quote end ---  

 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
445 Views

My advice is to remove the parallel flash and to use the EPCS flash to store software. The board will be cheaper and simpler this way. 

 

The serial flash is fast enough, we get 1.1MB/s transfer for the software. You can use serial flashes from other manufacturers: 

http://forum.niosforum.com/forum/index.php...14&hl=signature (http://forum.niosforum.com/forum/index.php?showtopic=3814&hl=signature

 

IzI
0 Kudos
Reply