โŒ

Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

This Week in Beagle #15

17 February 2025 at 13:00

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

This was it for this week. Hopefully, this helps bring transparency regarding where the development efforts are concentrated, and how the community can help. Look forward to next update.

Helpful links

The post This Week in Beagle #15 appeared first on BeagleBoard.

This Week in Beagle #14

10 February 2025 at 13:00

Hello everyone. I ended up experimenting more than getting results, so not much to write. Letโ€™s go over everything.

PocketBeagle 2 Examples

Continuing the work from last week, more PocketBeagle 2 examples have been added.

Feel free to create issues regarding the examples you would like to be added.

Button

Simple example to detect button presses. Uses Pin P1_20 by default.

Usage

debian@pocketbeagle2:~/vsx-examples/PocketBeagle2$ cargo run -p button
   Compiling button v0.1.0 (/home/debian/vsx-examples/PocketBeagle2/button)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.05s
     Running `target/debug/button`
Chip: gpiochip2 [600000.gpio] (92 lines), offset: 50
Button pressed
Button pressed
Button pressed
Button pressed

Fade

Simple example to fade an LED in and out using PWM. Also contains abstractions to use PWM using sysfs.

Uses P1.36. In case of TechLab Cape, this PIN is connected to RGB.B

Usage

debian@pocketbeagle2:~/vsx-examples/PocketBeagle2$ cargo run -p fade -r
   Compiling fade v0.1.0 (/home/debian/vsx-examples/PocketBeagle2/fade)
    Finished `release` profile [optimized] target(s) in 3.85s
     Running `target/release/fade`

BeagleBoard Image Builder

Currently, the image build process for all BeagleBoard images involves a collection of scripts singlehandedly maintained by Robert Nelson. Thanks to his amazing work on both handling the management of openbeagle runners and image building, things have been working relatively well.

However, this also means that all the burden of pushing and maintaining new images falls on one person. Additionally, the images cannot currently be built in openbeagle, which limits the experimentation and having very special purpose images.

To hopefully improve the current situation, I have been working on trying to get image build working on openbeagle CI. I initially started with trying to get debootstrap directly working in CI, but while I could get it somewhat working (defining working very loosely here), it failed in CI.

Currently, I have 2 possible solutions I am exploring:

  1. debos: Seems quite promising. Has good performance, and should work fine in CI. Additionally, it also can work with just user-mode-linux, so quite portable. Moreover, it already has a recipe system pretty similar to what I want in the final solution.
  2. Using docker: This was mostly inspired from yasib. I was able to build rootfs for the most part, but there were quite a few warnings for systemlevel packages like systemd.

I am still experimenting with both of the above approaches. However, I have started leaning more towards debos. It can have much better performance than docker in docker, and already has been tested quite a bit. Additionally, I can always add support for 2nd approach to debos in the future.

Hopefully, I will have working images by next week.

Optimize linux-embedded-hal dependencies

I have been using linux-embedded-hal in some of the PocketBeagle 2 GPIO examples. When working with it, I observed that it was pulling some unnecessary dependencies even when default-features were disabled. I created a PR to fix it, which has now been merged.

Ending Thoughts

This was it for this week. Hopefully, this helps bring transparency regarding where the development efforts are concentrated, and how the community can help. Look forward to next update.

Helpful links

The post This Week in Beagle #14 appeared first on BeagleBoard.

This Week in Beagle #13

3 February 2025 at 13:24

Hello everyone. Since PocketBeagle 2 has launched, most of the development was focused on it. Letโ€™s go over everything.

Enable Greybus BeaglePlay driver in defconfig

As per suggestion of Nishanth Menon, I have added gb_beagleplay to the defconfig. Here is the latest version of the patch.

Export Symbols RFC

As alluded to in my prior posts, I have been working on using export-symbols in devicetree to add support for add-on connectors such as MikroBUS. This was first proposed by Herve Codina in the following Linux kernel patches. Since then, I have sent patches to add support to devicetree compiler and fdtoverlay.

The overall goal is to make export-symbols part of devicetree specification instead of just a Linux specific extension. This is to allow sharing of add-on board overlays with ZephyrRTOS, which has boards like BeagleConnect Freedom with support for MikroBUS.

To that end, I have sent an RFC in the devicetree specification mailing list to see if anyone has any objections/flaws to point out. I will be sending a patch adding the node to the specification in a week or 2, if there are no objections.

PocketBeagle 2

PocketBeagle 2 is now available for purchase. While, everything is mostly working now, I have been working on adding a few things to just make the support as good as possible.

