Running Ubuntu Server 24.04.1 LTS on RevPi Connect 5

Topics about the Software of Revolution Pi
Post Reply
nishalan
Posts: 2
Joined: 11 Feb 2025, 20:25

Running Ubuntu Server 24.04.1 LTS on RevPi Connect 5

Post by nishalan »

Hi Revolution Pi Community

I have been trying to convert a Revolution Pi 5 running Bookworm to Ubuntu Server 24.04.1 LTS but have run into some issues. Whilst I can get the OS running, there are some very specific errors that I need to fix.

Below, I have added the issues that I am facing and the steps I have taken for the conversion.

Issues

1. Inconsistent CAN Interface
The CAN interface shows up inconsistently when rebooting. I noticed that when connected to a monitor through HDMI, can0 and can1 tend to show as an interface more regularly (sometimes only can0 will show), whilst without a monitor it usually does not show. My suspicion is that the boards firmware or device-tree configuration loads additional peripherals (like CAN) with HDMI.

2. Setting CAN Interface Up
When the CAN interface is available and I try to set the interface up (

Code: Select all

sudo ip link set can0 up type can bitrate 500000
), I get `Segmentation fault`. I thought that perhaps my user does not have permission to the address, but I have added my user to picontrol. Perhaps this is also due to initialisation issues on boot?

3. piTest Not Recognising Device
When running

Code: Select all

piTest -d
, I get `Cannot retrieve device list: No such device`. Again, my user is added to the picontrol. I have also used PiCtory to add the RevPi 5 module.

4. Incorrect Ethernet Naming
The system does not correctly name eth0 to eth1 and eth3 to eth0 as instructed, but rather keeps eth0 and eth3.

Ubuntu Server 24.04.1 LTS Setup

