Beagle bone black Booting from sd card :- spl: wrong MMC boot mode error


I am following below link
According to this link i am trying to boot beagle bone black through sd card.

I followed below steps:

ARM Cross Compiler: GCCMy Host details are

Linux rahul-desktop 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:44 UTC 2014 i686 i686 i686 GNU/Linux (Ubuntu 14.04 32 bit)

sudo apt-get update
sudo apt-get install libc6:i386 libstdc++6:i386 libncurses5:i386 zlib1g:i386


wget -c https:``//
tar xf gcc-linaro-arm-linux-gnueabihf-``4.9``-``2014``.09_linux.tar.xz
export CC=pwd/gcc-linaro-arm-linux-gnueabihf-``4.9``-``2014``.09_linux/bin/arm-linux-gnueabihf-``${CC}gcc --version
arm-linux-gnueabihf-gcc (crosstool-NG linaro-``1.13``.``1``-``4.9``-``2014.09 - Linaro GCC ``4.9``-``2014.09``) ``4.9``.``2 20140904 (prerelease)
Copyright (C) ``2014 Free Software Foundation, Inc.
This is free software; see the source ``for copying conditions. There is NO

Bootloader: U-Boot

git clone git:``//

cd u-boot/

git checkout v2014.``10 -b tmp


wget -c https:``//

patch -p1 < ``0001``-am335x_evm-uEnv.txt-bootz-n-fixes.patch

make ARCH=arm CROSS_COMPILE=${CC} distclean
make ARCH=arm CROSS_COMPILE=${CC} am335x_evm_defconfig

Upgrade distro “device-tree-compiler” packagewget -c https:``//

chmod +x

Linux Kernel

git clone https:``//
cd bb-kernel/

Checkout v3.8.x branch:

git checkout origin/am33x-v3.``8 -b tmp


After this Building we got kernel build output like below
root@rahul-desktop:~/FRESH/bb-kernel/deploy# ls -al
total 18476
drwxr-xr-x 2 root root 4096 Dec 25 18:37 .
drwxr-xr-x 12 root root 4096 Dec 25 18:00 ..
-rw-r--r-- 1 root root 37305 Dec 25 18:37 3.8.13-bone68-dtbs.tar.gz
-rw-r--r-- 1 root root 1251691 Dec 25 18:37 3.8.13-bone68-firmware.tar.gz
-rw-r--r-- 1 root root 11994986 Dec 25 18:37 3.8.13-bone68-modules.tar.gz
-rwxr-xr-x 1 root root 5506968 Dec 25 18:37 3.8.13-bone68.zImage
-rw-r--r-- 1 root root 109287 Dec 25 18:37 config-3.8.13-bone68

Root File System

wget -c
md5sum debian-7.7-minimal-armhf-2014-11-10.tar.xz
sudo tar xfvp ./*-*-*-armhf-*/armhf-rootfs-*.tar -C /media/rootfs/

Setup microSD/SD card
root@rahul-desktop:~/FRESH$ export DISK=/dev/sdb
root@rahul-desktop:~/FRESH$ sudo dd if=/dev/zero of=${DISK} bs=1M count=10
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 1.88427 s, 5.6 MB/s
root@rahul-desktop:~/FRESH$ sudo dd if=./u-boot/MLO of=${DISK} count=1 seek=1 conv=notrunc bs=128k
0+1 records in
0+1 records out
73124 bytes (73 kB) copied, 0.0167826 s, 4.4 MB/s
root@rahul-desktop:~/FRESH$ sudo dd if=./u-boot/u-boot.img of=${DISK} count=2 seek=1 conv=notrunc bs=384k
1+1 records in
1+1 records out
393536 bytes (394 kB) copied, 0.0655608 s, 6.0 MB/s
root@rahul-desktop:~/FRESH$ sudo sfdisk --in-order --Linux --unit M ${DISK} <<-__EOF__
Checking that no-one is using this disk right now ...

Disk /dev/sdb: 1023 cylinders, 246 heads, 62 sectors/track

sfdisk: ERROR: sector 0 does not have an msdos signature
/dev/sdb: unrecognized partition table type
Old situation:
No partitions found
New situation:
Warning: The partition table looks like it was made
for C/H/S=*/48/50 (instead of 1023/246/62).
For this listing I'll assume that geometry.
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End MiB #blocks Id System
/dev/sdb1 * 1 7619 7619 7801856 83 Linux
start: (c,h,s) expected (0,40,49) found (0,33,3)
/dev/sdb2 0 - 0 0 0 Empty
/dev/sdb3 0 - 0 0 0 Empty
/dev/sdb4 0 - 0 0 0 Empty
Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
root@rahul-desktop:~/FRESH$ sudo mkfs.ext4 ${DISK}1 -L rootfs
mke2fs 1.42.9 (4-Feb-2014)
Filesystem label=rootfs
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
487680 inodes, 1950464 blocks
97523 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2000683008
60 block groups
32768 blocks per group, 32768 fragments per group
8128 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

root@rahul-desktop:~/FRESH$ sudo mkdir -p /media/rootfs/
root@rahul-desktop:~/FRESH$ sudo mount ${DISK}1 /media/rootfs/
root@rahul-desktop:~/FRESH$ export kernel_version=3.8.13-bone68
root@rahul-desktop:~/FRESH$ sudo tar xfvp ./*-*-*-armhf-*/armhf-rootfs-*.tar -C /media/rootfs/

