Not able to boot via SD Card in my beaglebone black element14

2,950 views
Skip to first unread message

Madhukar Sah

unread,
Nov 25, 2015, 2:30:34 AM11/25/15
to BeagleBoard
I have beaglebone black element14 board. My board is booting perfectly fine from eMMC. I want to boot it via SD CARD  so downloaded the uboot fron denx site, compiled and generated the MLO and uboot image file.Followed the procedure of portioning the SD CARD into fat32 and ext4 and copied the the MLO and u-boot.img file using the cp command to the fat32 partition.

I followed the prescribed mechanism of pressing the S2 push button before applying the power(I am only using USB for purpose of power and no external power). But after connecting the USB , the boards power LED glows but nothing appears on the console. The console cable is working as when i was booting from eMMC, i used to get debug messages on the console.

I read somewhere that i need to change the MLO file name in the eMMC.I did and now it is neither booting from eMMC nor from the SD card.

Request help please.

I

Madhukar Sah

unread,
Nov 25, 2015, 2:44:26 AM11/25/15
to BeagleBoard
Forgot to say one thing. Doubting my MLO and uboot image file, i copied the MLO and u-boot.img file from the eMMC into my system and copied it to the SDCARD's FAT32 boot partition. I did not copy the uEnv.txt file as it is required by the u-boot.img only(i guess). But it still did not work. I was expecting that at least i will get some debug messages from the MLO but the debug console is completely empty.

Peter Wilson

unread,
Nov 25, 2015, 7:29:48 AM11/25/15
to Beagle Board
I find it curious the console is empty. In my experience, if the am335X ROM code can't find MLO, it fills the console with ''C''s every couple of hundred mS.

You can use RAW mode where the ROM code will search sector 0, 256, 512 or 768 for a valid signature. As your MBR goes in sector 0, what happens if you place MLO at sector 256:

dd if=MLO of=/dev/sdb bs=512 seek=256 count=256 conv=notrunc
blockdev --flushbufs /dev/sdb

U-Boot SPL should then try to load u-boot.img from your FAT32 partition.


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Madhukar Sah

unread,
Nov 25, 2015, 10:33:02 AM11/25/15
to beagl...@googlegroups.com
Mr. Peter ,

    I did what you asked. It did print "C" around 10 times. But it is printing it when i give power to the board and do not press any boot button and around 1 min or so it prints a sequence of "C".
   On the contrary when i press the boot button and wait nothing is printing.

    Shall i use an external power supply and check rather than relying on USB power(I am not a hardware guy). Do you think it might be the reason?

    I flashed the MLO image found in the eMMC chip (that i copied to my laptop before changing its name). Do you think that would have worked? If not can you send me the working MLO  and u-boot.img file so i can test with it.

You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/Qer9wwLySRI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

Robert Nelson

unread,
Nov 25, 2015, 10:37:13 AM11/25/15
to Beagle Board
On Wed, Nov 25, 2015 at 9:32 AM, Madhukar Sah <madhu...@gmail.com> wrote:
> Mr. Peter ,
>
> I did what you asked. It did print "C" around 10 times. But it is
> printing it when i give power to the board and do not press any boot button
> and around 1 min or so it prints a sequence of "C".
> On the contrary when i press the boot button and wait nothing is
> printing.

Compare what you did with:

https://eewiki.net/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-SetupmicroSDcard

>
> Shall i use an external power supply and check rather than relying on
> USB power(I am not a hardware guy). Do you think it might be the reason?
>
> I flashed the MLO image found in the eMMC chip (that i copied to my
> laptop before changing its name). Do you think that would have worked? If
> not can you send me the working MLO and u-boot.img file so i can test with
> it.

Current BBB production MLO/u-boot.img:

https://rcn-ee.com/repos/bootloader/am335x_evm/MLO-am335x_evm-v2015.10-r12
https://rcn-ee.com/repos/bootloader/am335x_evm/u-boot-am335x_evm-v2015.10-r12.img

Regards,

--
Robert Nelson
https://rcn-ee.com/

Madhukar Sah

unread,
Nov 26, 2015, 3:04:30 AM11/26/15
to beagl...@googlegroups.com
I downloaded the MLO and u-boot images from the above mentioned sites. But that did not work as well. Following is what i did step by step.

1. Renamed the MLO-am335x_evm-v2015.10-r12 to MLO
2. Renamed the u-boot-am335x_evm-v2015.10-r12.img to u-boot.img
3. Ran the following script( which i downloaded from one of the sites) to partition the SDCARD
-------------------------------------------------------------------------------------------------------------------------------------------------------
#!/bin/bash

#
#  Script for formatting SD Card for booting Linux.
#
#  Author: David Weber
#  Copyright (C) 2011 Avnet Electronics Marketing
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

