Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

How to install SD Card and ethernet at uClinux

I have just installed uCLinux at Altera DE2-115 (FPGA BOARD), I have full access to the terminal, the things that happen:I want to set an IP and also MASK for my eth0, when I do "ifconfig" it only shows me:

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

there is no eth0 or eth1, and there are two ethernet ports, the eth0 have a ethernet cable plugged in (fully working with internet and lan network).why there are no eth0 or eth1?

also: when I want to mount my SD-card Drive I do the following:

mkdir /mnt/sd
mount /dev/mmcblk0p1 /mnt/sd

and I get:

mount: mounting /dev/mmcblk0p1 on /mnt/sd failed: No such device or address

as if there was no SD Card device... in my dev folder there are the followings:

mmc0
mmcblk0
mmcblk0p1
mmcblk0p2
mmcblk0p3

and I have tried mounting with every single one of them, also the SD Card Drive supports FAT16 and that is the file system Iam using at the moment on my SD Card.

What can I do to be able to access the ethernet "eth0" and/or "eth1", and SD Card?

5 Replies

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

    For ethernet, run "ifconfig -a" to see the other adapters you are looking for "eth0 and eth1". If you do not see them, you have to enable ethernet in "make menuconfig" option. If you do see them there, just configure them using something like "ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up" etcetera. You can find lots of info on this. You will also need to settup a default gateway and such.

    For SD Card, similar story. Go on "make menuconfig" and ensure that you have enabled MMC/SD support but do NOT set it as a module "[M]". i am having a particular problem where if i enable the mmc/sd card support as a module it does not work but if i just set it directly with [*] then it works.... does anybody reading this know why this is?

    By the way, you can automate the way SD card gets mounted by creating and editing "fstab" file, inserting this "fstab" file in your ROMFS by modifying the Makefile inside ..Altera/nios2/, and editing your RC script to run the modules and such.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The Problem Persists, also it has made it worse, after I remade the zImage I can't get nios2-terminal poped up once again, it gets stuck at this:

    nios2-terminal: connected to hardware target using JTAG UART on cable

    nios2-terminal: "USB-Blaster [5-1]", device 1, instance 0

    nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate)
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Okay, I solved to problem that makes me stuck.

    But still I can't mount my SD Card, I gave up on ethernet, I only want SD Card now.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi, I am trying to get the SD Card mount and have my mmc/spi [*], but I am not seeing the follow boot up message

    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

    My next question would be on my pin mapping. Is this pin map correct for the spi 3 wire??

    SD_DAT[0] --> MISO

    SD_CMD <-- MOSI

    SD_CLK <-- SCLK

    SD_DAT[3] <-- SS_N

    I tried to mount it with no luck

    /> mount -t vfat /dev/mmcblk0p1 /mnt

    mount: mounting /dev/mmcblk0p1 on /mnt failed: No such device or address

    I read post to add the follow lines into the top level design. I tried to add them but compiled with errors, so I am not sure what I have to do, and if anyone know, please kindly let me know.

    .MISO_to_the_mmc_spi (SD_DAT),

    .MOSI_from_the_mmc_spi (SD_CMD),

    .SCLK_from_the_mmc_spi (SD_CLK),

    .SS_n_from_the_mmc_spi (SD_DAT3)

    Thanks in advance for any help I get from anyone.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Can someone please help me? I still unable to get the SD card mount and I still don't see the mmc_spi spi2.0 message when boot up.