librobotcontrol (5.10 kernel and bullseye)

Thank you for doing this awesome work.

I have just a small question. Is it somehow possible to get GitHub - beagleboard/librobotcontrol: Robotics Focused library for embedded Linux computers. to work on Debian 11 or 12? It looks like that it is not installable with apt and building requires kernel 4.x.

I would at least give a try building it from source and see what happens. Just looked it over and it just C so you might be okay with it. If it fails let us know and we might be able to help you with it. You will need to load the correct device tree for the PRU to work.

That project utilizes v4.14.x-ti and v4.19.x-ti’s remoteproc pru… it still needs to be ported to v5.10.x-ti’s…


Thanks for your reply.

Well, I made the following

git clone
cd librobocontrol

root@BeagleBone:/home/debian/librobotcontrol# make
made: build/bmp/bmp.o
src/model.c: In function 'rc_model_category':
src/model.c:172:9: warning: implicit conversion from 'rc_model_t' to 'rc_model_category_t' [-Wenum-conversion]
  172 |  return current_model;
      |         ^~~~~~~~~~~~~
made: build/model.o
made: build/cpu.o
made: build/button.o
made: build/dsm.o
made: build/deprecated.o
made: build/time.o
In file included from include/rc/mavlink/common/../protocol.h:83,
                 from include/rc/mavlink/common/common.h:30,
                 from include/rc/mavlink/common/mavlink.h:32,
                 from include/rc/mavlink_udp.h:31,
                 from src/mavlink_udp.c:28:

some more warnings...

include/rc/mavlink/common/./mavlink_msg_landing_target.h: In function 'mavlink_msg_landing_target_encode_chan':
include/rc/mavlink/common/./mavlink_msg_landing_target.h:232:358: warning: taking address of packed member of 'struct __mavlink_landing_target_t' may result in an unaligned pointer value [-Waddress-of-packed-member]
  232 | _usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y, landing_target->x, landing_target->y, landing_target->z, landing_target->q, landing_target->type, landing_target->position_valid);

made: build/mavlink_udp.o
made: build/encoder.o
made: build/pru/encoder_pru.o
made: build/pru/pru.o
made: build/pru/servo.o
made: build/mpu/mpu.o
made: build/math/filter.o
made: build/math/polynomial.o
made: build/math/matrix.o
made: build/math/quaternion.o
made: build/math/kalman.o
made: build/math/algebra_common.o
made: build/math/ring_buffer.o
made: build/math/other.o
made: build/math/vector.o
made: build/math/algebra.o
made: build/motor.o
made: build/pinmux.o
made: build/led.o
made: build/io/spi.o
made: build/io/gpio.o
made: build/io/i2c.o
made: build/io/uart.o
made: build/io/encoder_eqep.o
made: build/io/pwm.o
made: build/io/adc.o
made: build/start_stop.o
made: build/pthread.o
made: build/version.o
Done making lib/
made: bin/rc_model
made: bin/rc_test_motors
made: bin/rc_test_leds
made: bin/rc_test_polynomial
made: bin/rc_dsm_passthrough
made: bin/rc_altitude
made: bin/rc_test_encoders_eqep
made: bin/rc_test_drivers
made: bin/rc_kill
made: bin/rc_test_vector
made: bin/rc_test_encoders_pru
made: bin/rc_calibrate_gyro
made: bin/rc_calibrate_dsm
made: bin/rc_cpu
made: bin/rc_check_battery
made: bin/rc_test_servos
made: bin/rc_calibrate_accel
made: bin/rc_blink
made: bin/rc_test_complementary_filters
made: bin/rc_test_dsm
made: bin/rc_test_time
made: bin/rc_uart_loopback
made: bin/rc_test_kalman
made: bin/rc_test_escs
made: bin/rc_test_encoders
made: bin/rc_test_dmp_tap
made: bin/rc_spi_loopback
made: bin/rc_test_matrix
made: bin/rc_calibrate_mag
made: bin/rc_test_filters
made: bin/rc_test_dmp
made: bin/rc_bind_dsm
made: bin/rc_test_pthread
made: bin/rc_version
made: bin/rc_calibrate_escs
made: bin/rc_test_bmp
made: bin/rc_benchmark_algebra

root@BeagleBone:/home/debian/librobotcontrol# make install
PRU Firmware Install Complete
Library Install Complete
Examples Install complete
rc_battery_monitor Service Install Complete
robotcontrol Service Install Complete