Note that I have closely followed debos-build (https://gitlab.com/revolut ... ype=heads), but have not done very specific Rasbian commands or excluded packages that were downloaded automatically with Ubuntu.

1. Plug USB-C to RevPi and laptop and power on
2. Run rpiboot from usbboot to recognise RevPi eMMC as bootable
3. Run Raspberry Pi Imager and image eMMC as Raspberry Pi 5, Ubuntu Server 24.04.1 with settings (username is developer)
4. When complete, power off device and remove USB-C
5. Power on (ideally connected to ethernet)
6. SSH into device/plug in monitor and keyboard

7. Update and Upgrade System

Code: Select all

sudo apt update
sudo apt upgrade
8. Add Repositories

Code: Select all

sudo nano /etc/apt/sources.list.d/_revpi.sources

Code: Select all

Types: deb
URIs: http://packages.revolutionpi.de/
Suites: bookworm
Components: main contrib
Signed-By: /usr/share/keyrings/_revpi-keyring.gpg

Types: deb
URIs: http://packages.revolutionpi.de/
Suites: bookworm-backports
Components: main contrib
Signed-By: /usr/share/keyrings/_revpi-keyring.gpg

Code: Select all

sudo nano /etc/apt/sources.list.d/raspi.sources

Code: Select all

Types: deb
URIs: http://archive.raspberrypi.org/debian/
Suites: bookworm
Components: main
Signed-By: /usr/share/keyrings/raspberrypi-archive-keyring.gpg

Code: Select all

sudo curl -o /usr/share/keyrings/_revpi-keyring.gpg "https://gitlab.com/revolutionpi/debos-build/-/raw/master/overlays/repositories/usr/share/keyrings/_revpi-keyring.gpg”
sudo curl -o /usr/share/keyrings/raspberrypi-archive-keyring.gpg "https://gitlab.com/revolutionpi/debos-build/-/raw/master/overlays/repositories/usr/share/keyrings/raspberrypi-archive-keyring.gpg”
9. Update and Upgrade

Code: Select all

sudo apt update
sudo apt upgrade
10. Install New and Remove Old RevPi Repo

Code: Select all

sudo apt install -y revpi-repo
sudo rm -rf "$ROOTDIR"/etc/apt/sources.list.d/_revpi.sources \
        "$ROOTDIR"/usr/share/keyrings/_revpi-keyring.gpg
11. Bootstrap System Apt

Code: Select all

sudo apt install -y raspi-firmware linux-image-revpi-v8 linux-headers-revpi-v8 revpi-base-files revpi-firmware revpi-tools
12. Install Minimum Packages

Code: Select all

sudo apt install -y busybox network-manager revpi-nm-config firmware-brcm80211 firmware-nxp
13. Setup Default User

Code: Select all

sudo usermod -aG adm,audio,dialout,input,netdev,plugdev,render,sudo,users,video developer

Code: Select all

sudo nano /etc/sudoers.d/developer

Code: Select all

developer ALL=(ALL) NOPASSWD: ALL
14. Enable SSH

Code: Select all

sudo systemctl enable ssh
15. Boot Configuration

Code: Select all

sudo cp /boot/firmware/overlays/revpi-dt-blob.dtbo /boot/firmware/dt-blob.bin
16. Installed Basic Packages

Code: Select all

sudo apt install -y picontrol pitest pictory-apache revpi-modbus-client revpi-modbus-server cockpit-revpi cockpit-revpi-redirect-apache
17. Add User to picontrol

Code: Select all

sudo adduser developer picontrol
18. Install Lite Packages

Code: Select all

sudo apt install -y can-utils python3-can libsocketcan-dev newpid gdbserver python3-revpimodio2 revpipyload python3-libgpiod python3-schema python3-revpi-device-info revpi-sos-report rfkill opcua-revpi-server mqtt-revpi-client raspberrypi-sys-mods dphys-swapfile apt-listchanges
19. Mask Services

Code: Select all

sudo systemctl mask raspi-config.service cpufrequtils.service
20. Disable Swapfile

Code: Select all

sudo systemctl disable dphys-swapfile
21. Install Default Packages

Code: Select all

sudo apt install -y noderedrevpinodes-server

Excluded:
- Change configuration value tmp-dir of sos.conf to /var/tmp
- Set absolute value for swapfile to 512 MB
- Default Image GUI packages
- revpi-bluetooth package

Thanks!
Nishalan Govender
Jnr Mechatronics Engineer
BATTALION Technologies
User avatar
nicolaiB
KUNBUS
Posts: 1020
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: Running Ubuntu Server 24.04.1 LTS on RevPi Connect 5

Post by nicolaiB »

That sound like an interesting approach. Lets debug this together - step by step. First we should focus on the kernel and the piControl kernel driver:

1. Check if the revpi kernel is used. What is the output of `uname -a`
2. Is there kernel driver piControl loaded? Check with lsmod. In our image this is done with the file /etc/modules-load.d/picontrol.conf which is part of the package picontrol-common
3. Check if the devicetree overlay has been loaded from the hat eeprom, by looking at the bootloader log: vclog -a -m. You can also check: cat /proc/device-tree/hat/product and cat /proc/device-tree/compatible

After this has been cleared, we can focus on the other parts.

Nicolai
nishalan
Posts: 2
Joined: 11 Feb 2025, 20:25

Re: Running Ubuntu Server 24.04.1 LTS on RevPi Connect 5

Post by nishalan »

Hi Nicolai

Thanks for your response. To clarify the setup:

1. It seems that the RevPi kernel is used:

Code: Select all

developer@ubuntu:~$ uname -a
Linux RevPi135644 6.8.0-1018-raspi #20-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 17 12:35:36 UTC 2025 aarch64 aarch64 aarch64 GNU/Linux
2. The piControl driver is not loaded, however the configuration file exists and picontrol-common has been downloaded through apt:

Code: Select all

developer@ubuntu:~$ lsmod | grep picontrol
developer@ubuntu:~$ cat /etc/modules-load.d/picontrol.conf 
# SPDX-FileCopyrightText: 2024 KUNBUS GmbH
#
# SPDX-License-Identifier: GPL-2.0-or-later

piControl
developer@ubuntu:~$ dpkg -l | grep picontrol-common
ii  picontrol-common                  2.3.1-1+deb12+3                         all          RevPi piControl kernel module package (common files)
3. The device tree overlay has been loaded:

Code: Select all

developer@ubuntu:~$ sudo vclog -a -m
004406.816: Initial voltage 800000 temp 63659
004603.963: avs_2712: AVS pred 8585 858500 temp 64758
004603.974: vpred 858 mV +0
004613.397: FB framebuffer_swap 1
004630.929: Select resolution HDMI0/2 hotplug 1 max_mode 2
004643.491: HDMI0 edid block 0 offset 0
004643.501: 00ffffffffffff004c2d1a0d56313130
004643.512: 091e010380301b782a5295a556549d25
004643.523: 0e5054bfef80714f81c0810081809500
004643.534: a9c0b3000101023a801871382d40582c
004643.545: 4500dd0c1100001e000000fd00324b1e
004643.555: 5111000a202020202020000000fc0053
004643.566: 3232463335300a2020202020000000ff
004643.577: 004846414e3230303832360a20200175
004656.137: HDMI0 edid block 1 offset 128
004656.148: 020311b14690041f13120365030c0010
004656.157: 00011d00bc52d01e20b8285540dd0c11
004656.166: 00001e8c0ad090204031200c405500dd
004656.175: 0c110000188c0ad08a20e02d10103e96
004656.184: 00dd0c11000018000000000000000000
004656.193: 00000000000000000000000000000000
004656.202: 00000000000000000000000000000000
004656.211: 00000000000000000000000000000050
004656.238: HDMI0: best-mode 2 (limit 2) 1920x1080 60 Hz CEA modes 18000d80000000000000000000000000 extensions 1
004656.252: Select resolution HDMI1/2 hotplug 0 max_mode 2
004656.295: FB0 disp 0 max-fb 1 1920x1080 stride 3840 base 0x3f800000
006799.139: dtb_file 'bcm2712-rpi-cm5-cm5io.dtb'
006863.912: Loaded overlay 'bcm2712d0'
007084.172: Loaded overlay 'revpi-connect5-can-can'
007084.184: dtparam: audio=on
007089.283: Unknown dtparam 'audio' - ignored
007089.302: dtparam: i2c_arm=on
007101.513: dtparam: spi=on
007509.030: Loaded overlay 'vc4-kms-v3d-pi5'
007621.862: Loaded overlay 'dwc2'
011363.691: Starting OS 11363 ms
011366.330: 00000040: -> 00000480
011366.347: 00000030: -> 00100080
011366.362: 00000034: -> 00100080
011366.379: 00000038: -> 00100080
011366.393: 0000003c: -> 00100080
developer@ubuntu:~$ cat /proc/device-tree/hat/product
RevPi Connect 5 2x CAN WLAN 32/8GB
developer@ubuntu:~$ cat /proc/device-tree/compatible 
kunbus,revpi-connect5-can-cankunbus,revpi-connect5brcm,bcm2712
I have also run the same commands on a RevPi 5 straight of the box running Bookworm and received almost the same output - bar a slightly different uname.

I hope this helps?
Last edited by nishalan on 21 Feb 2025, 09:47, edited 4 times in total.
Nishalan Govender
Jnr Mechatronics Engineer
BATTALION Technologies
nishalan
Posts: 2
Joined: 11 Feb 2025, 20:25

Re: Running Ubuntu Server 24.04.1 LTS on RevPi Connect 5

Post by nishalan »

In reponse to my last post, I realised that I am running kernel:
6.8.0-1018-raspi

Rather than:
6.6.0-revpi6-rpi-v8

Generally I would use GRUB to boot into the different kernel, but it seems that the RevPi does not support UEFI. If booting into the above kernel may be the issue, are there any suggestions on how to do so?
Nishalan Govender
Jnr Mechatronics Engineer
BATTALION Technologies
User avatar
nicolaiB
KUNBUS
Posts: 1020
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: Running Ubuntu Server 24.04.1 LTS on RevPi Connect 5

Post by nicolaiB »

To be honest I don't know how to use grub / uefi on a Raspberry Pi in general.
User avatar
nicolaiB
KUNBUS
Posts: 1020
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: Running Ubuntu Server 24.04.1 LTS on RevPi Connect 5

Post by nicolaiB »

Just read your reponse again: if you want to boot our kernel I would suggest du deinstall the ubuntu kernel or copy the respective vmlinuz file from boot to voor fiemware kernel8.img.
nishalan
Posts: 2
Joined: 11 Feb 2025, 20:25

Re: Running Ubuntu Server 24.04.1 LTS on RevPi Connect 5

Post by nishalan »

Hi Nicolai

After much toiling, I managed to figure out how I could flash the revpi kernel.

Update Flash Kernel

Code: Select all

sudo nano /etc/flash-kernel/db

Code: Select all

Machine: Raspberry Pi Compute Module 5 Rev 1.0
Kernel-Flavors: rpi-v8

Code: Select all

sudo flash-kernel
On reboot, the system uses the correct kernel (in this case 6.6.0-revpi7-rpi-v8).

Of the above mentioned issues, the ethernet naming seems to be sorted, however can0 and can1 do not present themselves. I also still cannot use `piTest -d`.

Any help and feedback on these issues would be appreciated.
Last edited by nishalan on 27 Feb 2025, 14:44, edited 1 time in total.
Nishalan Govender
Jnr Mechatronics Engineer
BATTALION Technologies
User avatar
nicolaiB
KUNBUS
Posts: 1020
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: Running Ubuntu Server 24.04.1 LTS on RevPi Connect 5

Post by nicolaiB »

Looks like it is failing to load the kernel modules. What does

- dmesg -lwarn,err
- vclog -a -m

show?
nishalan
Posts: 2
Joined: 11 Feb 2025, 20:25

Re: Running Ubuntu Server 24.04.1 LTS on RevPi Connect 5

Post by nishalan »

Hi Nicolai

I have managed to solve it!

Updating /boot/firmware/config.txt to the revpi one did the trick for all of my issues. Thanks so much for your help.

If anyone would like a documented Ubuntu conversion or an automated conversion (such as using an image), please respond here so that I can look at contributing towards the community.
Last edited by nishalan on 27 Feb 2025, 15:06, edited 1 time in total.
Nishalan Govender
Jnr Mechatronics Engineer
BATTALION Technologies
User avatar
nicolaiB
KUNBUS
Posts: 1020
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: Running Ubuntu Server 24.04.1 LTS on RevPi Connect 5

Post by nicolaiB »

That sound great. I think it would be really appreciated by others if you can document your steps here
Post Reply