root@rahul-desktop:~/FRESH$ sudo mkdir -p /media/rootfs/boot/
root@rahul-desktop:~/FRESH$ sudo sh -c "echo 'uname_r=${kernel_version}' > /media/rootfs/boot/uEnv.txt"
root@rahul-desktop:~/FRESH$ sudo sh -c "echo 'cmdline=quiet init=/lib/systemd/systemd' >> /media/rootfs/boot/uEnv.txt"
root@rahul-desktop:~/FRESH$ sudo cp -v ./bb-kernel/deploy/${kernel_version}.zImage /media/rootfs/boot/vmlinuz-${kernel_version}
‘./bb-kernel/deploy/3.8.13-bone68.zImage’ -> ‘/media/rootfs/boot/vmlinuz-3.8.13-bone68’
root@rahul-desktop:~/FRESH$ sudo mkdir -p /media/rootfs/boot/dtbs/${kernel_version}/
root@rahul-desktop:~/FRESH$ sudo tar xfv ./bb-kernel/deploy/${kernel_version}-dtbs.tar.gz -C /media/rootfs/boot/dtbs/${kernel_version}/

root@rahul-desktop:~/FRESH$ sudo sh -c "echo '/dev/mmcblk0p1 / auto errors=remount-ro 0 1' >> /media/rootfs/etc/fstab"
root@rahul-desktop:~/FRESH$ sudo vim /media/rootfs/etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
root@rahul-desktop:~/FRESH$ sudo vim /media/rootfs/etc/udev/rules.d/70-persistent-net.rules
# BeagleBone: net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

root@rahul-desktop:~/FRESH$ sudo vim /media/rootfs/etc/udev/rules.d/70-persistent-net.rules
root@rahul-desktop:~/FRESH$ sudo sh -c "echo 'T0:23:respawn:/sbin/getty -L ttyO0 115200 vt102' >> /media/rootfs/etc/inittab"
root@rahul-desktop:~/FRESH$ sync
root@rahul-desktop:~/FRESH$ sudo umount /media/rootfs

We removed Sd card and put into beagle bone black press boot button and apply power and we got error message
U-Boot SPL 2015.01-rc3-00163-gd8bec60-dirty (Dec 25 2014 - 17:21:47)
spl: wrong MMC boot mode
### ERROR ### Please RESET the board ###

Okay, look at this again and "I" think you'll see your mistake:

Directions: U-boot:

"git checkout v2014.10 -b tmp"

Output over serial from U-boot:

"U-Boot SPL 2015.01-rc3-00163-gd8bec60-dirty (Dec 25 2014 - 17:21:47)"

I'll give you one quick "guess" which step you skipped..

(and the reason you get that error with 2015.01-rc3-git is a
regression/patch that hasn't hit master git yet..)



Thanks for giving reply,Can you tell me i unable to compile dts file its gives output:
dtc command not found.

Thanks & Regards,
Rahul Mahajan


now i unable to compile dts file
dtc -I dtb -O dts -o BB-SPIDEV1-00A0.dts BB-SPIDEV1-00A0
DTC: dtb->dts on file “BB-SPIDEV1-00A0.dtbo”

dtc -I dtb -O dts -o BB-SPIDEV1-00A0.dtbo BB-SPIDEV1-00A
DTC: dtb->dts on file “BB-SPIDEV1-00A0.dts”
FATAL ERROR: Blob has incorrect magic number

I able to boot with sd card proplerly but when i insterd sd card and reboot the device .

then its give the below error :-
U-Boot 2015.01-rc3-00163-gd8bec60-dirty (Dec 25 2014 - 17:21:47)

Watchdog enabled
I2C: ready
DRAM: 512 MiB
Using default environment

Net: not set. Validating first E-fuse MAC
cpsw, usb_ether
Hit any key to stop autoboot: 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt …
Checking for: /boot.scr …
Checking for: /boot/boot.scr …
Checking for: /boot/uEnv.txt …
** Invalid partition 2 **
** Invalid partition 3 **
** Invalid partition 4 **
** Invalid partition 5 **
** Invalid partition 6 **
** Invalid partition 7 **
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
switch to partitions #0, OK
mmc1(part 0) is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt …
reading uEnv.txt
1263 bytes read in 6 ms (205.1 KiB/s)
gpio: pin 55 (gpio 55) value is 1
Loaded environment from uEnv.txt
Importing environment from mmc …
Checking if uenvcmd is set …
gpio: pin 56 (gpio 56) value is 1
Running uenvcmd …
** Invalid partition 7 **
** Invalid partition 7 **
** Invalid partition 7 **
Bad Linux ARM zImage magic!
Checking if client_ip is set …
Checking for: /boot.scr …
Checking for: /boot/boot.scr …
Checking for: /boot/uEnv.txt …
** Invalid partition 3 **
** Invalid partition 4 **
** Invalid partition 5 **
** Invalid partition 6 **
** Invalid partition 7 **

Error: “nandboot” not defined


Hi ,

My DTC version
dtc -v
Version: DTC 1.3.0

please tell me how to solve this problems there are so many confusing about DTS

how to compie dts file and how to retried DTS file from DTBO file.

please let me known

thanks & regards,
rahul mahajan