[linuxcnc] Real time images for BBB

Hi There…

I use an instance of linuxcnc on a BeagleBone Black that is several years old. I would like to upgrade to a later real-time image, but I’m not sure what is the best path.

Does anyone have any advice?

Thanks,
Alan

This is my current version:
machinekit@beaglebone:~/linuxcnc-dev/src$ sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[5b2e16aa1e5c0f627f1d48a6dd1c13b446b9f53b]
eeprom:[A335BNLT00C05119BBBK0A00]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[Machinekit Debian Image 2019-09-15]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-gbb4af0f50f]:[location: dd MBR]
kernel:[5.10.56-bone-rt-r47]
nodejs:[v6.17.0]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[disable_uboot_overlay_emmc=1]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.14.20210821.1-0~stretch+20210923]
pkg:[bb-wl18xx-firmware]:[1.20211222.2-0~stretch+20211222]
pkg:[kmod]:[23-2rcnee1~stretch+20171005]
WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~stretch+20200305]
groups:[machinekit : machinekit adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev gpio pwm eqep remoteproc admin spi tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 rng_core.default_quality=100 quiet]
dmesg | grep remote
[ 1.708106] remoteproc remoteproc0: wkup_m3 is available
[ 2.344402] remoteproc remoteproc0: powering up wkup_m3
[ 2.349083] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148
[ 2.349338] remoteproc remoteproc0: remote processor wkup_m3 is now up
dmesg | grep pru
[ 2.205070] sysfs: cannot create duplicate filename ‘/bus/platform/devices/4a300000.pruss’
dmesg | grep pinctrl-single
[ 1.840312] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END

1 Like

Seth

Grab either: https://forum.beagleboard.org/tag/latest-images

and then install the kernel you want…

https://forum.beagleboard.org/t/debian-10-x-11-x-kernel-updates/30928

Regards,

Perfect! Thanks so much!

@AlanMThomason ,

Hello…it builds. There are a ton of dependencies but just remember:

  1. ./automake
  2. ./configure --enable-non-distributable=yes --target=uspace
  3. make

That will get you far on the BBB itself or by CC’ing to the BBB after installing all the dependencies.

Seth

Hello @AlanMThomason ,

Sorry to disturb you again. It seems that there is, of course, not enough memory on the BBB to handle the make portion of the build. So, I will attempt this build on a debian machine soon.

Seth

P.S. I could not get Debian Bullseye to cross_compile on the amd64 machine yet for LinuxCNC so porting to the armhf machine would be available for the BBB. Dang! It was fun, though. Something about LinuxCNC still requiring python but not allowing python libboost to properly work on the Bullseye images. Anyway, if you want a cross_compile error output, let me know. Also, it said PIE. ?

I’ve tried to build this from time to time and back port to Bullseye…

https://packages.debian.org/source/bookworm/linuxcnc

Let’s fire it off again…

Regards,

1 Like

Hello…

@RobertCNelson , this would be awesome. I will keep w/ it. If you and the other fellow want my build script error, it is still up. I can post it in case you guys got further down the build than I…

Seth

P.S. @RobertCNelson , would my libboost-python-dev error be due the lack of python (not python3) on the Bullseye distros and LinuxCNC not updating their build to handle specifically python3 only?

Also…current times versus the future times:

  1. Current