Debug Port

In the early phases of development, most people were using PocketBeagleยฎ TechLab with PocketBeagle 2, and thus using the UART exposed by it. However, PocketBeagle 2 has a debug UART (compatible with Raspberry Pi Debug Probe) on board.

There were some issues to get U-Boot working with this UART, but other than U-Boot R5 logs, everything is redirected to use the Debug Port. We are actively working on getting R5 to also use the debug port, but it should not affect general usage, since the boot selection menu is shown by A53 core.

Examples

In a recent discussion, it was also decided to add examples for beginners to get started quickly. Initially, I was going to use Python, but given that Beagle Boards seem to attract a lot of people in Kernel and U-Boot space, it was decided that I should go ahead with writing examples in Rust.

With Rust support in Linux kernel finally reaching a good enough state, this means the same language can be used for both userspace IoT projects and Kernel space drivers.

Rust is also quite popular nowadays, so it might help attract new potential contributors. The examples can be found here. Hopefully, they will start being shipped in default images, and will be accessible with the Theia local Theia editor.

Feel free to create issues regarding the examples you would like to be added.

Hello Beagle

Simple example to test that Rust has been set up correctly.

Usage

debian@pocketbeagle2:~/vsx-examples/PocketBeagle2$ cargo run -p hello_beagle
   Compiling hello_beagle v0.1.0 (/home/debian/vsx-examples/PocketBeagle2/hello_beagle)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.64s
     Running `target/debug/hello_beagle`
Hello, World! From PocketBeagle2

EEPROM

Read and parse EEPROM contents in Rust.

Usage

debian@pocketbeagle2:~/vsx-examples/PocketBeagle2$ cargo run -p eeprom
   Compiling eeprom v0.1.0 (/home/debian/vsx-examples/PocketBeagle2/eeprom)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.99s
     Running `target/debug/eeprom`
EEPROM Data: Contents {
    magic_number: [
        170,
        85,
        51,
        238,
    ],
    hdr1: Header {
        id: 1,
        len: 55,
    },
    hdr2: Header {
        id: 16,
        len: 46,
    },
    board_info: BoardInfo {
        name: "POCKETBEAGL2A00G",
        version: "A0",
        proc_number: "0000",
        variant: "0G",
        pcb_revision: "0G",
        schematic_bom_revision: "A0",
        software_revision: "00",
        vendor_id: "01",
        build_week: "34",
        build_year: "24",
        serial: "PB20000001",
    },
    hdr3: Header {
        id: 17,
        len: 2,
    },
    ddr_info: 4776,
    termination: 254,
}

Blinky

Simple example to toggle GPIOs. Uses Pin P1_20 by default.

Also provides a simple helper function to find PIN by name.

Usage

debian@pocketbeagle2:~/vsx-examples/PocketBeagle2$ cargo run -p blinky
   Compiling blinky v0.1.0 (/home/debian/vsx-examples/PocketBeagle2/blinky)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.50s
     Running `target/debug/blinky`
ON
OFF
ON
OFF
..

MSPM0 Firmware

PocketBeagle 2 contains an MSPM0, which is used as ADC and EEPROM. The MSPM0 firmware can be found here.

Here are the instructions to flash MSPM0:

  1. Download the firmware:
wget https://openbeagle.org/api/v4/projects/249/packages/generic/mspm0_adc_eeprom/0.13/mspm0_adc_eeprom.txt
  1. Download bb-imager-rs latest version. Currently, that is v0.0.3:
wget https://openbeagle.org/api/v4/projects/832/packages/generic/bb-imager-cli/0.0.3/bb-imager-cli-aarch64-unknown-linux-gnu.tar.xz
tar -xvf bb-imager-cli-aarch64-unknown-linux-gnu.tar.xz
cd usr/bin
  1. Flash
./bb-imager-cli flash pb2 --img-local /path/to/firmware --no-eeprom

It is also possible to flash any other custom firmware in Ti-TXT or iHex format.

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

The post This Week in Beagle #13 appeared first on BeagleBoard.

This Week in Beagle #11

20 January 2025 at 13:00

Hello everyone. A typical week for development. Letโ€™s go over everything.

Zephyr Ti Hal Updates

A few weeks ago, I created a PR to update the Simplelink SDK version in hal_ti from 4.40.04.04 to 7.41.00.17. Now that it has been merged, hopefully, I can start working on adding Bluetooth support using the BLE5 Stack in the SDK.

BeagleBoard Rust Imager