function print_msg()
{
  echo ""
  echo "--------------------------------------------------------------------------------"
  echo " $1"
  echo "--------------------------------------------------------------------------------"
}

device=/dev/sdb;

# check command arguments
if [ "$#" -lt "1" ]; then
  echo "usage: sudo $0 <disk> [part1 size (MB)] [part2 size (MB)]"
  exit;
fi

if [ ! -b "${device}" ]; then
  print_msg "Error: device ${device} not found"
  exit
fi

# setup some constants
n_heads=255
n_sectors=63
sector_sz=512

# setup some defaults
part1_MB=120

if [ "$#" -gt "1" ]; then
  part1_MB=$2
fi

part1_n_cyl=`echo ${part1_MB}*1024*1024/${sector_sz}/${n_heads}/${n_sectors} | bc`
part2_n_cyl=

# if the second partition size is specified, calculate n cylinders for it
if [ "$#" -gt "2" ]; then
  part2_MB=$3
  part2_n_cyl=`echo ${part2_MB}*1024*1024/${sector_sz}/${n_heads}/${n_sectors} | bc`
fi

# setup partition types
dos=0x0C
linux=L

# assign partition types to each partition
part1_type=${dos}
part2_type=${linux}

# assign partition labels to each partition
part1_label=boot
part2_label=root

# unmount any existing device partitions
print_msg "Unmounting any mounted partitions on ${device}"
devlist=`df | grep ${device}`
if [ "$devlist" != "" ]; then
  df | grep ${device} | awk '{print $1}' | xargs umount
fi

mbr_sz=532
mbr_file=sd.mbr.dd

# see man page for sfdisk for more info
print_msg "Clearing MBR (first ${mbr_sz} bytes) of ${device}"
dd of=${device} if=/dev/zero bs=${mbr_sz} count=1

# create partition table
print_msg "Creating partition table on ${device}"

# look for the MBR saved from a previous execution of this script
if [ -f "${mbr_file}" ]; then
  dd of=${device} if=${mbr_file} bs=${mbr_sz} count=1
else
  fdisk ${device} > /dev/null << EOF
w
EOF
  # save off the MBR so we can avoid running fdisk next time this script runs, because
  # fdisk always produces a warning message
  dd of=${mbr_file} if=${device} bs=${mbr_sz} count=1
fi

# calculate number of cylinders on disk
device_sz=`blockdev --getsize64 ${device}`
n_cylinders=`echo ${device_sz}*1024/${n_heads}/${n_sectors}/${sector_sz} | bc`

# create the partitions on the disk
print_msg "Creating boot and root partitions on ${device}"
sfdisk -D -H ${n_heads} -S ${n_sectors} -C ${n_cylinders} ${device} << EOF
,${part1_n_cyl},${part1_type},*
,${part2_n_cyl},${part2_type},-
EOF

# insure that the kernel is aware of the new partitions
partprobe ${device}

# format the partitions
print_msg "Formatting (FAT32) boot partition ${device}1"
mkfs.vfat -F 32 -n "${part1_label}" ${device}1

print_msg "Formatting (EXT3) root partition ${device}2"
mkfs.ext3 -L "${part2_label}" ${device}2

# list the partitions to verify success
sfdisk -l  ${device}

---------------------------------------------------------------------------------------------------------------------------------------------------------------------

4. Pulled out the SD card USB adaptor and inserted it again.

5. Created the boot and root directories in /media

     #sudo mkdir /media/boot
     #sudo mkdir /media/root

6. Mounted the /dev/sdb1(the fat32 partition) and /dev/sdb2(the root partition)

    #sudo mount /dev/sdb1 /media/boot
    #sudo mount /dev/sdb2 /media/root

7. Copied the MLO and u-boot.img file to boot mount

    #sudo cp ./MLO /media/boot
    #sudo cp ./u-boot.img /media/boot

8. Unmounted the boot and root partitions

  #sudo umount /media/boot
  #sudo umount /media/root

9. Pulled out the usb adaptor from the PC
10. removed the sdcard from that and inserted in the beaglebone sdcard slot
11. Pressed the boot button and given power
12. NOTHING CAME ON THE CONSOLE
13. pulled out the power and given again without pressing the boot button, and after around 1 min got sequence of "C" on the console.

Please help

Regards,
Madhukar Sah

Robert Nelson

unread,
Nov 26, 2015, 8:51:24 AM11/26/15
to Beagle Board, madhu...@gmail.com
^ That was a bug in x-loader, around 2009, fixed a long time ago..
^ That's broken in sfdisk >= 2.26.x
I gave you a link for a reason:

https://eewiki.net/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-SetupmicroSDcard

Madhukar Sah