/usr/bin/ld: ../lib/librs274.so.0: undefined reference to `boost::python::detail::tuple_base::tuple_base(boost::python::api::object const&)'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make: *** [emc/task/Submakefile:39: ../bin/milltask] Error 1

I am probably missing something. Anyway, here is the bookworm versioning output:

  1. Future
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make: *** [emc/task/Submakefile:39: ../bin/milltask] Error 1

Seems like a linker file issue. That is just the end of the output. The output spanned more lines than I have currently available in the terminal. If you guys need me to do things, let me know.

Seth

P.S. Okay…Okay. So the cross_compile of the LinuxCNC is done. I made it for armhf…

This means, porting time, I will need to place it on the BBB somehow. Does sftp work w/ .so files? Hmm. I will check.

Sir,

@RobertCNelson , look here below.

sudo apt install bbb.io-kernel-5.10-ti-rt-am335x

That command turns the BBB into an infinite loop machine that does not boot.

Seth

P.S. Are people working on this effort to finalize the issue or is this issue even known? I was wrong…

The reason I was wrong about the above command is that the RelayCape was onboard the BBB. It works.

I’m a bit confused…it sounds like buidling on the BeagleBone will not work from your note about limited memory. So, on a host Ubuntu (actually WSL) machine…

  1. ./automake has not worked for me yet. I’ve never used this before, so probably doing something silly.

  2. shouldn’t the configure be setting me up for the specific real time kernel? The instructions here
    Building LinuxCNC
    indicate that I should have the correct real time header installed. Just to confirm, I am on a build machine (actually WSL). When I look for the header, I thought I should see one applicable to real time kernel 5.15 for the beaglebone, but I don’t find that.

  3. When you say CC’ing do you mean copying to the beaglebone?

  4. Is the general idea to create an installable package and then sudo apt-get install that package on the beaglebone?

If moving to a dedicated Ubuntu machine is the issue, I can definitely do that.

Thanks so much for the fast responses today!

available packages on build machine for 5.15:
linux-headers-5.15.0-1003-intel-iotg - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1006-gcp - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1007-azure - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1007-oracle - Oracle Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1008-azure - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1008-intel-iotg - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1010-intel-iotg - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1011-gke - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1012-gcp - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1013-azure - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1013-gcp - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1013-oracle - Oracle Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1014-aws - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1014-azure - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1014-gke - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1015-aws - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1015-gke - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1015-intel-iotg - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1016-gcp - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1016-gke - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1016-intel-iotg - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1016-oracle - Oracle Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1017-aws - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1017-azure - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1017-gcp - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1017-intel-iotg - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1017-oracle - Oracle Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1018-gcp - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1018-oracle - Oracle Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1019-aws - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1019-azure - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1019-gke - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1019-oracle - Oracle Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1020-aws - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1020-azure - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1021-aws - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1021-azure - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1021-gcp - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1021-oracle - Oracle Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1022-aws - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1022-azure - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-33-generic - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-33-lowlatency - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-41-generic - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-42-lowlatency - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-43-generic - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-43-lowlatency - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-46-generic - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-46-lowlatency - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-48-generic - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-48-lowlatency - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-50-generic - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-50-lowlatency - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-52-generic - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-52-lowlatency - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-gke-5.15 - Linux kernel headers for gke systems.
linux-headers-5.15.0-1003-gkeop - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1005-gkeop - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1007-gkeop - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-gkeop-5.15 - Headers for the GKEOP kernel

1 Like

Cross_Compiling is what I did mean…but copying to the BBB needs to be done too.

Seth

Oh…

P.S.

  1. ./autogen.sh is in /src/
  2. Build on an actual Debian Distro if at all possible, i.e. it will make set up time easier.
    a. The linux-headers are an issue on WSL2.
    b. The real-time kernel is listed where @RobertCNelson listed it.
  3. Cross_Compiling is what I meant
  4. That would work…hopefully.

Seth

@AlanMThomason ,

Also…there are many dependencies that need to be installed, i.e. whether this is for 4.19.x Buster or 5.10.x Bullseye or 5.15.x or whatever kernel you are using.

Seth

P.S. If you get the dependencies down pat, building becomes a lot easier.

Hello @RobertCNelson ,

I know it is late… And it is Fri. night. So, no big woof if no replies. I understand. One thing I am missing here is the correct headers from the toolchain for arm-linux-gnueabihf-.

Is there a way to install the headers on a development system and then I think I can port the build.

Seth

P.S. Anyway, I will wait to hear your well thought out answering. I have been building all day and kernel headers for 5.10.x are not easy to come by for now, i.e. arm headers.

They are a kernel module…

modprobe kheaders
rm -rf $HOME/headers
mkdir -p $HOME/headers
tar -xvf /sys/kernel/kheaders.tar.xz -C $HOME/headers >/dev/null
cd my-kernel-module
make -C $HOME/headers M=$(pwd) modules
rmmod kheaders
1 Like

Hello,

I tried these commands on my dev. desktop. I can no longer retrieve the kernel headers…

Was I supposed to try these commands on the BBB?

Seth

P.S. Dang it. I forgot the first command! Dang it! Sir, I messed up. Anyway, off to tomorrow.

Also, I am not sure how to handle those commands. cd my-kernel-module comes from where? I could not find this file either on the BBB or the dev. desktop.

@sliver2row

  1. OK, is automake the same as autogen? I’ve only used (dumbly following instructions) the make command on other projects where everything was already set up.
  2. I’ve moved to a dedicated machine (Ubuntu 20.04.5 LTS), but I can only find these candidates for install via apt. I was expecting to find something that specified an ARM machine for the 5.15 kernel plus the version. I had previously used the location indicated by Robert to install the real time kernel on the Beaglebone, but I don’t see where I would find the header files suggested at in the build instructions for linuxcnc…

linux-gkeop-5.15 - Complete GKEOP Linux kernel and headers
linux-gkeop-5.15-headers-5.15.0-1003 - Header files related to Linux kernel version 5.15.0
linux-gkeop-5.15-headers-5.15.0-1005 - Header files related to Linux kernel version 5.15.0
linux-gkeop-5.15-headers-5.15.0-1007 - Header files related to Linux kernel version 5.15.0
linux-gkeop-5.15-headers-5.15.0-1008 - Header files related to Linux kernel version 5.15.0
linux-gkeop-edge - Complete GKEOP Linux kernel and headers
linux-headers-5.10.0-1008-oem - Linux kernel headers for version 5.10.0 on 64 bit x86 SMP
linux-headers-5.15.0-1003-gkeop - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1005-gkeop - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1007-gkeop - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP
linux-headers-5.15.0-1008-gkeop - Linux kernel headers for version 5.15.0 on 64 bit x86 SMP

if I apt search on the beaglebone (apt-cache search), I see many candidates, the closest looking is…
linux-headers-5.15.73-bone-rt-r31 - Linux kernel headers for 5.15.73-bone-rt-r31 on armhf

But that’s on the Beaglebone. The whole process feels pretty strange, like I’m just going about this the wrong way. The apt search is producing results that suggest the eventual install would affect the build machine itself. In other words, it is not looking for packages to install that could be used for cross compiling, but instead that are filtered for the characteristics of the build machine.

Thanks again…Alan

1 Like

I think I’m at the same place as Seth now (at least in this build process!).

When I expand the kheaders.tar.xz I see:
~/headers/arch$ ls
x86

I did a find, and cannot find anything that matches bbb, arm, am

alan@alan-HP-EliteBook-8770w:~/headers$ find -name am3
alan@alan-HP-EliteBook-8770w:~/headers$ find -name bbb
alan@alan-HP-EliteBook-8770w:~/headers$ find -name arm
./include/xen/arm
./include/dt-bindings/arm

I’ll keep looking, and thanks for the support…Alan

Looking at the directions again… Why do you want to build for rtai? Just build for uspace which doesn’t require headers…

1 Like

Speaking for myself, I’m new to this build process so every chance I am on the wrong path. Since I am building on a 64bit PC for the BeagleBone ARM debian real-time kernel 5.15, how do I inform the compile process of this? The only time I’ve done true cross compiling in the past, smarter people than me had already set up the build process and I just had to start a script running, so this has been quite a learning process!