More work went into the BeagleBoard Rust imager this week. I hope to get the v1.0.0 release out by the end of this month and replace the old bb-imager.

Introducing bb-imager-service

As mentioned last week, I was searching for how to allow PocketBeagle2 MSPM0 firmware update from the GUI. To reiterate the problem, sysfs entries for Firmware Upload API is owned by root user and thus cannot be opened from the GUI without some kind of privilege escalation mechanism. As a reference, in case of SD card flashing, I am using UDisk2 D-Bus APIs to open the SD card, which internally uses polkit for privileged management.

After some googling, I came across the following stack overflow answer:

  • You could, of course, write your own D-Bus service which does that and install the D-Bus .service config to have it run as a system service with root privileges. (Try to keep the operations as limited and fine-grained as is reasonable; e.g. โ€œenable global mode fooโ€ โ€“ not โ€œwrite arbitrary data to arbitrary fileโ€.)
  • Failing that, one common method is to spawn pkexec to perform operations, which isโ€ฆ really just su with a nicer password prompt. Note that some distributions have recently removed pkexec.
  • If your app is allowed to use either GNOMEโ€™s GLib or KDEโ€™s KIO libraries, then both of those already have PolicyKit integration built-in for privileged file updates โ€“ the app could open admin:///etc/foo and GLib or KIO would elevate as needed.

Since I could not find much regarding the 3rd approach, and the 2nd approach seemed to be on the way out, I ended up going with a custom D-Bus service. I will probably need similar functionality for BeaglePlay cc1352p7, BeagleY-AI, etc., so it is not a bad idea to have a custom d-bus service.

Using zbus was pretty nice, and I have a better understanding of Linux systems, so it ended up being quite a learning experience. I am building a Debian package for the service for now since it is only supposed to be used in PocketBeagle2 right now. It also contains systemd service which activates on D-Bus connection.

The following articles were a lot of help in figuring everything out:

Overhaul config format

The config format I initially started with differed from RPI-imagers since I thought it would be more efficient. However, after adding a lot of boards and flasher types, I realized that every flashing target is not really a board. For example, having different board entries for PocketBeagle2 and PocketBeagle2 MSPM0 seemed weird.

While browsing rpi-imager last week, I found out that it seems to support bootloader updates in different rpi versions. The GUI presentation seemed nice, so after some deliberation, I adopted a format compatible with the RPI-imagerโ€™s format. Since the os_list is a self-referential structure in the RPI-imagerโ€™s config, it is possible to have a lot of sub-menus in the image selection menu, which is quite nice.

To elaborate, now there are only base boards (e.g., PocketBeagle2) in the Board Selection menu, and the Image Selection menu will have a sub-menu for MSPM0 Firmware support.

Check out the PR for implementation details.

Live destinations refresh

Similar to RPI-imager, destination refresh is now automatic using subscriptions. Check out the PR for implementation details.

Better defaults in Extra Configuration

The application now queries the userโ€™s current system for the default suggestions regarding username, keyboard layout, timezone, etc. Check out the PR for details.

Include udev rules

I have added udev rules to the Linux package of GUI to allow flashing BeagleConnect Freedom without needing superuser privileges. They also make development easier and allow using commands like tio without root.

Ending Thoughts

This was it for this week. Hopefully, this helps bring transparency regarding where the development efforts are concentrated, and how the community can help. Look forward to next update.

Helpful links

The post This Week in Beagle #11 appeared first on BeagleBoard.

This Week in Beagle #10

13 January 2025 at 13:00

Hello everyone. A typical week for development. Letโ€™s go over everything.

BeagleBoard Rust Imager

Pocketbeagle2 MSPM0 support

Pocketbeagle2 uses MSPM0 as both EEPROM and ADC. The EEPROM is used to store board-specific information in all BeagleBoard boards for easier debugging and differentiation of different revisions.

While the pb2_mspm0 driver supports updating firmware, it isnโ€™t suitable to be used directly by new people:

  1. Does not persist EEPROM contents.
  2. Does not support Ti-TXT directly.

To solve this, I have added pb2_mspm0 support directly to bb-imager-cli. There is also a flag to control if EEPROM contents should be preserved (since it is possible to flash firmware other than the default one). Additionally, since bb-imager-rs supports Ti-TXT and iHex by default, we get that support for free.

I am still trying to figure out how to add support to the GUI since the flashing requires access to sysfs entries, which are owned by root (and probably should stay that way). I think I am supposed to use polkit, but not completely sure.

Contribution and Packaging Instructions

