Existing image #
If you already have an image for a Raspberry Pi-based coprocessor (such as Raspbian), modifying it to work with Gloworm is pretty straightforward.
Compile Device Tree #
We’ll need to compile our custom device tree first. This will tell the Pi which pins we’re using for the camera, LEDs, fan, ethernet controller, etc.
Linux #
- Download gloworm-dt-blob.dts
sudo apt install device-tree-compiler
dtc -O dtb gloworm-dt-blob.dts -o dt-blob.bin -q
Flashing #
Before modifying the image, we’ll flash it onto Gloworm.
Linux #
git clone --depth=1 https://github.com/raspberrypi/usbboot
cd usbboot
sudo apt install libusb-1.0-0-dev # install libusb-dev
make
sudo ./rpiboot
- Connect your computer to the USB C port labeled with a download icon, wait for usbboot to finish.
sudo fdisk -l
- Find the 8GB device. Make sure you’re using the right device (for me this is
/dev/sda
) sudo dd if=your_existing_image.img of=<device from above> bs=4M status=progress
Modify the boot partition #
Finally, we need to copy our device tree onto the Pi and modify the boot config file to use the enc28j60 overlay and run the cooling fan.
Linux #
sudo fdisk -l
- Find the boot partition of your 8GB device from before. This will be the smaller of the two (for me this is
/dev/sda1
) mkdir boot
sudo mount <device partition> boot
echo "\ndtoverlay=enc28j60\ngpio=45=op,dh" >> boot/config.txt
cp dt-blob.bin boot/ # copy your compiled device tree blob
Backup (optional) #
You can backup your customized image now so you don’t need to repeat those steps in the future.
Linux #
sudo dd if=<device> of=gloworm_image.img bs=4M status=progress