Install Libmraa on Buster

On a Pi 4A here and trying to install Libmraa on OMV5 on a Buster build.
I tried “buster-stable” but there is no “rockchip-fstab and rockpi4-dtbo” packages in the repo.
I tried next the “-testing” repo as well and got a bunch of “-fstab” errors.
Any quick fixes until the stable repo will get updated?

Hi hwaas,

After modifying repo, whether apt update?

Hi, that two packages you mentioned are not maintained in Radxa APT buster-stable and buster-testing. Instead, you can use stretch-stable branch like this.

  export DISTRO=stretch-stable
  echo "deb http://apt.radxa.com/$DISTRO/ ${DISTRO%-*} main" | sudo tee -a /etc/apt/sources.list.d/apt-radxa-com.list
  wget -O - apt.radxa.com/$DISTRO/public.key | sudo apt-key add -
  sudo apt-get update
  sudo apt-get install -y rockchip-fstab
  sudo apt-get install -y rockpi4-dtbo

Hi setq,
yeah ofc, did update after adding the repo.

Hi Stephen,
will try, wasn’t aware that the old stretch packages will work on buster.

Right so let me give you an update. I still can’t finish up the installation. I haven’t had enough time to debug it tho. It seems the rockchip-fstab installs but it breaks at configuration step:

Setting up rockchip-fstab (0.1) …
sed: -e expression #1, char 0: no previous regular expression
mount all partitions
mount: vfat: mount point does not exist.
mount: vfat: mount point does not exist.
mount: vfat: mount point does not exist.
mount: vfat: mount point does not exist.
mount: vfat: mount point does not exist.
mount: vfat: mount point does not exist.
mount: vfat: mount point does not exist.
dpkg: error processing package rockchip-fstab (–configure):
installed rockchip-fstab package post-installation script subprocess returned error exit status 32
Errors were encountered while processing:
rockchip-fstab
E: Sub-process /usr/bin/dpkg returned an error code (1)

First thing was to delete the cached .debs to exclude any corrupted package possibility.
Well, still no luck.
No idea yet what I’m doin wrong…

The main problem here is all your packages are for the 4.4 kernel only!
Would you guys care to provide some info on how to do it with the 5.4?
Lol, just pls don’t say “sorry 5.4 is unsupported”.

I’ll try to compile it myself if needed, just need some pointers. Thanks!

Secondly my board seem to be 1.4, its got however no SPI flash installed… ? I specifically bought 1.4 cause of that. Now I’m confused … what board did innet24.de sent me then?

If not, there are other options: https://github.com/sgjava/userspaceio

… while I haven’t done anything with it.

Thanks, I am considering that, its seems however this brings new issues along, like userspaceio for instance needs kernel ≥ 5.5.x so i’d need to use some nightly buster image which will ofc bring newer issues.

This is your by far best option https://dl.armbian.com/rockpi-4b/Focal_dev_minimal_nightly … or Debian variant if you DIY https://github.com/armbian/build

Yeah I’ll better build it myself, need to ensure compatibility to OMV as well.

Any ideas how can the radxa overlays be used with the mainline kernel?

Nvm, got that going.

Well I ended up compiling libgpiod with python bindings. Enabled w1-gpio overlay, using it from it python3.7 with my own wrapper. Got all the pins working.
Got stuck however on the using the hardware PWM.
I am on 5.6.7 with the standard rk3399-rock-pi-4.dtb.
Rockpi 4 should have one chip :

ls -l /sys/class/pwm/
pwmchip0 -> …/…/devices/platform/ff420020.pwm/pwm/pwmchip0

✓check

… with two channels:

cat /sys/class/pwm/pwmchip0/npwm
1

So only one channel showing up…

and this one seems to be used up in the device tree so it’s busy ofcourse:

cat /sys/kernel/debug/pwm
platform/ff420020.pwm, 1 PWM device
pwm-0 (vdd-log ): requested enabled period: 25000 ns duty: 3997 ns polarity: inverse

So what’s happening here? Where is the other channel?

First guess is that I need to recompile the rk3399-rock-pi-4.dts with some changes.
Or i need a separate PWM overlay to load at the boot?

Any bit of help here will be awesomely appreciated.Thanks!

Right so… compiled the latest buster trunk with no change. Went back to 5.3 stable, still nothing.
Mmmm dunno from here.

Then you need to dig deeper and port functionality from somewhere else … can’t tell without research.

Yes Igor I am trying to dig deeper, i know i’ve got to enable the PWM in the DT overlay. Now it shouldn’t be that hard, for someone proficient with DT lang. However this is all new to me.
A little support from the radxa reps… wouldn’t be that hard now wouldn’t it?

Anyway for the DT bindings I’ve looked up in the RK3399 SoC dtsi and in the rockpi4 dts

arch/arm64/boot/dts/rk3399.dtsi
arch/arm64/boot/dts/rk3399-rock-pi-4.dts .

Now if i want to activate…say the first pwm channel and i patch the rockpi dts with a dummy node with the ‘status’ set to ‘okay’:

&pwm0 {
status = “okay”;
};

or add pinctrl group info:

&pwm0 {
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_pwmo>; /* GPIO4_C2, gpiochip4@line18 */
status = “okay”;
};

i’m getting stuck @ “…Starting the kernel”.
Will see how i’ll go next

I am having the same issues as this. Specifically:

  • mount: vfat: mount point does not exist. after apt install rockchip-fstab
  • Unable to locate package libmraa-rockpi4 after adding radxa apt: wiki.radxa.com/Rockpi4/radxa-apt
  • No pins after building libmraa from source.

Are there solutions to any of these problems?

Related to: