Custom Kernel for Beaglebone does not boot

Thanks for the quick answer!

In .config, I enabled LL-Debugging for beagle including earlyprintk. This, I did because of some research I did on how to debug booting process.

In case of gcc, i noticed that the build script actually installed the latest, but for u-boot I used the one listed in your post. I guess it does not matter?

The build script itself I did not change at all. It even compiled with -j1 because it did not get my number of cores (4).

But, as I have mentioned, the same “error” occurs with all previous attempts as well and I dont know what i am doing wrong at all. I am using Debian 9 VM on Windows 10.

Thanks a lot!

@eloa, over the years we really had nothing bug trouble with any “virtual machine” running on windows. Usually it came down to simply not correctly writing the files to the external flash device.

This is why all my directions specifically note:

* Running a recent release of Debian, Fedora or Ubuntu; without OS Virtualization Software.

I’ve pushed this build to one of my external servers, retry your microSD with these files.

http://rcn-ee.online/builds/deploy/4.14.78-bone17/

Regards,

1 Like

Thank you very much, Robert!

I’ve just downloaded your files directly to my microSD and replaced mine. And finally, my first custom kernel is booting and it seems to work perfectly. But, as I need to build my own kernel to patch it with Xenomai, i need to figure out what exactly goes wrong.

As it works with my own U-Boot configuration I guess the mistake must happen within the compiling process.

Usually it came down to simply not correctly writing the files to the external flash device.

So, what do you mean? Does the known error occur when copying the compiled files/archives from VM to SDcard or while compiling?

Best, eloa

@eloa, no it’s a bug somewhere in the; usb adapter - host os - vm stack - linux os… Where the real fix is just to natively run Debian/Ubuntu or Fedora by itself. Thus not wasting time debugging random “VM” issues…

For xenomai, use the ti-linux-xenomai-4.4.y branch from: https://github.com/RobertCNelson/ti-linux-kernel-dev it’s the last xenomai kernel i put any real effort into.

Regards,

1 Like

One more thing to add: I’ve just rebuilt the same kernel without the LL-debbuging and earlyprintk enabled in .config. And now my own kernel works, which is, first of all, awesome! Therefore, is it possible that the kernel does not boot because of those options enabled?

Ok, so my next step is gonna be to compile your xenomai-4.4 kernel. Thank you very much!

Best, Eloa

Oh and what about your xenomai-4.9 kernel, is this one not working trustworthy?

Thanks, Eloa

So in later kernel’s, you need to specify which “uart” LL-debugging is going to use. This is one reason it’s not enabled by default, as it very “board” specific.

The 4.9.x-xenomai branch really didn’t get any downstream users. Whereas the 4.4.x-xenomai branch is used by multiple groups and shipped by default in a few beagleboard based products today.

Regards,

1 Like

So in later kernel’s, you need to specify which “uart” LL-debugging is going to use. This is one reason it’s not enabled by default, as it very “board” specific.

That’s weird because I actually did this. I chose option “OMAP3 UART3” which was recommended somewhere online and which mentions “beagle” in its help window. So I cannot say why it leads to a not-working kernel.

Best, eloa

That’s for the original BeagleBoard (omap3 based) which used /dev/ttyO2 on bootup, the BeagleBone (am335x) uses /dev/ttyO0… Thus wrong usart…

edit: CONFIG_DEBUG_AM33XXUART1 should work…

Regards,

1 Like

Hello Robert,

I’ve successfully built your 4.4-xenomai kernel and its modules. To boot it, I replaced zImage- and .dtb-file and installed the modules to the existing rootfs (from previous 4.14 kernel). Apart from some errors, the kernel actually boots and “uname -r” says “4.4.113”. But, I am not able to run the “latency test” at “/usr/xenomai/bin/latency” and I do not notice any hint of the Xenomai patch. So, how can I test whether Xenomai actually works or not?

Thanks a lot,
Eloa

@Eloa, you should see “Xenomai” in the dmesg log:

debian@beaglebone:~$ uname -r ; dmesg | grep Xenomai
4.4.113-ti-xenomai-r149
[    0.723805] [Xenomai] scheduling class idle registered.
[    0.723819] [Xenomai] scheduling class rt registered.
[    0.723995] I-pipe: head domain Xenomai registered.
[    0.729165] [Xenomai] Cobalt v3.0.7 (Lingering Dawn) 

Regards,

@eloa, once you build xenomai’s userspace, you’ll get those bin’s…