I have added instructions regarding Contribution and Packaging to hopefully make it easier for newcomers to get started. It also helped be document a lot of stuff that even I forget, so it should prove useful.

Better cross-compilation support

For pocketbeagle2 testing, I wanted to be able to cross-compile from my main machine without needing to tinker too much. I had used cross in the past, but it turns out that the container cross uses by default is based on Ubuntu 20.04, which contains libssl1. Pocketbeagle2 images have libssl3, which means that I could not use the default images for cross-compiling.

I have added custom image dockerfiles, so cross-compiling should be as simple as setting RUST_BUILDER=cross and running a make recipe.

Note: cross compiling is only supported for the following targets right now:

  • x86_64-unknown-linux-gnu
  • aarch64-unknown-linux-gnu
  • armv7-unknown-linux-gnueabihf

Windows should support can probably be added with a custom dockerfile (or the default cross windows container might work), but I do not need it much, so havenโ€™t really tried adding it.

Export Symbols Devicetree Support

A few weeks ago, Herve Codina sent patches to the kernel mailing list for supporting export-symbols as another possible way to support addon board overlays. Since adding support for path references to overlays ended up being a dead end (see here), I have starting working on export-symbols based approach for mikroBUS.

As a part of that effort, I am working on adding export-symbols support to the base devicetree compiler, to hopefully make it part of devicetree specification instead of just a Linux specific thing. That way, it should be possible to support the same addon-board overlays in Zephyr in the future.

Base devicetree compiler

I started work with adding support to the base devicetree compiler. The patch series does not contain tests right now since this is more of an RFC for now.

fdtoverlay

Similarly, I also sent the patch series for support in fdtoverlay. The tests will be added to future versions of the patch.

Future work

As discussed in the original patch series, to make use with fdtoverlay possible, we need to add a way to pass the target path to fdtoverlay, which is not supported right now. I will try to work on it this week. Hopefully, addon board support will be merged before 2026.

Ending Thoughts

This was it for this week. Hopefully, this helps bring transparency regarding where the development efforts are concentrated, and how the community can help. Look forward to next update.

Helpful links

The post This Week in Beagle #10 appeared first on BeagleBoard.

This Week in Beagle #8

31 December 2024 at 00:30

Hello everyone. I have been traveling for the last few weeks due to some family functions. Additionally, I was primarily working on Pocketbeagle2 stuff, which wasnโ€™t public yet, so I also lacked content. Now that Pocketbeagle2 has been announced, I can start talking about it. So, letโ€™s get to it.

Pocketbeagle2 MSPM0 Driver

In Pocketbeagle2, instead of using dedicated EEPROM and ADC, we are using MSPM0L1105 with specilized firmware that acts as EEPROM and ADC.

While it is possible to use a userspace flasher, it is much easier to perform firmware updates with an upstream driver. Additionally, it also allows doing some custom pinmux and overlay stuff, which might be required due to a problem with the nRST line.

While the MSPM0L1105 is intended to be used as EEPROM and ADC by default, it can be used as a dedicated co-processor for IO and communicate over I2C or SPI. I will also try to add Zephyr support in the future.

The driver is currently in my kernel tree.

Update Ti simplelink SDK in hal_ti

A while ago, I found an issue with BeagleConnect Zephyr support, where everything freezes if both PWM and SUBg are enabled at the same time. Thanks to help from Arthur, I was able to confirm that this does not happen in Ti-RTOS and is thus a problem with Zephyr implementation. However, I was not able to find the root cause, even with JTAG debugging. The complete discussion can be found in e2e.

Fast forward to last week, and I thought I should try tackling it again before starting work on Arduino support using LLEXT. One of the possibilities I came up with was that it might be a bug in the version of simplelink SDK that was being used in hal_ti. The SDK being used currently is 4.40.04.04, which is quite old at this point. Additionally, I wanted to use the latest SDK before attempting to tackle Bluetooth again.

While working on it, I realized that it is currently not possible to automate SDK updates since we need to make some modifications manually. In the end, it turned out that the SDK version was not the cause of the freeze, but it helped me figure out the real cause.

Hopefully, I can figure out a more sustainable way moving forward, but I just went with the manual route for now.

It also seems like GPIO APIs have completely changed, and I had to fix some stuff in the Zephyr GPIO driver. Here are the open PRs: hal_ti and zephyr.

Fix BeagleConnect Freedom Freeze Bug

As discussed above, I was finally able to pinpoint the cause of the freeze. It turns out that the Zephyr power management was at fault. Both the PWM driver and RF core driverlib can put and release constraints on the suspend state of cc1352p7. However, at least the PWM code would release the constraint without checking if PWM placed the constraint in the first place.