unread,
Nov 27, 2015, 8:40:52 AM11/27/15
to Robert Nelson, Beagle Board
I followed the above given site instructions but that failed as well.
Steps followed according to https://eewiki.net/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-SetupmicroSDcard
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1. Cross compiler set-up

  ~/prakash-bbb$ wget -c https://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz
  ~/prakash-bbb$ tar xf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz
  ~/prakash-bbb$ export CC=`pwd`/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-

  ~/prakash-bbb$ ${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
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

2. Bootloader

  ~/prakash-bbb$ git clone git://git.denx.de/u-boot.git
  ~/prakash-bbb$ cd u-boot/
  ~/prakash-bbb$ git checkout v2015.10 -b tmp

  ~/prakash-bbb$ wget -c https://rcn-ee.com/repos/git/u-boot-patches/v2015.10/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch

  ~/prakash-bbb$ patch -p1 < 0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch

  ~/prakash-bbb$ make ARCH=arm CROSS_COMPILE=${CC} distclean
  ~/prakash-bbb$ make ARCH=arm CROSS_COMPILE=${CC} am335x_evm_defconfig
  ~/prakash-bbb$ make ARCH=arm CROSS_COMPILE=${CC}

3. Linux Kernel

  ~/prakash-bbb$ git clone https://github.com/RobertCNelson/bb-kernel
  ~/prakash-bbb$ cd bb-kernel/
  ~/prakash-bbb$ ./build_kernel.sh
  -----------------------------
  Script Complete
  eewiki.net: [user@localhost:~$ export kernel_version=4.1.13-bone16]
  -----------------------------


4. Setup Micro SD card

 ~/prakash-bbb$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 298.1G  0 disk
├─sda1   8:1    0  30.2G  0 part
├─sda2   8:2    0     1K  0 part
├─sda5   8:5    0   7.5G  0 part [SWAP]
├─sda6   8:6    0 127.2G  0 part
├─sda7   8:7    0   7.5G  0 part [SWAP]
└─sda8   8:8    0 125.8G  0 part /
sdb      8:16   1   3.7G  0 disk
└─sdb1   8:17   1   3.7G  0 part

~/prakash-bbb$ export DISK=/dev/sdb

~/prakash-bbb$ sudo dd if=/dev/zero of=${DISK} bs=1M count=10
[sudo] password for utl:
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 2.97229 s, 3.5 MB/s

~/prakash-bbb$ sudo dd if=./u-boot/MLO of=${DISK} count=1 seek=1 bs=128k
0+1 records in
0+1 records out
65812 bytes (66 kB) copied, 0.0452465 s, 1.5 MB/s

~/prakash-bbb$ sudo dd if=./u-boot/u-boot.img of=${DISK} count=2 seek=1 bs=384k
0+1 records in
0+1 records out
318004 bytes (318 kB) copied, 0.0554741 s, 5.7 MB/s

~/prakash-bbb$ sudo sfdisk --version
sfdisk from util-linux 2.20.1

~/prakash-bbb$ sudo sfdisk --in-order --Linux --unit M ${DISK} <<-__EOF__
> 1,,L,*
> __EOF__

Checking that no-one is using this disk right now ...
OK

Disk /dev/sdb: 1017 cylinders, 124 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=*/43/12 (instead of 1017/124/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   3818   3818    3909632   83  Linux
        start: (c,h,s) expected (3,41,9) found (0,33,3)
        end: (c,h,s) expected (1023,42,12) found (1017,42,12)
/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).)

~/prakash-bbb$ sudo mkfs.ext4 ${DISK}1 -L rootfs

~/prakash-bbb$ sudo mkfs.ext4 ${DISK}1 -L rootfs
mke2fs 1.42 (29-Nov-2011)
Filesystem label=rootfs
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
244800 inodes, 977408 blocks
48870 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1002438656
30 block groups
32768 blocks per group, 32768 fragments per group
8160 inodes per group
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736

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

~/prakash-bbb$ sudo mkdir -p /media/rootfs/
~/prakash-bbb$ sudo mount ${DISK}1 /media/rootfs/

Backup-bootloader

~/prakash-bbb$ sudo mkdir -p /media/rootfs/opt/backup/uboot/

~/prakash-bbb$ sudo cp -v ./u-boot/MLO /media/rootfs/opt/backup/uboot/
`./u-boot/MLO' -> `/media/rootfs/opt/backup/uboot/MLO'

~/prakash-bbb$ sudo cp -v ./u-boot/u-boot.img /media/rootfs/opt/backup/uboot/
`./u-boot/u-boot.img' -> `/media/rootfs/opt/backup/uboot/u-boot.img'

Copy root file system :