git clone -b stable/v3.0.x http://git.xenomai.org/xenomai-3.git --depth=1
cd xenomai-3/
./scripts/bootstrap
./configure CFLAGS="-march=armv7-a -mfpu=vfp3" LDFLAGS="-march=armv7-a -mfpu=vfp3" --with-core=cobalt --enable-smp
make
sudo make install
debian@beaglebone:~/xenomai-3$ sudo /usr/xenomai/bin/latency 
== Sampling period: 1000 us
== Test mode: periodic user-mode task
== All results in microseconds
warming up...
RTT|  00:00:01  (periodic user-mode task, 1000 us period, priority 99)
RTH|----lat min|----lat avg|----lat max|-overrun|---msw|---lat best|--lat worst
RTD|      5.666|      8.313|     20.624|       0|     0|      5.666|     20.624
RTD|      4.458|      8.359|     21.958|       0|     0|      4.458|     21.958
RTD|      5.624|      8.804|     36.957|       0|     0|      4.458|     36.957
RTD|      5.582|      8.163|     18.249|       0|     0|      4.458|     36.957
RTD|      5.540|      8.172|     16.874|       0|     0|      4.458|     36.957
RTD|      5.540|      8.101|     16.457|       0|     0|      4.458|     36.957
RTD|      4.748|      8.071|     17.790|       0|     0|      4.458|     36.957
RTD|      5.581|      8.295|     31.998|       0|     0|      4.458|     36.957
RTD|      5.622|      8.079|     18.706|       0|     0|      4.458|     36.957
RTD|      5.581|      8.289|     17.331|       0|     0|      4.458|     36.957
RTD|      5.580|      8.008|     17.247|       0|     0|      4.458|     36.957
RTD|      5.580|      7.974|     20.080|       0|     0|      4.458|     36.957
RTD|      5.580|      8.481|     38.663|       0|     0|      4.458|     38.663
RTD|      5.538|      7.907|     19.038|       0|     0|      4.458|     38.663
RTD|      5.579|      7.800|     18.663|       0|     0|      4.458|     38.663
RTD|      1.038|      7.857|     19.579|       0|     0|      1.038|     38.663
RTD|      4.579|      7.713|     17.829|       0|     0|      1.038|     38.663
RTD|      5.537|      9.985|     34.995|       0|     0|      1.038|     38.663
RTD|      6.037|     10.913|     17.704|       0|     0|      1.038|     38.663
RTD|      6.162|     10.899|     17.662|       0|     0|      1.038|     38.663
RTD|      6.162|     10.881|     17.536|       0|     0|      1.038|     38.663
RTT|  00:00:22  (periodic user-mode task, 1000 us period, priority 99)
RTH|----lat min|----lat avg|----lat max|-overrun|---msw|---lat best|--lat worst
RTD|      6.161|     10.914|     17.911|       0|     0|      1.038|     38.663
RTD|      5.911|     11.044|     41.911|       0|     0|      1.038|     41.911
RTD|      5.911|     10.836|     18.494|       0|     0|      1.038|     41.911
RTD|      6.785|     10.897|     18.202|       0|     0|      1.038|     41.911
RTD|      5.119|     10.906|     18.869|       0|     0|      1.038|     41.911
RTD|      6.035|     10.909|     17.993|       0|     0|      1.038|     41.911
RTD|      5.868|     10.857|     18.285|       0|     0|      1.038|     41.911
RTD|      5.826|     10.788|     17.826|       0|     0|      1.038|     41.911
RTD|      5.826|     10.725|     17.034|       0|     0|      1.038|     41.911
RTD|      3.117|     10.715|     17.326|       0|     0|      1.038|     41.911
RTD|      5.784|     10.708|     18.075|       0|     0|      1.038|     41.911
RTD|      5.784|     10.739|     28.409|       0|     0|      1.038|     41.911
RTD|      5.700|     10.649|     17.242|       0|     0|      1.038|     41.911
RTD|      5.658|     10.693|     17.992|       0|     0|      1.038|     41.911
RTD|      5.700|     10.602|     17.824|       0|     0|      1.038|     41.911
RTD|      5.699|     10.526|     18.074|       0|     0|      1.038|     41.911
RTD|      5.616|     10.661|     49.824|       0|     0|      1.038|     49.824
RTD|      5.574|     10.459|     18.574|       0|     0|      1.038|     49.824
RTD|      5.615|     10.375|     17.532|       0|     0|      1.038|     49.824
RTD|      4.865|     10.438|     18.073|       0|     0|      1.038|     49.824
RTD|      5.740|     10.445|     27.865|       0|     0|      1.038|     49.824

Regards,

Good morning Robert, thank you for your answer!

debian@beaglebone:~$ uname -r ; dmesg | grep Xenomai
4.4.113-ti-xenomai-r149
[ 0.723805] [Xenomai] scheduling class idle registered.
[ 0.723819] [Xenomai] scheduling class rt registered.
[ 0.723995] I-pipe: head domain Xenomai registered.
[ 0.729165] [Xenomai] Cobalt v3.0.7 (Lingering Dawn)

This one works, I get the exact same output, just v3.0.6 instead of 7.

git clone -b stable/v3.0.x xenomai / xenomai · GitLab --depth=1
cd xenomai-3/
./scripts/bootstrap
./configure CFLAGS=“-march=armv7-a -mfpu=vfp3” LDFLAGS=“-march=armv7-a -mfpu=vfp3” --with-core=cobalt --enable-smp
make
sudo make install

Ah I need to build my own userspace on each beaglebone? The bootstrap returns the following error:

./scripts/bootstrap: 3: ./scripts/bootstrap: autoreconf: not found

What am I doing wrong?

Thank you very much!

Best, eloa

@eloa

You don’t need to build it on “every” unit, just build it once and then copy the files under /usr/xenomai/

Yes, you’ll need to install the build dependices, start with build-essential and autoconf

sudo apt update
sudo apt install build-essential autoconf

Regards,

You don’t need to build it on “every” unit, just build it once and then copy the files under /usr/xenomai/

Yes, you’ll need to install the build dependices, start with build-essential and autoconf

Thanks, that worked for the first line. But when running the second command (./configure …) I get a weird error which I could not fix with installing packages so far:

./configure: line 13838: syntax error near unexpected token 'FUSE, ’
./configure: line 13838: ` PKG_CHECK_MODULES(FUSE, fuse) ’

Sorry for bothering you with stuff like this!

Best, Eloa

pkg-config?

Regards,

Thats the one I tried first as well. Unfortunately, it does not work. It says its a syntax error, could I try to just edit the file?

Best, Eloa

NO, don’t edit the file, looking at:

sudo apt update
sudo apt install debhelper findutils autotools-dev autoconf automake libtool pkg-config libltdl-dev

Regards,

Thank you, but did not work either.

But, after having installed/updated all the packages, I ran the first command again. After that, the second worked as well.

And finally, I got Xenomai running on my Beaglebone Enhanced! Thank you so much for your help, Robert! I appreciate that!

Best, Eloa