Intel® FPGA University Program
University Program Material, Education Boards, and Laboratory Exercises
1174 Discussions

SD Card Interface with DE2 in Verilog

Altera_Forum
Honored Contributor II
3,032 Views

Hi, 

 

I am working on the DE2 development board and I have make use of an SD Card to store data (JPEG image data for the final project output). Can you kindly point me to where I should start? Materials would be nice. :) 

 

Past inquiries in other forums suggested that I look into a file system for the SD so that I could use it in PCs. Also, mentors of mine suggest I look into the clocking diagram of an SD interface. These are overwhelming topics so I'd like to know where to start. 

 

Thank you in advance.
0 Kudos
16 Replies
Altera_Forum
Honored Contributor II
1,431 Views

Have you examined the reference designs/tutorials from Terrasic? On the DE2 CD there is a example design: "Karaoke Machine and SD Music Player" which uses a Nios II interface with SD card support. 

 

Depending on how you are planning to do it (ie. using Nios II processor or strictly HDL based), you may want to read up on the Nios II developers guide which documents filesystem support and access using the HAL API provided by Altera. 

 

SD card is probably one of the only features I haven't used on the DE2 before sorry, so can't give you any code :(. But have a good look at the Terrasic design samples and search this forum too for lots of good info.
0 Kudos
Altera_Forum
Honored Contributor II
1,431 Views

Thank you for the reply :) 

 

I actually checked out the altera site if they have IP cores but the SD card is not available. The music player demo of terasic is getting so many complaints that it is not working but gonna give it a try anyway:D 

 

Thanks!
0 Kudos
Altera_Forum
Honored Contributor II
1,431 Views

you can get university program sdcard on website : 

 

university.altera.com 

 

there are for quartus 9.0 and 9.1. 

but i have not learn to use it ! 

 

who can help me ? thank !
0 Kudos
Altera_Forum
Honored Contributor II
1,431 Views

I tried using the university program SD card Ip core, but it didnt work, as in it didnt detect the FAT16 file system. I asked altera people, but they were unable to solve the issue.  

 

So, i adopted the Nios version, given in the DE2_SD_CARD_AUDIO example, which is the music player. It works perfectly fine,
0 Kudos
Altera_Forum
Honored Contributor II
1,431 Views

Hi syn_vnky,Did you get the FAT16 Filesystem working? If so, could you please send me the source. I would be very helpful for me. 

 

 

Thanks! 

 

duckhunter
0 Kudos
Altera_Forum
Honored Contributor II
1,431 Views

Hi, 

 

 

--- Quote Start ---  

it didnt detect the FAT16 file system 

--- Quote End ---  

 

 

Have you tried formating the SD card in FAT format? I have a 512MB SD Card, DE2 Board and Windows XP 32-bit Operating system. As I format the 512MB Card, It formats it to FAT format which is FAT16. It should indicate that it has 62,000+ clusters "allocation spaces" only. Then I used the UP IP for the SD Card, it works :) I was able to create a file, write data to it and read from it. 

 

THE PROBLEM: I am not able to create another file. And I do not know how to change the file type as I can only create "FILE" format files. I want to be able to create JPEG, TEXT formats as well. :)
0 Kudos
Altera_Forum
Honored Contributor II
1,431 Views

Please , send me the full project ! can you help me ... this term, i have project SD card streaming player on DE2 by using Ethernet protocol... but i'm a beginner ... haizzz

0 Kudos
Altera_Forum
Honored Contributor II
1,431 Views

Hi ,if we convert 4gb card from fat32 to fat16 ,University IP will detect the 4gb card??

0 Kudos
Altera_Forum
Honored Contributor II
1,431 Views

Hi every one! I have a kit named VEEK -MT, The sample programs provided by terasic to capture the image are for RUN time only. I want to store the date in SD card provided. But I am not finding any relevant document for the same. It will be helpful, If anyone help me regarding this issue.

0 Kudos
Altera_Forum
Honored Contributor II
1,431 Views

I have the project in which the image is captured and stored in the sdram, now the goal is to store the image in sdcard. but I git struck in the situation here. If there is any help from anyone, It will of great use.

0 Kudos
Altera_Forum
Honored Contributor II
1,431 Views

hi evry one,  

I have a similar problem. 

i use Altera university program educational board De4 and i wan't to interface my board with terasic Sd_card, I first create a sopc project and complie and download *.sof into target board, then I also create a demo NiosII project "Hello world!" but when i run it as NIOS II hardware i get this error : Downloading ELF Process failed  

and in console i read this  

using cable "usb-blaster [usb-0]",device1,instance0x00 

pausing target processor: not reponding. 

resetting and trying again: failed 

leaving target processor paused 

can any one help me please to solve this problem
0 Kudos
Altera_Forum
Honored Contributor II
1,431 Views

 

--- Quote Start ---  

hi evry one,  

I have a similar problem. 

i use Altera university program educational board De4 and i wan't to interface my board with terasic Sd_card, I first create a sopc project and complie and download *.sof into target board, then I also create a demo NiosII project "Hello world!" but when i run it as NIOS II hardware i get this error : Downloading ELF Process failed  

and in console i read this  

using cable "usb-blaster [usb-0]",device1,instance0x00 

pausing target processor: not reponding. 

resetting and trying again: failed 

leaving target processor paused 

can any one help me please to solve this problem 

--- Quote End ---  

 

 

 

hello there I am not able to interpret what exactly is the issue you are facing but it will be helpful if you can provide some screen shot of the console message. For your reference you can go through the video in the link below. 

 

https://www.youtube.com/watch?v=1a_cd6fbroa
0 Kudos
Altera_Forum
Honored Contributor II
1,431 Views

 

--- Quote Start ---  

hello there I am not able to interpret what exactly is the issue you are facing but it will be helpful if you can provide some screen shot of the console message. For your reference you can go through the video in the link below. 

 

https://www.youtube.com/watch?v=1a_cd6fbroa 

--- Quote End ---  

 

Good morning, 

to start i use this tutorial video to test my FPGA using the NIOS program. 

evry thing is OK until i run the C program within the eclipse as NIOS Hardware i get this error shown in the screen shot belowhttps://alteraforum.com/forum/attachment.php?attachmentid=14115&stc=1
0 Kudos
Altera_Forum
Honored Contributor II
1,431 Views

it seems you have problem related to cygwin. Delete the files and try to generate the qsys component again. While generating there will be a listing in the pop up window which appears while you generate the program. In the list locate is there any error related to cygwin. If it is there then you need to update your cygwin.

0 Kudos
Altera_Forum
Honored Contributor II
1,431 Views

 

--- Quote Start ---  

it seems you have problem related to cygwin. Delete the files and try to generate the qsys component again. While generating there will be a listing in the pop up window which appears while you generate the program. In the list locate is there any error related to cygwin. If it is there then you need to update your cygwin. 

--- Quote End ---  

 

I remove the file and regenerate the HDL but nothing related to cygwin is mentionned in the popup messages. 

I don't khnow what i have to do in my case :confused:
0 Kudos
Altera_Forum
Honored Contributor II
1,431 Views

hi,  

i programmer the DE4 with the IP core created by qsys tool then i used the template hello world to test the nios communication, i build with succes the project but  

while runing the program as nios hardware i get this error  

can any one help me to found a solution. thx
0 Kudos
Reply