I have created an initial PR to fix the problem by ensuring that PWM keeps track of the suspend constraint. This ensures that PWM does not cause the processor to go to suspend even if it has been disabled by subg code.

Ending Thoughts

This was it for this week. Hopefully, this helps bring transparency regarding where the development efforts are concentrated, and how the community can help. Look forward to next update.

ย 

Helpful links

The post This Week in Beagle #8 appeared first on BeagleBoard.

This Week in Beagle #7

10 December 2024 at 13:00

Hello everyone. I was busy with the Linux kernel for most of the week. Letโ€™s go over everything.

MicroBlocks Updates

MicroBlocks dev branch recently broke the MicroBlocks Zephyr Port. I sent a patch to the Discord channel, and it has been fixed.

Devicetree Compiler

A lot of work this week was focused on the device tree compiler. I have been working on adding support for path references in devicetree overlays. In the initial patch, some parts of the initial patch series can be sent as independent patches. So last week mostly involved getting those merged.

setprop namelen variants

Previously, all the setprop variants calculated length of property length from strlen. However, devicetree __fixups__ contains information regarding the position of a property to resolve, and thus cannot use these normal variants. Additionally, it is not allowed to use heap memory in many places in the devicetree compiler and related tools, and thus, there was a need for setprop_namelen_* variants of functions similar to how these exist for getprop_namelen_*.

The patch series has been merged now.

Clang format config

While working on the devicetree compiler code, I was using the clang-format config from the Linux kernel. As suggested by David Gibson, I sent a patch to add the clang-format config which has now been merged.

Path Reference support in Devicetree overlays

Since the related patch for setprop namelen variants has been merged, I have been working on version 2 of the path reference support patch. Since it is not allowed to use dynamic allocation, I have been able to get things working with adjusting offsets while growing. I still need to fix some tests and add new ones, but I should be able to post the patches this week.

BeagleBoard Rust Imager

As per the suggestion in the issue, I have been experimenting with moving around the configuration screen flow. A prototype can be found here. I have not yet finalized whether this should be merged.

Ending Thoughts

This was it for this week. Hopefully, this helps bring transparency regarding where the development efforts are concentrated, and how the community can help. Look forward to next update.

Helpful links

The post This Week in Beagle #7 appeared first on BeagleBoard.

This Week in Beagle #6

25 November 2024 at 13:00

Hello everyone. Another light week here. Letโ€™s go over everything.

BeagleY-AI SD Card support

While hacking on my BeagleY-AI, I found that my HP SD card did not work with BeagleY-AI for some reason. On digging a bit further, some SD cards were not working on BeagleY-AI due to some issues with signal voltage switching on the am62x platform. This has now been fixed, as seen in the following patch series. By switching out the Linux kernel to mainline, I was able to get the HP SD card to work. So, the SD card compatibility of BeagleY-AI will improve soon.

BeagleBoard Rust Imager

BeagleBoard Rust imager got lots of love this week.

AppimageLauncher Problem

As pointed out by Jason here, the BeagleBoard Rust imager appimage is not usable with AppimageLauncher. The issue seems to be that appimagetool uses ZSTD compression now, while AppimageLauncher does not support it yet. Moreover, it seems like AppimageLauncher makes the appimage unusable. For now, the recommendation is to either remove AppimageLauncher or at least deactivate it for the BeagleBoard Rust imager.

More information regarding the upstream issue can be found here.

SD Card Flashing Performance Improvements

While the SD card flashing worked, it was much slower than the original bb-imager. After some tinkering with the buffer size while flashing and using parallel decompression of xz images, SD card flashing should be much faster (flashing time decreases by 57%).

It is still a bit slower than the original bb-imager (about 1 min), but it seems related to the internals of QFile, so that would be much more work than just a day.

Debian Packages

BeagleBoard Rust imager now builds Debian packages in CI using cargo-deb. While the goal is to eventually have an upstream package using debcargo, there is not much point until bb-imager-rs hits v1.0.0. Additionally, since debcargo only seems to support building stuff already present in cartes.io, it does not seem suitable for experimental builds (although I could be wrong about that).

Experimental Builds

Builds from the latest main branch are now pushed to Package Registry rather than just being stored as build artifacts. This makes grabbing the latest development version of bb-imager-rs much simpler.

Note: Only the most recent build is kept around.

Ending Thoughts

