Home | Projects | Notes > Linux Device Drivers > Booting from µSD Card

Booting from µSD Card

 

Introduction

Boot Sequence of BeagleBone Black Board

Usage of Power Button, Reset Button and Boot Button

 

µSD Card Preparation

  1. 8+ GB µSD card can be used

  2. Connect the µSD card to PC using card reader

    • Use dmesg or lsblk command to check if your system recognizes the device (e.g., sda)

  3. Launch the GParted application

  4. Create 2 partitions (FAT16 and EXT4)

    • Partition 1 - BOOT / FAT16 / Stores boot images (e.g., MLO, U-boot, kernel image) / 512MB

    • Partition 2 - ROOTFS / EXT4 / Stores Debian root filesystem / Rest of the µSD card

    [!] Note: Make sure to click "Apply" button (green check) after creating partitions.

  5. Configure the flags of BOOT partition; lba, boot

     

    micro-sd-card-partitions

     

    Once you close GParted app, you'll see the newly created partitions appear on your system.

  6. Copy boot images on FAT16 partition (BOOT partition)

    am335x-boneblack.dtb - Device tree binary of BBB

    MLO - Primary boot loader (Memory LOader)

    u-boot - U-boot bootloader image

    uEnv.txt - U-boot commands and environment settings

    uImage - Kernel image

    To flush left-over contents in the buffer to the media

  7. Copy Debian root filesystem on EXT4 partition (ROOTFS partition)

    • Decompress the downloaded Debian image:

    • Right-click the .img file Open With Disk Image Mounter. This will mount the image to the filesystem.

      Check the mount status by running:

       

      mounted-rootfs

       

    • Copy the contents of mounted rootfs/ into /media/klee/ROOTFS.

      To flush left-over contents in the buffer to the media

  8. Unmount and remove the µSD card from PC

  9. Power down the board, insert the µSD card into BBB µSD card slot

  10. Boot from µSD card (MMC0 interface)

 

Booting from µSD Card Interface (MMC0)

  1. Make sure that BBB board is NOT powered up

  2. Connect BBB board and host using serial debug cable

    • Check if connection has been successfully established by running dmesg.

       

      sub-to-ttl-cable-dmesg

      This means that the host will serial communicate with the target board over the device file ttyUSB0.

    • Run minicom:

      Run minicom -s to configure the environment such as selecting the serial device (e.g., /dev/ttyUSB0).

      ctrl + a, x to exit.

  3. Insert the SD card to BBB board

  4. Power up the board using mini USB cable

  5. Press and hold the boot button (S2)

  6. Press and hold the power button (S3) until the blue LED turns off and turns back on. (If the blue LED doesn't turn back on, gently press the power button.)

  7. Release the S2 button after 2 to 5 seconds.

Check if the board is successfully booting from µSD card.

Pro Tip!