Forum Discussion
mounting SD Card on uClinux
Hi everyone,
I'm trying to implement a fat file system on sd card I followed the instructions for Altera SPI Core on this page http://www.nioswiki.com/operatingsystems/uclinux/mmcsd didn't work... was I suppose to use SPI (3 wire) IP? thanks, Asaf37 Replies
- Altera_Forum
Honored Contributor
Could give me you *.config of uclinux and your quartus project?
thx for u help! MSN: [email protected] - Altera_Forum
Honored Contributor
Do you use a NEEK board ?
I loaded the Quartus Design from the appropriate NiosWiki page. Which .config file are you talking about. There are many of them. -Michael - Altera_Forum
Honored Contributor
I use altera DE1 board,and use spi(three wire) IP ,and do you have *.config of kernel ,for sd card.
- Altera_Forum
Honored Contributor
--- Quote Start --- ok, now it's officialy closed! I just needed to format my sd card using mkfs.vfat command or through windows :S anyway, thanks for all your help and support! :D --- Quote End --- Don't close yet, I have a question on mouting the SD card too. I am sorry that I use ColdFire but seems people here are familiar with uClinux. I can't even see anything that the system is probing the sd card. I use QSPI from the coldfire and I choosed the MMC/SD/SDIO and used the MMC over spi. I can see the block devices in dev, but can't mount them with "mounting /dev/mmcblk0p1 on /mnt/sd failed: no such device or address" message. Whatelse do you need for the os to probe sd card on spi when boot? Some one mentioned modprobe, how to configure that into uClinux? It seems that I need to change some source files in C to let the kernel probe the SD card using spi, right? Thanks! - Altera_Forum
Honored Contributor
--- Quote Start --- ok, here's an update it appears that there's a BIG difference between [*] and <M> (my bad;) ) so the good news are that it worked only when I selected my options as [*] the bad new are... well... when I use
I get Invalid argument error any ideas? --- Quote End --- Hi, I have the same situation where if i set the driver for "MMC/SD card support" as a module "[M]" the mounts do not work but if i just enable it as [*] it does. I need this feature to be a module so i would appreciate if anybody could point me in the right direction to solve this. I played with the settings of "Enable loadable module support" but so far no luck. I am using "FPS-Tech SD Host" and i set the following: Device Drivers --> (if i make these settings [*] it works...) [M] MMC/SD card support ---> [M] MMC block device driver [ ] Use bounce buffer for simple hosts [ ] SDIO UART/GPS class support [ ] MMC host test driver *** MMC/SD Host Controller Drivers *** [M] NIOS SD/SDIO/MMC Host File systems ---> [*] Ext3 journalling file system support DOS/FAT/NT Filesystems ---> [*] VFAT (Windows-95) fs support (437) Default codepage for FAT (iso8859-1) Default iocharset for FAT -*- Native language support ---> [*] Codepage 437 (United States, Canada) [*] NLS ISO 8859-1 (Latin 1; Western European Languages) Thanks in advance for your helpmount -t vfat /dev/mmcblk0 /mnt - Altera_Forum
Honored Contributor
I am having a similar problem using the SPI(3-wire) IP core and uClinux. I am using DE2-115 board and tried with 4 different cards (nothing changed), also same output when using no card at all. I am using "nios2"-branch (uClinux 3.7.0+), but have tried with "v3.3-nios2 -> v3.6-nios2" with same results.
My dts is configured as follows:mmc_spi spi32766.0: setup mode 0, 8 bits/w, 400000 Hz max --> 0 mmc0: req done (CMD58): 0: 00000000 00000000 00000000 00000000 mmc0: host doesn't support card's voltages mmc0: error -22 whilst initialising SD card
I have really checked all the wire connections multiple times. They are connected as follows:mmc_spi: spi <at> 0x10003420 { compatible = "ALTR,spi-12.0", "ALTR,spi-1.0"; reg = < 0x10003420 0x00000020 >; interrupt-parent = < &cpu >; interrupts = < 2 >; mmc-slot <at> 0 { compatible = "mmc-spi-slot"; reg = < 0x00000000 >; voltage-ranges = <3300 3300>; spi-max-frequency = <2000000>; }; };
Any hints or suggestions on what I am doing wrong is appreciated. Thank you.SD_DAT --> MISO SD_CMD <-- MOSI SD_CLK <-- SCLK SD_DAT <-- SS_N - Altera_Forum
Honored Contributor
--- Quote Start --- well, I'm still stuck I thought I'd see something like this on boot, as ashown in nioswiki so I thought of a few possible problems 1. pin assignments 2. IP core not configured as should 3. driver not loaded now I'm down to either it's an IP problem or driver problem so just to make sure again it is Altera's SPI (3 wire interface) IP, right? not someone else's similar IP? and if so could someone show me the right configuration? Thanks again, Asaf --- Quote End --- Hi, I am having the same issue and don't see this message which I am supposedly see when boot up. mmc_spi spi2.0: assuming spi bus stays unshared!mmc_spi spi2.0: assuming 3.2-3.4 v slot power
mmc_spi spi2.0: sd/mmc host mmc0, no dma, no wp, no poweroff
I follow exactly the recommended setting, but still don't see the message at the bootup Device Drivers ---> [*] SPI support ---> [*] Altera SPI Controller Device Drivers ---> [*] MMC/SD card support ---> [*] MMC/SD over SPI File systems ---> [*] Ext3 journalling file system support File systems ---> DOS/FAT/NT Filesystems ---> [*] VFAT (Windows-95) fs support File systems ---> -*- Native language support ---> [*] Codepage 437 (United States, Canada) File systems ---> -*- Native language support ---> [*] NLS ISO 8859-1 (Latin 1; Western European Languages) On the hdl side in quartus, the pin out as follow input wire SD_DAT, // sd.MISO output wire SD_CMD, // .MOSI output wire SD_CLK, // .SCLK output wire SD_DAT3, // .SS_n .... my_NIOS_mmc_spi mmc_spi ( .clk (mypll_c2_clk), // clk.clk .reset_n (~rst_controller_002_reset_out_reset), // reset.reset_n .data_from_cpu (mmc_spi_spi_control_port_translator_avalon_anti_slave_0_writedata), // spi_control_port.writedata .data_to_cpu (mmc_spi_spi_control_port_translator_avalon_anti_slave_0_readdata), // .readdata .mem_addr (mmc_spi_spi_control_port_translator_avalon_anti_slave_0_address), // .address .read_n (~mmc_spi_spi_control_port_translator_avalon_anti_slave_0_read), // .read_n .spi_select (mmc_spi_spi_control_port_translator_avalon_anti_slave_0_chipselect), // .chipselect .write_n (~mmc_spi_spi_control_port_translator_avalon_anti_slave_0_write), // .write_n .irq (irq_synchronizer_005_receiver_irq), // irq.irq .MISO_to_the_mmc_spi (SD_DAT), // external.export .MOSI_from_the_mmc_spi (SD_CMD), // .export .SCLK_from_the_mmc_spi (SD_CLK), // .export .SS_n_from_the_mmc_spi (SD_DAT3) // .export ); Please help! I greatly appreciated if anyone can point me to the right direction??
- Altera_Forum
Honored Contributor
Just checked my PinPlanner, these are my settings for a DE2-115 board. Maybe it'll help if you also use DE2-115.
SD_CLK - PIN_AE13 SD_CMD - PIN_AD14 SD_DAT0 - PIN_AE14 (not SD_DAT[0] for some reason...) SD_DAT3 - PIN_AC14 (no SD_DAT[3] for some reason...) - Altera_Forum
Honored Contributor
Hi, I am using the DE2-115 with uclinux v3.7 and our pin out are the same as you had stated.
SCLK -> SD_CLK -> PIN_AE13 (Clk) MOSI -> SD_CMD -> PIN_AD14 (Data Input) MISO -> SD_DAT -> PIN_AE14 (Data output) SS_N -> SD_DAT3 -> PIN_AC14 (Chip Selection) I still don't see the mmc_spi message on the bootup screen. I check the kernel setting many times and can't think of anything I did wrong?? Please help anyone! - Altera_Forum
Honored Contributor
Have you edited your dts file with mmc-spi-slot? See section 3.2 in my uClinux_nios2.pdf document.