This was it for this week. Hopefully, this helps bring transparency regarding where the development efforts are concentrated, and how the community can help. Look forward to next update.

Helpful links

The post This Week in Beagle #6 appeared first on BeagleBoard.

My Week in Beagle #5

18 November 2024 at 13:00

Hello everyone. I was busy with the Linux kernel for most of the week. Letโ€™s go over everything.

Devicetree append properties support

Currently, devictree supports creating and deleting properties but not appending to existing properties. This functionality is vital for complex uses like MikroBUS. I have been working on this for a while and posted Patch v3 last week.

To understand what it allows, letโ€™s take an example:

dts-v1/;

/ {
    node {
        str-prop = "0";
    };
};

/ {
    node {
        /append-property/ str-prop = "1";
    };
};

The above devictree will produce the following output:

dts-v1/;

/ {
    node {
        str-prop = "0", "1";
    };
};

Devicetree overlays path reference support

Devicetree allows references in two contexts:

  1. Integer context: In this case the references are resolved to phandle.
    foo = <&bar>;
    
  2. String context: In this case, the references are resolved to paths.
    foo = &bar;
    

Runtime overlays only support the former but not the latter. I have created a patch series to fix this asymmetry.

Additionally, __symbols__ does not support phandles, which makes overlays modifying __symbols__ somewhat limiting. More context regarding this patch can be found here.

Ending Thoughts

This was it for this week. Hopefully, this helps bring transparency regarding where the development efforts are concentrated, and how the community can help. Look forward to next update.

Helpful links

The post My Week in Beagle #5 appeared first on BeagleBoard.

This Week in Beagle #4

11 November 2024 at 13:00

Hello everyone. Another light week here. Letโ€™s go over everything.

BeagleBoard Rust Imager

Continuing the trend from previous weeks, many developments took place in BeagleBoard Rust Imager.

MacOS

Thanks to help from Zain, BeagleBoard Rust Imager SD card flashing finally works on MacOS. With this, it is now possible to flash Linux images to an SD card on MacOS.

Any developers requiring similar functionality should look at the PR. Here are the steps in brief:

  1. Unmount the sd card using diskutil.
  2. Create pipes using std::os::unix::net::UnixStream::pair().
  3. Create a MacOS Authorization external form using security_framework::authorization.
  4. Launch authopen with the -extauth argument using std::process::Command with the send pipe as stdout.
  5. Send the MacOS authorization external form to the process stdin.
  6. Read the SCM_RIGHTS control message from the receive pipe and get the file descriptor.

Sd card formatting

SD card formatting is now supported on both Windows and Linux. MacOS support is still pending. This is useful for making the bootable SD cards usable again.

Offline support

Offline use of BeagleBoard Rust imager for all supported boards is now possible. The base configuration now includes definitions for all boards.

MicroBlocks

Since MicroBlocks IDE v2 has been released, there has been a new release of MicroBlocks stable firmware. You can grab the latest firmware for BeagleBoard Freedom from here.

GPIO Nexus Node Schema

While working on MikroBUS patches, I encountered devicetree nexus nodes. It allows the ability to create proxy GPIO controller thereby providing a stable numbering scheme for GPIO pins on MikroBUS socket.

To allow use in the Linux kernel, I created a PR to add the dt schema to the upstream repository. It has now been merged.

Dynamic alias in Linux devicetree

Currently, adding/removing/updating /aliases is not supported in the upstream Linux kernel. This means overlays cannot rely on using /aliases, which are much more powerful than existing /__symbols__. In my patch series to add support for phandles in /__symbols__, it was brought up that it might be better to switch to using /aliases instead of trying to add more to /__symbols__.

So I have created a new patch series based on the original patch series by Geert Uytterhoeven in 2015.

Ending Thoughts

This was it for this week. Hopefully, this helps bring transparency regarding where the development efforts are concentrated, and how the community can help. Look forward to next update.

Helpful links

The post This Week in Beagle #4 appeared first on BeagleBoard.

This Week in Beagle #3

4 November 2024 at 13:00

Hello everyone. Another light week here. Letโ€™s go over everything.

BeaglePlay PWM Patch

A while ago, I discovered that the MikroBUS PWM pin was not enabled in the upstream devicetree for BeaglePlay. So I created a patch to enable PWM and it was finally merged last week.

BeagleConnect Freedom Debugging

Continuing the work from last week, I was able to load Zephyr firmware that exhibited the stalling behavior. However, I still havenโ€™t been able to pinpoint the exact cause. You can follow the discussion in Ti E2E

I have created a minimal example to reproduce the problem.

