Skip to content

Instantly share code, notes, and snippets.

@jadonk
Last active July 28, 2016 07:14
Show Gist options
  • Save jadonk/ef22de2d04e93022d623 to your computer and use it in GitHub Desktop.
Save jadonk/ef22de2d04e93022d623 to your computer and use it in GitHub Desktop.
Setup for BBBMINI quadcopter

References

Host (used a BeagleBoard-X15 with bmaptool installed and a USB-microSD adapter):

mkdir images && cd images
wget https://rcn-ee.com/rootfs/bb.org/testing/2015-11-15/console/BBB-eMMC-flasher-debian-8.2-console-armhf-2015-11-15-2gb.img.xz
wget https://rcn-ee.com/rootfs/bb.org/testing/2015-11-15/console/BBB-eMMC-flasher-debian-8.2-console-armhf-2015-11-15-2gb.bmap
dmesg | tail   # Fetch microSD device
sudo bmaptool copy BBB-eMMC-flasher-debian-8.2-console-armhf-2015-11-15-2gb.img.xz /dev/sdb

I removed the microSD, inserted it in a BeagleBone Black, held the BOOT button and applied power.

I waited for the flash to complete, powered down, removed the microSD card, connected Ethernet and powered up again.

I found the IP address of my board on my router and did 'ssh debian@192.168.2.168' from my Mac using 'temppwd' to log in.

Target:

sudo apt-get update
sudo apt-get install -y lsb-release g++ gawk git make ti-pru-cgt-installer \
    device-tree-compiler screen \
    cpufrequtils npm c9-core-installer python2.7
sudo systemctl enable cloud9.socket
sudo sed -i 's/GOVERNOR="ondemand"/GOVERNOR="performance"/g' /etc/init.d/cpufrequtils
sudo /opt/scripts/tools/update_kernel.sh --ti-rt-channel --testing
sudo sed -i 's/^#dtb=$/dtb=am335x-boneblack-bbbmini.dtb/' /boot/uEnv.txt
cd /opt/scripts && git clone https://github.com/cdsteinkuehler/beaglebone-universal-io.git
cd /opt/scripts/beagleobne-universal-io && make && sudo make install
sudo shutdown -r now

Then I executed:

cd && git clone https://github.com/diydrones/ardupilot.git
cd ~/ardupilot/Tools/Linux_HAL_Essentials/pru/rangefinderpru && make && sudo make install
cd ~/ardupilot/ArduCopter && make bbbmini
cd ~/ardupilot/libraries/AP_InertialSensor/examples/INS_generic && make bbbmini
cd ~/ardupilot/libraries/AP_Baro/examples/BARO_generic && make bbbmini
cd ~/ardupilot/libraries/AP_GPS/examples/GPS_AUTO_test && make bbbmini
cd ~/ardupilot/libraries/AP_HAL/examples/RCInput && make bbbmini
cd ~/ardupilot/libraries/AP_HAL/examples/RCOutput && make bbbmini

With this setup, I made a flasher image using:

sudo /opt/scripts/tools/eMMC/beaglebone-black-make-microSD-flasher-from-eMMC.sh

I also made a non-flasher bootable microSD card image using:

sed 's/cmdline=init=/#cmdline=init/' /opt/scripts/tools/eMMC/beaglebone-black-make-microSD-flasher-from-eMMC.sh > make-microSD.sh
chmod +x make-microSD.sh
sudo ./make-microSD.sh

Did to make clones of this created microSD card:

sudo apt-get install -y bmap-tools pv
sudo dd if=/dev/mmcblk1 | pv | xz > bbbmini.img.xz
sudo bmaptool create /dev/mmcblk1 > bbbmini.bmap  ## This needs work... I actually uncompressed the .xz and used that as input.
# swap cards
sudo bmaptool copy bbbmini.img.xz /dev/mmcblk1

After reboot on target (junk info):

debian@beaglebone:~$ cat /proc/cmdline 
console=ttyO0,115200n8 root=UUID=30124b05-dffe-466b-9dcb-b8ad886d5e2e ro rootfstype=ext4 rootwait coherent_pool=1M quiet cape_universal=enable
debian@beaglebone:~$ uname -a
Linux beaglebone 4.1.13-ti-rt-r31 #1 SMP PREEMPT RT Wed Nov 18 03:10:36 UTC 2015 armv7l GNU/Linux
debian@beaglebone:~$ dtc --version
Version: DTC 1.4.0
debian@beaglebone:~$ sudo cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pingroups
registered pin groups:
group: pinmux_clkout2_pin
pin 109 (44e109b4.0)
 
group: pinmux_uart0_pins
pin 92 (44e10970.0)
pin 93 (44e10974.0)
 
group: cpsw_default
pin 66 (44e10908.0)
pin 67 (44e1090c.0)
pin 68 (44e10910.0)
pin 69 (44e10914.0)
pin 70 (44e10918.0)
pin 71 (44e1091c.0)
pin 72 (44e10920.0)
pin 73 (44e10924.0)
pin 74 (44e10928.0)
pin 75 (44e1092c.0)
pin 76 (44e10930.0)
pin 77 (44e10934.0)
pin 78 (44e10938.0)
pin 79 (44e1093c.0)
pin 80 (44e10940.0)
 
group: cpsw_sleep
pin 66 (44e10908.0)
pin 67 (44e1090c.0)
pin 68 (44e10910.0)
pin 69 (44e10914.0)
pin 70 (44e10918.0)
pin 71 (44e1091c.0)
pin 72 (44e10920.0)
pin 73 (44e10924.0)
pin 74 (44e10928.0)
pin 75 (44e1092c.0)
pin 76 (44e10930.0)
pin 77 (44e10934.0)
pin 78 (44e10938.0)
pin 79 (44e1093c.0)
pin 80 (44e10940.0)
 
group: davinci_mdio_default
pin 82 (44e10948.0)
pin 83 (44e1094c.0)
 
group: davinci_mdio_sleep
pin 82 (44e10948.0)
pin 83 (44e1094c.0)
 
group: pinmux_mmc1_pins
pin 60 (44e108f0.0)
pin 61 (44e108f4.0)
pin 62 (44e108f8.0)
pin 63 (44e108fc.0)
pin 64 (44e10900.0)
pin 65 (44e10904.0)
pin 88 (44e10960.0)
 
group: pinmux_mmc1_pins_sleep
pin 60 (44e108f0.0)
pin 61 (44e108f4.0)
pin 62 (44e108f8.0)
pin 63 (44e108fc.0)
pin 64 (44e10900.0)
pin 65 (44e10904.0)
pin 88 (44e10960.0)
 
group: pinmux_emmc_pins
pin 32 (44e10880.0)
pin 33 (44e10884.0)
pin 0 (44e10800.0)
pin 1 (44e10804.0)
pin 2 (44e10808.0)
pin 3 (44e1080c.0)
pin 4 (44e10810.0)
pin 5 (44e10814.0)
pin 6 (44e10818.0)
pin 7 (44e1081c.0)
 
group: user_leds_s0
pin 21 (44e10854.0)
pin 22 (44e10858.0)
pin 23 (44e1085c.0)
pin 24 (44e10860.0)
 
group: pinmux_i2c0_pins
pin 98 (44e10988.0)
pin 99 (44e1098c.0)
 
group: pinmux_i2c2_pins
pin 94 (44e10978.0)
pin 95 (44e1097c.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment