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++

How to boot from SPI Flash?

Altera_Forum
Colaborador honorário II
1.497 Visualizações

I have design with spi flash to store my firmware and sdram to run it from. 

My EPCS is too small to run code from it. 

 

Can anyone give me boot-loader code to boot my system from SPI Flash? 

My SPI flash is ST M25Pxx. 

 

If I understand well, the boot-loader can integrate to the NIOS within the hardware image. Is that correct?
0 Kudos
3 Respostas
Altera_Forum
Colaborador honorário II
576 Visualizações

Hi motal, 

 

> I have design with spi flash to store my firmware and sdram to run it from. 

> My EPCS is too small to run code from it. 

 

You really shouldn't need much code to load a small application (a 2nd stage 

boot loader) that pulls your code in from an SPI device. How much room 

is left on your EPCS? 

 

> If I understand well, the boot-loader can integrate to the NIOS within the 

> hardware image. Is that correct? 

 

Yes -- or you could try to replace/modify the default bootloader in the EPCS 

peripheral -- have it load from your SPI device rather than the EPCS device. 

From a practical point-of-view, the EPCS is just an SPI device that you 

don't get to do pin assignments for ;-) 

 

Regards, 

--Scott
Altera_Forum
Colaborador honorário II
576 Visualizações

 

--- Quote Start ---  

originally posted by smcnutt@Jan 25 2007, 06:48 PM 

how much room is left on your epcs? 

--- Quote End ---  

 

 

 

After compression of my hardware image it's allways fit exactly to my EPCS1 - 128KB = 1MBit. 

So I can't put any software (even a little boot-loader) on the EPCS. 

 

I could write the low-level code to access the SPI Flash myself, but I'll be glad to get ready code, if someone already write that. 

 

2nd option. I saw SPI Flash core in OpenCores.com - it is possible to tell the SOPC Builder to reset from SPI memory with this core? - normally the SOPC Builder doesn't recognize SPI interfaced as memory. 

How can I add this core to SOPC builder?
Altera_Forum
Colaborador honorário II
576 Visualizações

Hi motal, 

 

> After compression of my hardware image it's allways fit exactly to my EPCS1 - 128KB = 1MBit. 

... 

> I saw SPI Flash core in OpenCores.com - it is possible to tell the SOPC Builder to reset from 

> SPI memory with this core? 

 

Logic, code, whatever ... if you have no room left on your configuration device you're in an 

unfortunate position. Perhaps you should use a bigger configuration device. ;-) 

 

In any regard, I don't think I was very clear in my last post: 

 

> or you could try to replace/modify the default bootloader in the EPCS peripheral. 

 

The EPCS controller uses on-chip memory that contains a small bootloader. If you are _already_ 

using the EPCS controller, you can try to replace the existing bootloader. Provided your 

(bootloader) implementation is smaller than the default, it should fit in your EPCS. 

 

Regards, 

--Scott
Responder