FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits

DE2 Flash READ/Write

Altera_Forum
Honored Contributor II
2,494 Views

I am trying to write my output results on to flash( 

s29al032d mode 3) and then I want to read that results again in another code. I have written code which controls flash using it's CE,OE,WR,RESET. I am using it in Byte mode because BYTE pin is by default connected with GND. Address[20:0], DATA[7:0] 

 

I have tried writing different datas on different addresses, but when I read from those locations, I am not getting anything. 

 

Can someone please let me know that is it possible to wtite on DE2 board's flash? I have tried many different ways, but no result.
0 Kudos
9 Replies
Altera_Forum
Honored Contributor II
590 Views

Flash memory can't be simply written. You have to a perform an enable sequence before, see the datasheet for details. Also, flash memory has to be erased sectorwise before writing to it. I think, all Terasic examples are handling the flash memory in NIOS processor, there's no plain HDL example code.

0 Kudos
Altera_Forum
Honored Contributor II
590 Views

How to read and write into flash using C code? Example, I want to store number 1 to 10 then read it out for addition?

0 Kudos
Altera_Forum
Honored Contributor II
590 Views

Hi, 

I am Alessandro Vincenzi. I study Electronic engineering at University of Pisa (last year). 

Recently i brought DE2 and I am very happy, this is a very cool board! 

I've noticed this post is old but i would like to contribute anyway. 

 

In my project (done for one exam: Digital Circuit Design) I read flash memory. There are wav file inside loaded with Control Panel. I wrote all in AHDL. 

My memory controller read 4 wav file an mix (sum) them depending which in are active. 

If someone needs help just contact me (in this way can help me to improve my language skills :D). 

 

I posted a video on youtube (http://www.youtube.com/watch?v=gl5375x4xdu) of my project on duty :) 

 

 

Greetings, 

AV
0 Kudos
Altera_Forum
Honored Contributor II
590 Views

hi Alessandro Vincenzi. i am doing my design using vhdl. however, my flash always return 0 when i use alt_flash_open_dev. may i know why? i am doing something regarding dma.

0 Kudos
Altera_Forum
Honored Contributor II
590 Views

I have interfaced manually the flash memory so, I am sorry, i don't know why you have always 0 (alt_flash_open_dev is an api for NIOS that's right?). Only one suggestion if you haven't already done. Try to write in flash... after check that with control panel, it is very easy to use. 

I hope to be more useful next time. 

Regards, 

AV
0 Kudos
Altera_Forum
Honored Contributor II
590 Views

Hi everybody, 

 

I have a problem using NIOS II IDE 10.1 for Altera DE2 board. I want to use the Flash memory. But when I try to open the Flash device with the function alt_flash_open_dev , the return value is always 0. 

 

If anyone have an idea, please, don't hesitate to write an answer :).
0 Kudos
Altera_Forum
Honored Contributor II
589 Views

Are you giving it all the right parameters for the api call? If you're using the eclipse environment you can use control+spacebar to get a hint of the parameters required, or use F3 with the function call selected to see it's prototype.

0 Kudos
Altera_Forum
Honored Contributor II
590 Views

Hi, 

 

a few years later... 

 

does anybody know where to find the ESR_DFF.inc file - that is included in the attached memory controller ahdl code - ? 

 

It is not included with quartus 13. 

 

thanks /mattias
0 Kudos
Altera_Forum
Honored Contributor II
590 Views

Cornell University has been using DE2 for 9 years in course teaching and collected all their students projects to share in their webpage: 

 

http://people.ece.cornell.edu/land/c...finalprojects/ 

 

A of complex projects were implemented using Flash on DE2 boards; all the source code with complete reports were also shared on the web. I believe you can find solutions from the Cornell Website. 

 

Hope this can help! 

 

Ledo
0 Kudos
Reply