I am attempting to reflash an older installation that uses a Creality CR-10S with a secondary stm32f103 as an expando-board for addons. I am having trouble flashing klipper v12 onto the stm32 because I am not able to compile hidlfash, apparently:
pi@odroid:~/klipper/lib/hidflash$ make
/bin/sh: line 1: pkg-config: command not found
hid-flash requires libusb-1.0, please install with:
sudo apt-get install libusb-1.0
pi@odroid:~/klipper/lib/hidflash$
pi@odroid:~/klipper/lib/hidflash$ sudo apt-get install libusb-1.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'libusb-1.0-0-dev' for regex 'libusb-1.0'
Note, selecting 'libusb-1.0-doc' for regex 'libusb-1.0'
Note, selecting 'libusb-1.0-0' for regex 'libusb-1.0'
libusb-1.0-0 is already the newest version (2:1.0.24-3).
libusb-1.0-0-dev is already the newest version (2:1.0.24-3).
libusb-1.0-doc is already the newest version (2:1.0.24-3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
libusb-1.0 is installed, or at least it appears to be. I am running this on an odroid computer with debian bullseye.
Does anyone know why I can’t compile hidflash and how do I fix it so it finds libusb-1.0?
Can I perhaps modify hid-libusb.c somehow to make it find libusb-1.0 which I apparently have installed? What am I missing?
Please, I’m ripping my hair out.
Thank you.
Edit:
Jesus F Christ.
SOLVED.
I checked the makefile for hidflash, and apparently it requires pkg-config, which my install did not have. For anyone else having this issue in the future, just install pkg-config.
Makefile line 19:
CHECK:=$(shell pkg-config --exists libusb-1.0 && echo 1)
pi@odroid:~/klipper/lib/hidflash$ pkg-config --exists libusb-1.0
-sh: pkg-config: command not found
pi@odroid:~/klipper/lib/hidflash$ sudo apt-get install pkg-config
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
pkg-config
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 62.4 kB of archives.
After this operation, 166 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main armhf pkg-config armhf 0.29.2-1 [62.4 kB]
Fetched 62.4 kB in 0s (203 kB/s)
Selecting previously unselected package pkg-config.
(Reading database ... 93263 files and directories currently installed.)
Preparing to unpack .../pkg-config_0.29.2-1_armhf.deb ...
Unpacking pkg-config (0.29.2-1) ...
Setting up pkg-config (0.29.2-1) ...
Processing triggers for man-db (2.9.4-2) ...
pi@odroid:~/klipper/lib/hidflash$ make
gcc -c -Wall -std=gnu99 -I . `pkg-config libusb-1.0 --cflags` main.c -o main.o
gcc -c -Wall -std=gnu99 -I . `pkg-config libusb-1.0 --cflags` hid-libusb.c -o hi d-libusb.o
gcc -c -Wall -std=gnu99 -I . `pkg-config libusb-1.0 --cflags` rs232.c -o rs232.o
gcc -no-pie main.o hid-libusb.o rs232.o `pkg-config libusb-1.0 --libs` -lrt -lpt hread -o hid-flash