News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

Using SD Card in Linux (TE0715-30/TE0703)

Started by mostafa.sakr, February 17, 2016, 10:05:18 PM

Previous topic - Next topic

mostafa.sakr

Hi,

I have a problem with mounting the SD card within Petalinux.
I have formatted the SD card according to the instructions in xilinx wiki:
http://www.wiki.xilinx.com/Prepare+Boot+Medium
In this case I have two partitions on the sd card, one for booting and a 2nd ext4 partition.

I successfully booted linux from the SD card, using the pre-built binary in the plnx-2015-2 reference project.
However, I cannot mount the 2nd partition of the sd card.

The sd card is not present under /dev
I also tried to define the sdX node using:

mknod /dev/sda b 8 0
mknod /dev/sda1 b 8 1
mknod /dev/sda2 b 8 2


But, still I can't mount the sd card into the file system!!!

mount /dev/sda2 ./sdcard
mount: mounting /dev/sda2 on ./sdcard failed: No such device or address


Have I missed anything?

Thanks,
Mostafa Sakr

Oleksandr Kiyenko

Hello Mr. Sakr

On petalinux SD card is /dev/mmcblk devices
so in your case it should be like

mount /dev/mmcblk0p2 ./sdcard

Best regards
Oleksandr Kiyenko

mostafa.sakr

Hi,

Thank for your reply Oleksandr.
I should have mentioned that both sdX and mmcblkX doesn't appear in my /dev directory.

I tried creating the nodes myself, and mount the mmcblk0p2 partition, but I still get the same result:

mknod /dev/mmcblk0 b 179 0
mknod /dev/mmcblk0p1 b 179 1
mknod /dev/mmcblk0p2 b 179 2

mount /dev/mmcblk0p2 ./sd/
mount: mounting /dev/mmcblk0p2 on sd/ failed: No such device or address


I checked the partitions definitions, and here's the result:

root@TE0715-15:~# cat /proc/partitions
major minor  #blocks  name

  31        0       5120 mtdblock0
  31        1        128 mtdblock1
  31        2      10752 mtdblock2
  31        3      16768 mtdblock3


It seems to me that linux can't detect the SD card altogether, I tried removing and inserting the SD card, and I checked system messages, and there was no change.

Here is the boot messages:


TE0715 Unique MAC Addr: FA 00 00 00 D8 1F


U-Boot 2014.07 (Jan 23 2015 - 20:57:00)

I2C:   ready
DRAM:  ECC disabled 1 GiB
MMC:   zynq_sdhci: 0
SF: Detected S25FL256S_64K with page size 256 Bytes, erase size 64 KiB, total 32 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   Gem.e000b000
U-BOOT for TE0715-15

Gem.e000b000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Gem.e000b000: No link.
Hit any key to stop autoboot:  0
Device: zynq_sdhci
Manufacturer ID: 3
OEM: 5344
Name: SU16G
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.8 GiB
Bus Width: 4-bit
reading image.ub
7509368 bytes read in 465 ms (15.4 MiB/s)
## Loading kernel from FIT Image at 01000000 ...
   Using 'conf@1' configuration
   Trying 'kernel@1' kernel subimage
     Description:  PetaLinux Kernel
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x010000f0
     Data Size:    7494247 Bytes = 7.1 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x00008000
     Entry Point:  0x00008000
     Hash algo:    crc32
     Hash value:   96b8566f
   Verifying Hash Integrity ... crc32+ OK
