My Week in Code #21

Hello everyone. Another typical week. Let’s go over everything.

BeagleBoard Image Builder

After much deliberation last week, I decided to go ahead with trying to use debos for image generation. I was able to create debos recipes for BeagleY-AI and PocketBeagle 2. However, the image generated by debos does not seem to boot on either board. More specifically, it does not seem like the soc is able to find the bootloader (u-boot) present in the BOOT partition.

I did cross-check everything with the current images, and the partitions seem to be in order. So not sure what is going on here. I also went through the debos source code to see how it was creating the partitions, but recreating it in normal shell scripts does seem to work as expected. I also tried generating empty images using debos and copying the boot partition to the appropriate partition, but still could not get it to work.

I have created an issue regarding this, with some scripts that generate the image properly. Let’s see if it can be resolved soon.

PocketBeagle 2 Examples

Some work also went into cleaning up the current examples for PocketBeagle 2. I will be getting my PocketBeagle 2 and TechLab Cape delivered by the end of the week, so hopefully, the examples will be greatly expanded in the upcoming weeks.

Refactor Dependencies

The examples were pulling some unnecessary dependencies, so I removed most of them. Now, there are only 6 dependencies, which is always nice.

I have switched to gpiod for GPIO handling. This is because I went through the source code of both gpiod and gpio-cdev, and felt that gpiod was superior. Additionally, gpiod supports both v1 and v2 of GPIO Character Device Userspace API, while gpio-cdev only supports v1.

I can always write any shim that might be required for interop with embedded_hal myself.

Add blinky ioctl example

I have also added a blinky example, that directly uses GPIO Character Device Userspace API instead of gpiod library. This should help anyone curious peek behind the curtain and get an idea of how the GPIO libraries work behind the scenes.

I am also thinking of creating a blinky example that does not have any dependencies, although I am a bit unsure if it should be another example, or just do that in this example.

Ending Thoughts

That is all for the week. Hopefully, this series will keep people updated about my work and attract potential contributors.

Consider supporting me if you like my work.

Helpful links