Bela Support for BBAI/Later Ti-Chips

Updates: This Project has been selected for GSoC 2021.
Will now use this thread for all further discussion and will maintain communication logs here as well.
Mentors: @giuliomoro , @rma (Robert Manzke ), and @nerdboy (Stephen Arnold)

Todays chat logs on slack:

Dhruva gole Today at 10:30 PM

@giuliomoro I was going through the current Bela repo makefile and couldn’t really understand much, but if I am not mistaken it will only work on xenomai kernel builds and not the vanilla one’s?
If that is so then will I have to write a new makefile from scratch for running on vanilla?

29 replies

giuliomoro 1 hour ago

it’s largely true that it won’t build on a non-Xenomai machine. There are a couple of workarounds for that without rewriting everything from scratch and I guess that would be good exercise to get familiar with the build process and Makefile. Do you have a Linux machine available?

giuliomoro 1 hour ago

or will you be waiting for the BBAI to reach you? By the way, send me an email with your shipping details so I can get you a Bela cape. The BBAI will come from BB people, as I understand you already gave jkridner your address.

Dhruva gole 1 hour ago

yes I am currently running Linux Mint 20.1 x86_64 .

Dhruva gole 1 hour ago

How can I compile on my linux laptop?

giuliomoro 1 hour ago

is libmercury available on your system?

giuliomoro 1 hour ago

it is Xenomai’s soft-real-time user-space library.

giuliomoro 1 hour ago

and that may well just about get you to build the code on your laptop. Possibly it may even allow you to run it on BBAI without a Xenomai kernel.e (edited)

Dhruva gole 1 hour ago

okay I will check that out

giuliomoro 1 hour ago

if you can’t find libmercury, you can build it from source Installing_Xenomai_3 · Wiki · xenomai / xenomai · GitLab

Dhruva gole 1 hour ago

okay, I have also stumbled across this: Installation steps for xenomai 3 on Ubuntu 16.04 - Stack Overflow
Do you think I shud give it a try as well?

Stack OverflowStack Overflow

Installation steps for xenomai 3 on Ubuntu 16.04

I would like to install Xenomai 3 on Ubuntu 16.04 LTS. I wan unable to find any proper installation guide/procedure for the same. Request help.

giuliomoro 1 hour ago

that involves installing a Xenomai-patched kernel , which I don’t recommend you do because you won’t be able to run the code on your computer anyhow (because it lacks a PRU!)

Dhruva gole 1 hour ago

hahaha yes true

giuliomoro 1 hour ago

so my understanding is that you’ll be building locally only until you get a beaglebone

Dhruva: YES

Dhruva gole 1 hour ago

so assuming the makefile will work, the additions to be made are according to our discussed workflow right? For starters I will try to make a flag for detecting cur_hardware

Dhruva gole 1 hour ago

cur_hw = 1 // BBB
cur_hw= 2 // BBAI
cur_hw = -1 // Not supported

Dhruva gole 1 hour ago

Until I get a BeagleBone, yes I will be building on my personal computer

giuliomoro 1 hour ago

where would that flag be? in the Makefile ?

giuliomoro 1 hour ago

[PS: I sent you a private message]

1

Dhruva gole 44 minutes ago

yes, in the makefile I was thinking?

Dhruva gole 42 minutes ago

as you had mentioned on the forum:
you can use `#ifdef` to make them conditional at compile time. The Makefile could detect whether we are running on an AM335x or an AM572x and define a flag accordingly

giuliomoro 40 minutes ago

Sure, that’s fine. Alternatively, we could make it a runtime flag, given how runtime detection will take place anyhow, but probably best to start with build-time detection, so it will also be easier to modify the PRU files.

1

giuliomoro 38 minutes ago

and anyhow, I understand that BB releases different images for AM5729 vs AM3358, so … build-time detection may just be the way forward.

Dhruva gole 36 minutes ago

Right