## Loading fdt from FIT Image at 01000000 ...
   Using 'conf@1' configuration
   Trying 'fdt@1' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x01725c3c
     Data Size:    13823 Bytes = 13.5 KiB
     Architecture: ARM
     Hash algo:    crc32
     Hash value:   91fd95dd
   Verifying Hash Integrity ... crc32+ OK
   Booting using the fdt blob at 0x1725c3c
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 07ff9000, end 07fff5fe ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 3.17.0-xilinx (root@localhost) (gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-23) ) #5 SMP PREEMPT Fri Jan 23 20:57:39 CET 2015
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: TE0715-15
cma: Reserved 128 MiB at 38000000
Memory policy: Data cache writealloc
PERCPU: Embedded 8 pages/cpu @7779c000 s8704 r8192 d15872 u32768
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
Kernel command line: console=ttyPS0,115200 earlyprintk
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 897552K/1048576K available (4206K kernel code, 217K rwdata, 1404K rodata, 4496K init, 207K bss, 151024K reserved, 0K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xffe00000   (2048 kB)
    vmalloc : 0x80800000 - 0xff000000   (2024 MB)
    lowmem  : 0x40000000 - 0x80000000   (1024 MB)
    pkmap   : 0x3fe00000 - 0x40000000   (   2 MB)
    modules : 0x3f000000 - 0x3fe00000   (  14 MB)
      .text : 0x40008000 - 0x40582aa4   (5611 kB)
      .init : 0x40583000 - 0x409e7200   (4497 kB)
      .data : 0x409e8000 - 0x40a1e7e0   ( 218 kB)
       .bss : 0x40a1e7e0 - 0x40a5262c   ( 208 kB)
Preemptible hierarchical RCU implementation.
        Dump stacks of tasks blocking RCU-preempt GP.
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
L2C: platform provided aux values match the hardware, so have no effect.  Please remove them.
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76360001
slcr mapped to 80804000
zynq_clock_init: clkc starts at 80804100
Zynq clock init
sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 3298534883328ns
timer #0 at 80806000, irq=43
Console: colour dummy device 80x30
Calibrating delay loop... 1332.01 BogoMIPS (lpj=6660096)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x3f9e20 - 0x3f9e78
CPU1: Booted secondary processor
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated.
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
regulator-dummy: no parameters
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0x80880000
VCCPINT: 1000 mV
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0.0
Switched to clocksource arm_global_timer
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP: reno registered
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
msgmni has been set to 2009
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-2364208
dma-pl330 f8003000.dmac:        DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
e0000000.serial: ttyPS0 at MMIO 0xe0000000 (irq = 59, base_baud = 6249999) is a xuartps
console [ttyPS0] enabled
xdevcfg f8007000.devcfg: ioremap 0xf8007000 to 8086a000
[drm] Initialized drm 1.1.0 20060810
brd: module loaded
loop: module loaded
m25p80 spi32766.0: s25fl256s1 (32768 Kbytes)
4 ofpart partitions found on MTD device spi32766.0
Creating 4 MTD partitions on "spi32766.0":
0x000000000000-0x000000500000 : "boot"
0x000000500000-0x000000520000 : "bootenv"
0x000000520000-0x000000fa0000 : "kernel"
0x000000fa0000-0x000002000000 : "spare"
CAN device driver interface
libphy: XEMACPS mii bus: probed
xemacps e000b000.ethernet: pdev->id -1, baseaddr 0xe000b000, irq 54
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
ULPI transceiver vendor/product ID 0x0424/0x0007
Found SMSC USB3320 ULPI transceiver.
ULPI integrity check: passed.
zynq-ehci zynq-ehci.0: Xilinx Zynq USB EHCI Host Controller
zynq-ehci zynq-ehci.0: new USB bus registered, assigned bus number 1
zynq-ehci zynq-ehci.0: irq 53, io mem 0x00000000
zynq-ehci zynq-ehci.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
usbcore: registered new interface driver usb-storage
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
cdns-i2c e0004000.i2c: 400 kHz mmio e0004000 irq 57
at24 1-0050: 128 byte 24c01 EEPROM, writable, 1 bytes/write
at24 1-0057: 128 byte 24c01 EEPROM, writable, 1 bytes/write
rtc-isl12022 1-006f: rtc core: registered rtc-isl12022 as rtc0
cdns-i2c e0005000.i2c: 100 kHz mmio e0005000 irq 80
cdns-wdt f8005000.watchdog: Xilinx Watchdog Timer at 80876000 with timeout 10s
zynq-edac f8006000.memory-controller: ecc not enabled
Xilinx Zynq CpuIdle Driver started
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
sdhci-arasan e0100000.sdhci: No vmmc regulator found
sdhci-arasan e0100000.sdhci: No vqmmc regulator found
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP: cubic registered
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20120528 t)
can: netlink gateway (rev 20130117) max_hops=1
Registering SWP/SWPB emulation handler
rtc-isl12022 1-006f: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
Freeing unused kernel memory: 4496K (40583000 - 409e7000)
INIT: version 2.88 booting
Creating /dev/flash/* device nodes
random: dd urandom read with 1 bits of entropy available
starting Busybox inet Daemon: inetd... done.
Starting uWeb server:
NET: Registered protocol family 10
update-rc.d: /etc/init.d/run-postinsts exists during rc.d purge (continuing)
Removing any system startup links for run-postinsts ...
INIT: Entering runlevel: 5sts
Configuring network interfaces... udhcpc (v1.22.1) started
Sending discover...
Sending discover...
Sending discover...
No lease, forking to background
done.

Built with PetaLinux v2014.4 (Yocto 1.7) TE0715-15 /dev/ttyPS0
TE0715-15 login:


Thanks,
Mostafa Sakr

Oleksandr Kiyenko

Hi,

Usually you don't have to create nodes manually, petalinux should already detect partitions.
For example default configuration for TE0720 looks like

root@linux:~# ls /dev/mmcblk*
/dev/mmcblk0       /dev/mmcblk1       /dev/mmcblk1boot1  /dev/mmcblk1rpmb
/dev/mmcblk0p1     /dev/mmcblk1boot0  /dev/mmcblk1p1
root@linux:~# mount
rootfs on / type rootfs (rw,size=116132k,nr_inodes=29033)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=64k,nr_inodes=29033,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /var/volatile type tmpfs (rw,relatime)
root@linux:~# mount -t vfat /dev/mmcblk0p1 /media/
root@linux:~# mount
rootfs on / type rootfs (rw,size=116132k,nr_inodes=29033)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=64k,nr_inodes=29033,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /var/volatile type tmpfs (rw,relatime)
/dev/mmcblk0p1 on /media type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)


Best regards
Olksandr Kiyenko

Antti Lukats

if you use the most standard Xilinx flow, then SD card works on TE0715
1 vivado export hdf
2 petalinux import hdf
3 petalinux build

root@TE0715:/home# mkdir sdcard
root@TE0715:/home# mount /dev/mmcblk0 ./sdcard
FAT-fs (mmcblk0): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
root@TE0715:/home# ls
root    sdcard
root@TE0715:/home# cd sdcard
root@TE0715:/home/sdcard# ls
BOOT.BIN  image.ub
root@TE0715:/home/sdcard


the above is from 2105.4 flow, no special things done simply the most standard not changed xilinx development flow.

2015.4 reference design files and prebuilt images will be available today