Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vaishnavachath/01a175d9e5a42480d2f5dd27104bfe82 to your computer and use it in GitHub Desktop.
Save vaishnavachath/01a175d9e5a42480d2f5dd27104bfe82 to your computer and use it in GitHub Desktop.
mikroBUS over Greybus BeagleConnect Freedom Demo

PocketBeagle Host

Host Image : Download the latest BeagleBoard.org debian image from here and load this image to an SD card.

Kernel Build(takes about 1-2 hours for a fresh build on an Ubuntu machine):

Only this step needs to be run on a separate machine, all other steps are executed on PocketBeagle, to skip this step download pre-built kernel image from

git clone https://github.com/vaishnav98/bb-kernel.git
cd bb-kernel
git checkout clickid
./build_deb.sh
cp deploy/*.deb to SD card/PocketBeagle

Install newly built kernel

In PocketBeagle from the directory where the *.deb files are copied, run

sudo dpkg -i *.deb
sudo reboot

Clone and Build gb-netlink

git clone https://github.com/jadonk/greybus.git
cd greybus
git checkout f7fe50f8c0ab4545a0850e0552b99ad7522287b8
makemak
e -j`nproc --all`

Host Tools

Install dependencies

sudo apt install -y libnl-3-dev libnl-genl-3-dev libbluetooth-dev libavahi-client-dev wpan-tools

Clone and build gb-netlink

git clone https://github.com/jadonk/greybus.git
cd greybus
git checkout 8ba7f56f04191d74b28346dcd5a22f01608f65dfy
make
sudo make install

Clone and build wpanusb

git clone https://github.com/jadonk/wpanusb.git
cd wpanusb
git checkout 1bfd42e3ffd7cfd38175094c38319ecbc5842500
make
sudo make install

Clone and build gbridge

git clone https://github.com/jadonk/gbridge.git
git checkout 8ba7f56f04191d74b28346dcd5a22f01608f65df
cd gbridge
autoreconf -vfi
GBNETLINKDIR=${PWD}/../greybus \
  ./configure --enable-uart --enable-tcpip --disable-gbsim --enable-netlink --disable-bluetooth
make -j`nproc --all`
sudo make install

qemu_x86_64 Host

git clone --recurse-submodules https://github.com/jadonk/beagleconnect.git
cd
wget "https://buildroot.org/downloads/buildroot-2020.11.1.tar.gz"
tar xzf buildroot-2020.08.tar.gz
cd ... /beagleconnect/sw/buildroot
make -C ~/buildroot-2020.08 O=$PWD BR2_EXTERNAL=$PWD beagleconnect_gateway_qemu_x86_64_defconfig

Common firmware build script

cd ..beagleconnect/sw <if not cloned already, clone beagleconnect repo with submodules>
./build-firmware.sh

To skip this step, download the pre-built firmware from : https://github.com/jadonk/beagleconnect/suites/4055985525/artifacts/102934099

BeagleConnectTM Freedom Gateway Device(over USB)

Flashing

Connect BeagleConnect Freedom device over USB, make sure proper msp430 usb-uart bridge FW is flashed

west flash -d build/wpanusb_beagleconnect (use _2G for 2.4GHz version)

Flashing mikroBUS Click ID Adapter with Add-on board manifest

For flashing mikrobus click ID EEPROM with a click manifest, perform(skip if not using Click ID adapter): from sw directory after plugging in the click ID adapter on the mikrobus port 1(USB, Battery Connector Side) on BeagleConnect Freedom

cd ..beagleconnect/sw
./flash-clickid.sh RTC-6-CLICK {or any other click with manifest available in manifests directory}

See this readme for details on describing add-on boards over greybus

BeagleConnectTM Freedom Remote Device

west flash -d build/greybus_mikrobus_beagleconnect 

Demo

Connect the BeagleConnect Freedom device with wpanusb to the host machine using usb. If using PocketBeagle as the host machine the module loading and initial communication setup needs to be performed as in the following script, in the qemu x86_64 image, the setup and gbridge is configured to run at startup, to start the VM run the following:

cd ..beagleconnect/sw/buildroot
sudo ./run <before running this make sure WPANUSB device is connected and remote device is powered up>
@vaishnavachath
Copy link
Author

BeagleConnect Freedom Demo LPC2021 : https://youtu.be/ujBwLCa3W4M?t=6211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment