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.
- Download gloworm-dt-blob.dts
sudo apt install device-tree-compiler
dtc -O dtb gloworm-dt-blob.dts -o dt-blob.bin -q
Before modifying the image, we’ll flash it onto Gloworm.
git clone --depth=1 https://github.com/raspberrypi/usbboot
sudo apt install libusb-1.0-0-dev # install libusb-dev
- 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
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.
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
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.
sudo dd if=<device> of=gloworm_image.img bs=4M status=progress