BeagleBoard Rust Imager

There has been some interest in making the Rust flasher the official flasher. To achieve that, there has been a lot of development towards v1.0.0.

MacOS dmg support

Thanks to help from Zain, I was able to create MacOS dmg in CI. While most of the flashing functionality does not work on MacOS yet, having easy experimental CI builds should help development to at least ensure everything builds.

Make bb-imager-rs Ready for crates.io

While exploring ways to create a Debian package, I stumbled across debcargo, which is the official way to package Rust applications for Debian. Since it can potentially allow official packages in the future, I decided to prefer it over cargo-deb. However, since debcargo builds the package from crates.io, I needed to cleanup the out of tree patches for rs-drivelist and bin_file. So, I moved the unmerged/unreleased code into bb-imager itself for now.

I still need to set up CI to push to crates.io automatically, but I am a bit unsure regarding how to handle the API key securely.

Sd Card Formatting Support

I have added support for SD card formatting since it is helpful for an imaging utility. However, it does not work on Windows yet.

Performance Enhancements and Code improvements

Here is the list of minor improvements that occurred during the week:

  • More responsive UI
  • Make the default window size smaller
  • Better handling of big os image lists.
  • Code improvements to make contribution easier.

Ending Thoughts

This was it for this week. Hopefully, this helps bring transparency regarding where the development efforts are concentrated, and how the community can help. Look forward to next update.

Helpful links

The post This Week in Beagle #3 appeared first on BeagleBoard.

This Week in Beagle #2

28 October 2024 at 12:00

Hello everyone. This week mostly involved a lot of chasing stuff around (sometimes in vain), so while there was not much headline work, this post might end up a bit longer than usual. Letโ€™s get started without delay.

BeagleConnect Freedom Adventures

I started the week by trying to add IEEE802154 subg socket support in MicroPython for BeagleConnect Freedom. However, I quickly learned that it would not be simple. For some reason, BeagleConnect Freedom would completely lock up after starting.

Initially, I thought it might be a MicroPython issue, so I tried tracking down where the freeze happened. This, however, led to a dead end since, for some reason, the program would not be able to read from the UART console. While doing this, I also remembered a similar issue I encountered while working on BeagleConnect Freedom rc car demo. At the time, I fixed it by just removing unused config items like ADC and PWM from config, but forgot about it after the OOSC conference.

After some experimenting with PWM, ADC, and IEEE802154 subg radio, I figured out that the problem is reproducible in other Zephyr samples like echo_cliet, etc. For some reason, if both PWM pins (MB1 PWM and MB2 PWM) are enabled alongside the subg radio, everything freezes. If one or both of the PWM are disabled, everything works fine. This seems to be an issue with timers but it needs further investigation.

I have created a Zephyr issue and a Ti E2E question for the same.

Code Composer Studio Theia Adventures

With the MicroPython issue and a bricked BeagleConnect Freedom, I thought it is a good time to setup and learn Tiโ€™s Code Composer Studio.

I use Fedora Sway Atomic as my daily driver, and thus mostly rely on flatpaks or podman containers. However, running Code Composer Studio inside a podman container (created using toolbox) was not a great experience for me. It would randomly stutter (maybe a hardware acceleration problem?) and freeze. Additionally, while udev can make it almost painless to handle device permissions, it can occasionally cause hiccups with flashing. In fact, one of the primary reasons I switched to neovim was that my emacs GUI kept having weird performance problems inside the container.

So, I finally went ahead and installed CCS Theia on my base system. The install procedure is a bit weird since there is no rpm or deb package. Instead, there is an installer which installs everything in $HOME/ti folder. It also creates an uninstall, which seems to work. All in all, while I prefer a flatpack or app image, it wasnโ€™t too bad.

I hit a snag quite early on when I was unable to flash the cc1352p1 on my launchpad. I tried various things and opened a Ti E2E question for the same. However, the solution turned out to be quite weird. I was not saving my workspace since, well, nothing was working anyway, and CCS Theia would open the unsaved workspace. But everything magically worked once I saved my workspace because I was tired of the dialog on exit. Not really sure why.

Once I could flash the launchpad, I tried using the xds110 in launchpad with my BeagleConnect Freedom. I was able to flash a simple blinky on it and even set up breakpoints.

Now, I need to figure out how to use openocd and add instructions in Beagle docs and Zephyr docs for the same.

KUnit Adventures

