Unable to determine board revision from /proc/cpuinfo

Hi I’m using jetson nano, ubuntu, ros noetic and the wiringjet library to control a pca9685 servomotor controller, i converted the pca9685.ccp form wiringpi to wiringjet and changed the CMakelists.txt to

“add_library(libpca9685 STATIC ${LIBRARY_DIRS}/pca9685.cpp )
target_link_libraries(libpca9685 ${WIRINGJET_LIBRARIES} -lpthread)”

The code compiles without any errors, but when I launch the the driver, the process dies because of

“process[joint_controller-7]: started with pid [61875]
Oops: Unable to determine board revision from /proc/cpuinfo
→ No “Hardware” line
→ You’d best google the error to find out why.”
How can i fix this?
Thx in advance

Are you using the devkit or custom board for Jetson Nano?

Are you using L4T release or third-party OS for Jetson Nano?

Is there any result when you run the following command?

$ cat /proc/cpuinfo

Could you share the full serial console log for further check?

Hi thanks for the fast reply

I’m using:
apt-cache show nvidia-jetpack
Package: nvidia-jetpack
Version: 4.6-b199
Description: Ubuntu 20.04.6 LTS
uname -a
Linux nano 4.9.253-tegra #1 SMP PREEMPT Mon Jul 26 12:13:06 PDT 2021 aarch64 aarch64 aarch64 GNU/Linux

I tried to compile the code with:

PCA9685

add_library(libpca9685 STATIC ${LIBRARY_DIRS}/pca9685.cpp )
target_link_libraries(libpca9685 ${WIRINGJET_LIBRARIES} -lpthread -lwiringjet)
as recommended on github, but this shows:

/usr/bin/ld: -lwiringjet kann nicht gefunden werden
collect2: error: ld returned 1 exit status
/usr/bin/ld: -lwiringjet kann nicht gefunden werden
collect2: error: ld returned 1 exit status
make[2]: *** [hexapod_controller/CMakeFiles/test_joint_controller.dir/build.make:135: /home/jetson/hexapod_ros_ang/devel/lib/libtest_joint_controller.so] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:4776: hexapod_controller/CMakeFiles/test_joint_controller.dir/all] Fehler 2
make[1]: *** Auf noch nicht beendete Prozesse wird gewartet …
make[2]: *** [hexapod_controller/CMakeFiles/joint_controller.dir/build.make:135: /home/jetson/hexapod_ros_ang/devel/lib/libjoint_controller.so] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:4839: hexapod_controller/CMakeFiles/joint_controller.dir/all] Fehler 2
make: *** [Makefile:141: all] Fehler 2

without -lwiringjet the code compiles without errors but when I launch the the controller it dies with:

process[joint_controller-7]: started with pid [36968]
Oops: Unable to determine board revision from /proc/cpuinfo
→ No “Hardware” line
→ You’d best google the error to find out why.
[joint_controller-7] process has died [pid 36968, exit code 1, cmd /home/jetson/hexapod_ros_alt/devel/lib/hexapod_driver/joint_controller /joint_controller/joints_command:=/joints_command __name:=joint_controller __log:=/home/jetson/.ros/log/ed97aa48-2d79-11ee-84f7-17f602ff5f49/joint_controller-7.log].
log file: /home/jetson/.ros/log/ed97aa48-2d79-11ee-84f7-17f602ff5f49/joint_controller-7*.log

cat /proc/cpuinfo
processor : 0
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x1
CPU part : 0xd07
CPU revision : 1

Hope this helps, thx.
ps.: I saw this error when compiling wiringpi on the wrong platform, but I changed the pca9685.cpp to wiringjet…

include <unistd.h>
include

include <wiringJetI2C.h>
include <wiringJet.h>
include “pca9685.h”
include “pca9685_constants.h”

PCA9685::PCA9685(int i2c_bus, int device_address) :
i2c_bus_(i2c_bus), device_address_(device_address) {}

PCA9685::PCA9685(int device_address): PCA9685(1, device_address) {}

PCA9685::~PCA9685() {
device_sleep();
}

int PCA9685::connect() {
file_descriptor_ = wiringJetI2CSetup(i2c_bus_,device_address_);
// file_descriptor_ = wiringJetI2CSetup(device_address_);
// TODO: Can still return a positive fd if device is not connected
if (file_descriptor_ < 0) {
return -1;
}
set_all_pwm(0, 0);
// Set mode2
wiringJetI2CWriteReg8(file_descriptor_, MODE2, OUTDRV);
// Set mode1
wiringJetI2CWriteReg8(file_descriptor_, MODE1, ALLCALL);
// Wait for oscillator. Takes 500 microseconds
usleep(500);

// Wake the device
device_wake();
return 1;

}

