My Week in Code #3

Hello everyone. This was one of the lighter weeks since I couldn’t get much results. But after some thinking, it is also vital to write about failed endeavors in case I pick something back.

Bluetooth support for BeagleConnect Freedom

I will outline everything I encountered while trying to get Bluetooth support for BeagleConnect Freedom on Zephyr. While I could not do it in the end, I hope this can be helpful in any future work on this.

Support for most other BeagleConnect Freedom capabilities is already present in upstream Zephyr, so Bluetooth is the last remaining major feature we are missing.

After exploring the Zephyr Bluetooth source code, I have come to 2 possible approaches. I will be outlining the benefits, effort required, etc.

Binary Blob

It is possible to use binary blobs for HCI support on cc1352p7. As is evident from Ti docs, there is already an implementation of HCI for cc13xx devices. The following steps need to be taken to integrate it with Zephyr:

  1. Ensure that the internal structure of HCI does not conflict with Zephyr (I assume it might use Ti-RTOS).
  2. Add the blob to hal_ti. West supports fetching binary blobs.
  3. Write an HCI driver (see hci_esp32).

This approach requires minimal changes to the current Ti approach and should be reasonably straightforward for anyone with access to the cc13xx HCI source. Additionally, minimal maintenance is required from the Ti side since they already maintain the HCI source for Ti-RTOS.

This approach is already in use in ESP32 boards. Thus, it should be accepted with minimal resistance.

Zephyr also supports software-based link layers, which are supported by Nordic hardware. While it should be possible to directly interface with cc13xx radio APIs in ROM and use the software link layer, the current ble stack was created around Nordic hardware. This means that supporting the Ti APIs would require significant time and effort to adapt things for Ti driverlib APIs.

I feel this approach only makes sense if Ti intends to officially support Zephyr since it will also require a permanent maintainer.

BeagleY-AI Zephyr Support

During the Beagle-Y-AI Hacking Sessions, we went over how to get started with Zephyr on R5 core of BeagleY-AI. Here is the current Zephyr repo.

Check out the video for more details.

BeagleConnect Freedom MicroPython

I have added basic BeagleConnect Freedom support to draft PR. It currently contains support for the following:

  • GPIO
  • I2C
  • SPI
  • FLASH

I will move the support for this to the main branch once support for Zephyr 0.37.0 is merged.

I am waiting on upstream Zephyr PR before adding support for ADC, PWM and IEEE802154g.

BeagleBoard Imager Rust Utility

More updates for Rust port of BeagleBoard imager utility. I am thinking of creating a release soon.

Support for more firmware file types

We are trying to make it possible to do development for BeagleConnect Freedom using Ti Code Composer Studio. However, the current flasher (both GUI and CLI) only supports flashing .bin. So to make things more ergonomic, I am planning to add support for Ti-TXT, Intel Hex, and other common formats.

I am using bin_file to handle and parse the file formats. However, it was missing some functionality I needed. Here is the PR.

I have already enabled support for new formats for flashing MSP430. Similar support for BeagleConnect Freedom is coming soon.

Updated Look

The GUI look lines up with the current BeagleBoard imager utility, complete with the background and font.

I use a window manager (sway), so the screenshots have no window decorations.

Screenshots

Here are some screenshots from the application.

Home Page

Extra Configuration Page

Flashing Page

Ending Thoughts

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

Consider supporting me if you like my work.

Helpful links