root@BeagleBone:/home/debian/librobotcontrol# make all
make[1]: 'lib/' is up to date.
make[1]: Nothing to be done for 'all'.
make[1]: Nothing to be done for 'all'.
make[1]: Nothing to be done for 'all'.

root@BeagleBone:/home/debian/librobotcontrol# reboot

sadly, beagle-versions returns WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]

Do you have an idea?

edit: unfortunately, the install shell script from Robot Control Library: Installation & Checking Functionality is not present in the repository.

I would open/checkout your own branch and try to fix the warning. That is something that will be problematic even if you did get it to run.

What is beagle-versions? assuming it is a test script?

non-issue, that’s just looks at the dpkg database…


non-issue, that’s just looks at the dpkg database…

well, I understand. So after compiling it again from source on a fresh minimal bullseye image, at least the battery monitor works.

So this isn’t a thing that I can fix on the fly, is it? I am just a hobby programmer so maybe someone has a few buzzwords i should look into to get it maybe somehow to work :sa:

I appreciate that you have taken your time for my issues.

root@BeagleBone:/home/debian# rc_test_drivers 

Kernel: 5.10.140-ti-r52 Debian Bullseye Minimal Image 2022-11-01
Debian: 11.5

PASSED: gpio 0
PASSED: gpio 1
PASSED: gpio 2
PASSED: gpio 3
ERROR:  ti-pwm driver not loaded for hrpwm0
ERROR:  ti-pwm driver not loaded for hrpwm1
ERROR:  ti-pwm driver not loaded for hrpwm2
ERROR:  ti-eqep driver not loaded for eqep0
ERROR:  ti-eqep driver not loaded for eqep1
ERROR:  ti-eqep driver not loaded for eqep2
PASSED: pru-rproc
ERROR:  uart1 driver not loaded
ERROR:  uart2 driver not loaded
ERROR:  uart4 driver not loaded
ERROR:  uart5 driver not loaded
ERROR:  i2c1 driver not loaded
PASSED: i2c2
ERROR: spi driver not loaded

Currently running on a:
Robot Control library Version:
root@BeagleBone:/home/debian# rc_battery_monitor 

2S Pack   Jack   #Cells   Cell
 7.20V   0.00V	 0	 0.00V   ^Cbattery_monitor exiting cleanly

pwm, we had carried a patch since 3.8, for udev to work, sadly what finally went mainline mid 5.4~-ish, is a little different…


debian@21-am335x-bbb:~$ uname -r ; tree /sys/class/pwm/pwm-0\:0/
├── capture
├── device -> ../../pwmchip0
├── duty_cycle
├── enable
├── period
├── polarity
├── power
│   ├── async
│   ├── autosuspend_delay_ms
│   ├── control
│   ├── runtime_active_kids
│   ├── runtime_active_time
│   ├── runtime_enabled
│   ├── runtime_status
│   ├── runtime_suspended_time
│   └── runtime_usage
├── subsystem -> ../../../../../../../../class/pwm
└── uevent

3 directories, 15 files


debian@24-am335x-bbb:~$ uname -r ; tree /sys/class/pwm/pwmchip0/
├── device -> ../../../48300100.pwm
├── export
├── npwm
├── power
│   ├── async
│   ├── autosuspend_delay_ms
│   ├── control
│   ├── runtime_active_kids
│   ├── runtime_active_time
│   ├── runtime_enabled
│   ├── runtime_status
│   ├── runtime_suspended_time
│   └── runtime_usage
├── pwm0
│   ├── capture
│   ├── duty_cycle
│   ├── enable
│   ├── period
│   ├── polarity
│   ├── power
│   │   ├── async
│   │   ├── autosuspend_delay_ms
│   │   ├── control
│   │   ├── runtime_active_kids
│   │   ├── runtime_active_time
│   │   ├── runtime_enabled
│   │   ├── runtime_status
│   │   ├── runtime_suspended_time
│   │   └── runtime_usage
│   └── uevent
├── subsystem -> ../../../../../../../../../../class/pwm
├── uevent
└── unexport

5 directories, 28 files

Another 3.8 based patchset that has a mainline replacement… “counter”…

This is the real fun one, ti’s 5.10 remotproc changed again… honestly this should be converted to ‘uio’ and then we won’t have to worry about kernel versions ever again… (this lib has been patched to work on 4.14.x-ti, 4.19.x-ti…)

These should all be device-tree changes.