void PCA9685::set_pwm_freq(float frequency_hz) {
frequency_hz_ = frequency_hz;
const float oscillator_clock_freq_hz = 25000000.0f;

// Refer to the PCA9685 documentation for details on the prescale value.
int prescale_val = static_cast<int>(std::round(oscillator_clock_freq_hz / (PWM_RESOLUTION * frequency_hz)) - 1.0f);

// Enter low power mode so we can set the prescale.
device_sleep();
wiringJetI2CWriteReg8(file_descriptor_, PRESCALE, prescale_val);
// Wake the device.
device_wake();
int current_mode = wiringJetI2CReadReg8(file_descriptor_, MODE1);
wiringJetI2CWriteReg8(file_descriptor_, MODE1, current_mode | RESTART);

}

void PCA9685::set_pwm(int channel, uint16_t on, uint16_t off) {
wiringJetI2CWriteReg8(file_descriptor_, LED0_ON_L + 4 * channel, on & 0xFF);
wiringJetI2CWriteReg8(file_descriptor_, LED0_ON_H + 4 * channel, on >> 8);
wiringJetI2CWriteReg8(file_descriptor_, LED0_OFF_L + 4 * channel, off & 0xFF);
wiringJetI2CWriteReg8(file_descriptor_, LED0_OFF_H + 4 * channel, off >> 8);
}

void PCA9685::set_pwm_ms(int channel, float ms) {
float period_ms = 1000.0f / frequency_hz_;
int bits_per_ms = static_cast(PWM_RESOLUTION / period_ms);
int bits = static_cast(ms * static_cast(bits_per_ms));
set_pwm(channel, 0, bits);
}

void PCA9685::set_all_pwm(uint16_t on, uint16_t off) {
wiringJetI2CWriteReg8(file_descriptor_, ALL_LED_ON_L, on & 0xFF);
wiringJetI2CWriteReg8(file_descriptor_, ALL_LED_ON_H, on >> 8);
wiringJetI2CWriteReg8(file_descriptor_, ALL_LED_OFF_L, off & 0xFF);
wiringJetI2CWriteReg8(file_descriptor_, ALL_LED_OFF_H, off >> 8);
}

void PCA9685::device_sleep() {
// Setting the bit at position 4 (SLEEP) to 1 will put it in lower power mode (sleep mode).
int current_mode = wiringJetI2CReadReg8(file_descriptor_, MODE1);
int new_mode = (current_mode & 0x7F) | SLEEP;
// Update mode
wiringJetI2CWriteReg8(file_descriptor_, MODE1, new_mode);
}
void PCA9685::device_wake() {
// Setting the bit at position 4 (SLEEP) to 0 will put it in normal mode (wake mode).
int current_mode = wiringJetI2CReadReg8(file_descriptor_, MODE1);
int new_mode = (current_mode & 0x7F) & ~SLEEP;
// Update mode
wiringJetI2CWriteReg8(file_descriptor_, MODE1, new_mode);
// Wait for oscillator.
usleep(500);
}

pss.: i managed to compile the code with linker -lwiringJet, but the error stays the same:
Oops: Unable to determine board revision from /proc/cpuinfo
→ No “Hardware” line
→ You’d best google the error to find out why.

Have you confirmed all the necessary lines connected correctly?

Could you help to clarify if you are having compiling issue?
PCA9685 seems the 3rd-party driver and we don’t verify it on the devkit.

If you have the issue with 3rd-party driver, you could ask the vendor for the porting guide or adding some messages in the driver to debug.

Hi yes i diretly ported the code by replacing wiringpi with wiringjet… the pca9685 driver works on the rpi4… and pca9685 was tested with the wiringjet library (but with a diffrent test.cpp).
I got no compiling issues! the error is odd, because it sounds like i#m using the wiringpi library on the jetson nano…
Yes i left a message on the wiringjet github page, but unfortunatley got no reply yet…

What’s the difference between wiringpi and wiringjet…?

please check with the device vendor for help. This is not a driver related to jetson and we cannot help.

For example, we totally don’t know what your code needs from /proc/cpuinfo.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.