Forum Discussion

12 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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'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'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't concerned with those. You will have to use direct disk access ... in other words no file systems without some tricks that I don'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'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't help let me know and I will try to get you the files I used for SD card support somehow.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.