~/prakash-bbb$ sudo tar xfvp ubuntu-14.04.3-minimal-armhf-2015-09-07/armhf-rootfs-ubuntu-trusty.tar -C /media/rootfs/

~/prakash-bbb$ export kernel_version=4.1.13-bone16

~/prakash-bbb$ sudo sh -c "echo 'uname_r=${kernel_version}' >> /media/rootfs/boot/uEnv.txt"

~/prakash-bbb$ sudo cp -v ./bb-kernel/deploy/${kernel_version}.zImage /media/rootfs/boot/vmlinuz-${kernel_version}
`./bb-kernel/deploy/4.1.13-bone16.zImage' -> `/media/rootfs/boot/vmlinuz-4.1.13-bone16'

~/prakash-bbb$ sudo mkdir -p /media/rootfs/boot/dtbs/${kernel_version}/

~/prakash-bbb$ sudo tar xfv ./bb-kernel/deploy/${kernel_version}-dtbs.tar.gz -C /media/rootfs/boot/dtbs/${kernel_version}/
./am335x-arduino-tre.dtb
./am335x-base0033.dtb
./am335x-bone-can0.dtb
./am335x-bone-cape-bone-argus.dtb
./am335x-bone.dtb
./am335x-boneblack-bbb-exp-c.dtb
./am335x-boneblack-bbb-exp-r.dtb
./am335x-boneblack-can0.dtb
./am335x-boneblack-cape-bone-argus.dtb
./am335x-boneblack-emmc-overlay.dtb
./am335x-boneblack-hdmi-overlay.dtb
./am335x-boneblack-nhdmi-overlay.dtb
./am335x-boneblack-overlay.dtb
./am335x-boneblack-replicape.dtb
./am335x-boneblack-wl1835mod.dtb
./am335x-boneblack.dtb
./am335x-bonegreen.dtb
./am335x-chiliboard.dtb
./am335x-evm.dtb
./am335x-evmsk.dtb
./am335x-lxm.dtb
./am335x-nano.dtb
./am335x-pepper.dtb


~/prakash-bbb$ sudo tar xfv ./bb-kernel/deploy/${kernel_version}-modules.tar.gz -C /media/rootfs/

~/prakash-bbb$ sudo sh -c "echo '/dev/mmcblk0p1  /  auto  errors=remount-ro  0  1' >> /media/rootfs/etc/fstab"

~/prakash-bbb$ sudo nano /media/rootfs/etc/network/interfaces

~/prakash-bbb$ sudo nano /media/rootfs/etc/init/serial.conf

~/prakash-bbb$ sync

~/prakash-bbb$ sudo umount /media/rootfs

-------------------------------------------------------------------------------------------------------------------------------------------------------------

Regards,
Madhukar Sah

Madhukar Sah

unread,
Nov 27, 2015, 8:46:21 AM11/27/15
to Robert Nelson, Beagle Board
I also did all the instruction give at http://www.armhf.com/boards/beaglebone-black/bbb-sd-install/ except i gave the boot partition type as 'c(W95 FAT32 (LBA)' rather than 'e(W95 FAT16 (LBA))'

That did not work as well.



Regards,
Madhukar Sah

Madhukar Sah

unread,
Nov 27, 2015, 8:48:28 AM11/27/15
to Robert Nelson, Beagle Board
I have beaglebone black element14 rev C.
Is there any problem in rev C related to booting from SDcard?

Madhukar Sah

unread,
Nov 30, 2015, 9:17:37 PM11/30/15
to BeagleBoard, robert...@gmail.com
Can  i conclude that my specific board has got some issue. Shall i proceed for replacement. Can i take it for my confirmation that the above detailed step by step procedure what i have described  would work on a working board.

Gerald Coley

unread,
Nov 30, 2015, 9:28:00 PM11/30/15
to beagl...@googlegroups.com, Robert Nelson
I suggest you contact Element 14 customer support for assistance with your board.

Gerald


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Madhukar Sah

unread,
Dec 1, 2015, 7:34:26 AM12/1/15
to BeagleBoard, robert...@gmail.com
Thank gerald. I will contact them.

Regards

darkus

unread,
Sep 28, 2016, 11:03:33 PM9/28/16
to BeagleBoard, robert...@gmail.com
Hello everyone,

I have two Beaglebone Black  with Rev B6 version from Element 14 and one has this issue. I wasted one week in this issue. Thanks for your post.

mst...@gmail.com

unread,
Jan 14, 2020, 10:32:49 AM1/14/20
to BeagleBoard
for every one has this problem:
you have to give a boot flag to your partition ,you can do this with fdisk command :

fdisk  /dev/sda
Command (m for help): m

Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): a
Partition number (1-5): 
Reply all
Reply to author
Forward
0 new messages