I have been working on kernel patches that require writing some unit tests. So I was trying to get KUnit to work. However, kunit run kept on failing for some reason, even with the default config. The output was not very clear either. However, after following some debugging instructions, I found out that I could not execute the user mode kernel from inside the podman container. I have created an issue in Fedora toolbox regarding the same.

MicroPython

I have added MicroPython support for BeaglePlay cc1352p7 in my draft PR. It supports IEEE802154 subg sockets and also helped me ensure that MicroPython networking should work fine on BeagleConnect Freedom as well once the timer issue is resolved.

Since BeaglePlay cc1352p7 Zephyr support was merged after the 3.7.0 release, the MicroPython support will continue to live in the draft PR until MicroPython supports a newer Zephyr version.

Zephyr

Zephyr support for BeagleBoard boards continues to improve. We will continue to work to make Beagle one of the best-supported platforms for Zephyr development.

BeagleBone AI-64

Thanks to the work by Andrew Davis, Zephyr support for R5 cores in BeagleBone AI64 was merged this week. Here is the Zephyr page for BeagleBone AI 54. This adds one more board to the growing list of BeagleBoard boards that support Zephyr.

BeagleY-AI

A PR for Zephyr support was opened by Andrew Davis after BBAI-64 support was merged. Anyone interested should feel free to try it out. Hopefully, it can get merged upstream soon.

BeagleBoard Imager Rust Updates

While working on BeagleY-AI, I found a bug in the sha256 handling of the Rust-based imager while translating the old bb-imager config. So, I have created release 0.0.2 for the imager. I probably should implement changelogs before the next release.

Ending Thoughts

This was it for this week. Hopefully, this helps bring transparency regarding where the development efforts are concentrated, and how the community can help. Look forward to next update.

Helpful links

The post This Week in Beagle #2 appeared first on BeagleBoard.

This week in Beagle #1 by Ayush Singh

21 October 2024 at 12:00

Hello everyone. This is the start of a new blog series to keep the community in the loop regarding the work done by BeagleBoard.org members and the community. Hopefully, I can stick to the schedule.

MicroPython

Initial BeagleConnect Freedom Support

While we have had MicroPython firmware for BeagleConnect Freedomย in the past, the work was out of tree. This made maintenance and collaboration hard to do. There were a few reasons for having the support out of tree:

1. Zephyr support for BeagleConnect Freedom was primarily out of tree, with just basic support in mainline.
2. MicroPython only supported Zephyr v3.1.0

Due to my work, BeagleConnect Freedom supports almost everything in mainline Zephyr. Additionally, due to the fantastic work by Maureen Helm, MicroPython now supports Zephyr v3.7.0. So, it seemed like a good time to have support for BeagleConnect Freedom in mainline MicroPython. Here is the link to the merged PR. It does not contain more advanced features like ADC and PWM right now, but those are also on the way.

PWM support for Zephyr Port

While working on adding PWM support for BeagleConnect Freedom in MicroPython, I discovered that the Zephyr port of MicroPython did not support PWM. So, I ended up working on adding PWM support. Here is the PR.

MicroBlocks v2.0

MicroBlocks is a blocks programming language for physical computing inspired by Scratch. BeagleConnect Freedom has had good support for MicroBlocks, as outlined in a prior post.

Recently, MicroBlocks v2.0 was released in pilot and thankfully, BeagleConnect Freedom works with the newest firmware perfectly, without any real change in the Zephyr port.

Arduino Module for Zephyr

Due to the recent cleanup of the defaults in the device tree of BeagleConnect Freedom, ADC and PWM are supported without any overlays. So just a simple cleanup of Arduino module overlay. Here is the PR.

BeagleBoard Rust Imager

The v0.0.1 release of the BeagleBoard Rust imager took place last week. It has the following features:

  1. Platforms:
    1. Linux
      1. GUI Appimage
      2. CLI binary
    2. Windows
      1. GUI Portable exe
      2. CLI binary
    3. macOS
      1. CLI binary
  2. Boards
    1. Generic Linux (BeaglePlay, Beagle AI64, BeagleY-AI,ย  BeagleV-Fire, BeagleBone Black, etc)
    2. BeagleConnect Freedom
    3. BeagleConnect Freedom MSP430

It is basically at feature parity with the original BeagleBoard Imager based on Raspberry Pi and supports additional boards like BeagleConnect Freedom. Here is the release page.

Ending Thoughts

This was it for this week. Hopefully, this helps bring transparency regarding where the development efforts are concentrated, and how the community can help. Look forward to next update.

The post This week in Beagle #1 by Ayush Singh appeared first on BeagleBoard.

โŒ
โŒ