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++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

SD card - DE2

Altera_Forum
Honored Contributor II
1,631 Views

Hi, 

Sorry for my english, I'm Brazilian. 

I have a Altera DE2 kit and I want to use SD Card on uCLinux. 

I have to make the same steps used for Compat Flash ?  

 

http://nioswiki.jot.com/wikihome/operating...ms/compactflash (http://nioswiki.jot.com/wikihome/operatingsystems/compactflash

 

 

Thanks.
0 Kudos
12 Replies
Altera_Forum
Honored Contributor II
930 Views

I am having some problems accessing the site referenced in that post. Where can I find the README file that has all the installation instructions? 

 

I beleive that is what the initial poster is looking for too. 

 

To quote the original post on MMC SPI driver: 

 

" have completed an initial revision of the MMC SPI driver, it can be checked out/dl'ed from: 

 

http://via.dynalias.org/svn/uclinux/patche..._mmc/tags/0.1.1 (http://via.dynalias.org/svn/uclinux/patche..._mmc/tags/0.1.1

 

This the latest stable release, and the latest is always in trunk/. 

 

Read the README file for installation instructions."
0 Kudos
Altera_Forum
Honored Contributor II
930 Views

Thank you very much. I've been looking for that for some time now.

0 Kudos
Altera_Forum
Honored Contributor II
930 Views

 

--- Quote Start ---  

originally posted by hippo@Jul 26 2006, 11:31 PM 

see, 

http://nioswiki.jot.com/wikihome/operating...%b5clinux/mmcsd (http://nioswiki.jot.com/wikihome/operatingsystems/%c2%b5clinux/mmcsd

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

--- quote end ---  

 

--- Quote End ---  

 

 

 

Thanks for everyone. 

I&#39;m now trying use Jdhar&#39;s MMC SPI Driver , but I think that it is possible to use a SD card without uCLinux with some implementation of a FS. 

 

I&#39;m trying these approaches . 

 

Sorry again for my english.
0 Kudos
Altera_Forum
Honored Contributor II
930 Views

Thanks Very Much! I really appreciate it!

0 Kudos
Altera_Forum
Honored Contributor II
930 Views

Ok. I have read the README file. Make a SOPC NIOS configuration with the SD card hardware in it. Compiled the kernel with the driver in it and the device comes up, however how do I use the device. Cat /proc/devices and I get 2 mmc devices with a major number of 254. I created mmc and mmc0 (minor numbers 0 and 1) in the /dev directory however I cannot mount the SD card as it says the device does not exist. What am I doing wrong? Thanks in advance.

0 Kudos
Altera_Forum
Honored Contributor II
930 Views

Ok a little more info on progress (at least there is some). 

 

Found that the driver has a hard time telling that we have an SD card and not a MMC card. I commented out the if(mmc_card_sd(card)) line in mmc.c file. Now we get an unknown partition table. Also we cannot have the card inserted when the processor starts up. Also inserting a card will produce spurious results. Sometimes it gives me a command line some times it refuses to give me a command line back... 

 

My hardware counterpart thinks it might be a clocking issue. Anyone have any clues. 

 

Thanks for your time.
0 Kudos
Altera_Forum
Honored Contributor II
930 Views

Sorry for being away for a while guys... I have been extremely busy with contracting work, so I have been away from the linux scene for a while. 

 

First off, that MMC driver I put out is definitely not complete... I tested it with MMC cards, so I&#39;m not sure how it works using SD cards. And hippo, please use the updated link for the SVN server, the dynalias one has been out for a long time. 

 

http://via.fps-tech.org/svn/ (http://via.fps-tech.org/svn/

 

Also, I stopped creating patch files for the MMC driver since most ppl weren&#39;t using them. Most ppl just wanted the whole kernel tree with the driver included, so you are better off grabbing the whole kernel source from: 

 

http://via.fps-tech.org/snapshots/uclinux/kernel/ (http://via.fps-tech.org/snapshots/uclinux/kernel/)
0 Kudos
Altera_Forum
Honored Contributor II
930 Views

 

--- Quote Start ---  

originally posted by jdhar@Jul 31 2006, 06:37 PM 

sorry for being away for a while guys... i have been extremely busy with contracting work, so i have been away from the linux scene for a while. 

 

first off, that mmc driver i put out is definitely not complete... i tested it with mmc cards, so i&#39;m not sure how it works using sd cards. and hippo, please use the updated link for the svn server, the dynalias one has been out for a long time. 

 

http://via.fps-tech.org/svn/ (http://via.fps-tech.org/svn/

 

also, i stopped creating patch files for the mmc driver since most ppl weren&#39;t using them. most ppl just wanted the whole kernel tree with the driver included, so you are better off grabbing the whole kernel source from: 

 

http://via.fps-tech.org/snapshots/uclinux/kernel/ (http://via.fps-tech.org/snapshots/uclinux/kernel/

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

--- quote end ---  

 

--- Quote End ---  

 

 

hello, i need to use this sd support and neither way works: patch (you said to be broken) and downloading this already patched kernel  

 

if you can point out where to read so i can go through this goal http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif  

 

i have a DE2 board, and need to use SD card. i work with isaac and i&#7743; in charge to make a uClinux ffrom scratch to work on it. up to now, just a generic build works and the result cant boot properly http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif it says cant find root. 

 

thanks in advance http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/wink.gif  

 

matheus
0 Kudos
Altera_Forum
Honored Contributor II
930 Views

You can go on the NIOS Wiki and download the patches. They work... as far as getting SD card drivers into the LINUX kernel... however... 

 

I didn&#39;t try them with an MMC card. I tried them with several SD cards. 

 

1) You have to edit the driver in the nios_mmc.c file in the linux-2.6.x/drivers/mmc directory and edit the function mmc_cmd() and change the# if 0 to# if 1... in order to enable the flush of the SPI bus (? is that what it does... I am not sure). If you don&#39;t do this then your SD cards will not work. 

 

2) Currently as I understand it the drivers are not finished so there is no mounting to be had because there are some unsupported commands that are needed such as Set Block Size and Single Read (at least as far as SD cards are concerned) ... there are some unsupported MMC commands but I wasn&#39;t concerned with those. You will have to use direct disk access ... in other words no file systems without some tricks that I don&#39;t have in my hat. For instance you can use the linux command dd to transfer data to and from the card in RAW format. This is what I used for performance testing. 

 

3) Reading and Writing SD cards is turtle slow right now. It needs some DMA help and higher clock rates... etc... 

 

Don&#39;t get me wrong... I really really appreciate and am very thankfull for all the work that Jdhar has put into them... I just have to alter my project because of time constraints and will be revisiting the SD stuff on the next iteration of the project when I have more time. 

 

At that time I hope to contribute to the SD drivers and such. Right now however the serial ports are too slow too and I need those more than I need SD cards. 

 

If this doesn&#39;t help let me know and I will try to get you the files I used for SD card support somehow.
0 Kudos
Altera_Forum
Honored Contributor II
930 Views

cfavreau, may i ask the status of ur effort in getting sd card into uclinux on de2? i am working on my grad project and i wish to use this feature. 

 

thx.
0 Kudos
Reply