Skip to content

Flashing SD card for BeagleBone

jjtom34 edited this page Apr 3, 2022 · 12 revisions

Flashing the SD Card for a BeagleBone

This guide will take you through the steps required to flash the Debian OS onto a micro SD card for use within a BeagleBone

Table of Contents

  1. Required Materials
  2. Walkthrough

Required Materials

Hardware Required

  1. SD card (make sure there is nothing important on it before flashing)
  2. Computer with a SD card slot or a dongle with and SD card slot
  3. BeagleBone
  4. MicroUSB type B cable

Software Required

  1. Etcher
  2. SSH client
    • PuTTy is a great client for windows if you don't want to use WSL
    • WSL has an SSH client built in so you can just use that
    • If you are running Linux or macOS the terminal within those also has a SSH client built in

Walkthrough

  1. Download the Debian image with this link

  2. Connect the SD card to your computer

  3. Open up Etcher and flash the Debian image to the SD card

    1. Click on where it says "Flash from file", then navigate to your downloads folder and select the debian image you just downloaded
    2. From there it should auto fill the target as the SD card, however you should double check to make sure you are flashing to the SD card in the middle target section
    3. Just click "Flash!" and let it do its thing, this should take a couple of minutes
  4. Eject the SD card from your computer and insert it to the BeagleBone

  5. Plug in the BeagleBone to your computer and wait for it to boot up

    BealgeBone LEDS

    1. The USR0 LED is called the "heartbeat LED", so look for this LED to be beating at a steady pace to know when the BeagleBone is fully booted up
  6. Ensure you are connected to the BeagleBone using your SSH client of choice

    1. IP should be 192.168.7.1, user should be debian, and password should be temppwd
  7. On the BeagleBone Enable UARTS

    1. $ ls /dev/ttyO*
      1. If more than 1 UARTs are listed, UARTs are already enabled, go to step 9 of main guide, else follow the rest of this subsection
    2. Open /boot/uEnv.txt in your editor of choice
      1. Check for enable_uboot_cape_universal=1
      2. If this line is commented out, uncomment it
        1. Reboot BeagleBone and check if UARTs are enabled (rebooting the BeagleBone will mean you have to redo any Internet connection steps done on the BeagleBone)
      3. If this line does not exist, add it
        1. Reboot BeagleBone and check if UARTs are enabled (rebooting the BeagleBone will mean you have to redo any Internet connection steps done on the BeagleBone)
    3. If UARTs are still not enabled, open /boot/uEnv.txt in your editor of choice
      1. Add the line
        1. cape_enable=capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4,BB-UART5
        2. Reboot BeagleBone and check if UARTs are enabled (rebooting the BeagleBone will mean you have to redo any Internet connection steps done on the BeagleBone)
    4. If UARTs are still not enabled, Connect the BeagleBone to the internet
      1. $ sudo apt update
      2. $ sudo apt dist-upgrade
      3. Reboot BeagleBone and check if UARTs are enabled (rebooting the BeagleBone will mean you have to redo any Internet connection steps done on the BeagleBone)
    5. Recover uEnv.txt
      1. $ sudo mv /boot/uEnv.txt.backup /boot/uEnv.txt
      2. Attempt steps 2 and 3 of this subsection again
      3. Reboot BeagleBone and check if UARTs are enabled (rebooting the BeagleBone will mean you have to redo any Internet connection steps done on the BeagleBone)
  8. Now setup the BeagleBone to connect to the internet (note - we currently don't know a way of connecting the BeagleBone to the internet over USB on macOS)

    1. BeagleBone internet tutorial
  9. Ensure you are connect to the BeagleBone and that it is connected to the internet

  10. On the BeagleBone, install basic software

    1. $ sudo apt update
    2. $ sudo apt install python3 python3-pip picocom git cmake python3-venv -y
    3. $ sudo apt-get upgrade
  11. Clone mrover-workspace onto the BeagleBone in the home directory

    1. $ cd
    2. $ git clone https://github.com/umrover/mrover-workspace.git
  12. One the BeagleBone, to resize the microSD partition:

    1. $ sudo fdisk /dev/mmcblk0
    2. enter p to print
      1. Remember the number under start sector
    3. enter d to delete
    4. enter n to create a new partition
    5. skip the first 2 questions with enter
    6. enter the previous start sector
    7. enter N if it asks to remove an ext4 signature
    8. enter w to write changes
    9. reboot the BeagleBone
    10. $ sudo resize2fs /dev/mmblk0p1

12b. Alternatively just run $ sudo /opt/scripts/tools/grow_partition.sh

  1. Run the beaglebone ansible script

    1. clone https://github.com/umrover/embedded-testbench/tree/beaglebone-ansible-setup
    2. Make sure ansible is installed
      1. $ sudo apt install ansible
    3. $ ansible-playbook -K -i "localhost," -c local beaglebone.yml --extra-vars "num=2"
  2. On the BeagleBone, bootstrap Jarvis

    1. $ cd ~/mrover-workspace
    2. $ ./jarvis
  3. Congrats! The BeagleBone should be all setup and ready to go

Clone this wiki locally