undefined/home/david/.platformio/packages/tool-openocd-rp2040-earlephilhower/bin/openocd: error while loading shared libraries: libhidapi-hidraw.so.0: cannot open shared object file: No such file or directory
/home/david/.platformio/packages/toolchain-rp2040-earlephilhower/bin/arm-none-eabi-gdb: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
I’ve search and found the missing files so not sure what to do.
Thanks for the report. Indeed some needed dependencies for OpenOCD and GDB are not are statically compiled into the binary and should be better documented.
I’ll check on Linux Mint 21.2 myself to see which packages are needed or why it doesn’t startup.
david@david-iMac:~$ sudo apt install libtinfo5
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libtinfo5 is already the newest version (6.3-2ubuntu0.1).
libtinfo5 set to manually installed.
The following package was automatically installed and is no longer required:
libwmf0.2-7
Use 'sudo apt autoremove' to remove it.
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
david@david-iMac:~$ ldd ~/.platformio/packages/toolchain-rp2040-earlephilhower/bin/arm-none-eabi-gdb
linux-vdso.so.1 (0x00007fff92df3000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f1e98e94000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1e98e8f000)
libmpfr.so.6 => /lib/x86_64-linux-gnu/libmpfr.so.6 (0x00007f1e97f51000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f1e97d25000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1e98da8000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f1e98d86000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1e98d81000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1e97afd000)
libgmp.so.10 => /lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f1e97a7b000)
/lib64/ld-linux-x86-64.so.2 (0x00007f1e98ed9000
david@david-iMac:~$ sudo apt-get install -y libhidapi-hidraw0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libhidapi-hidraw0 is already the newest version (0.11.2-1).
The following package was automatically installed and is no longer required:
libwmf0.2-7
Use 'sudo apt autoremove' to remove it.
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
david@david-iMac:~$ sudo ldd ~/.platformio/packages/tool-openocd-rp2040-earlephilhower/bin/openocd
linux-vdso.so.1 (0x00007ffe7e5d8000)
libusb-1.0.so.0 => /lib/x86_64-linux-gnu/libusb-1.0.so.0 (0x00007f57136db000)
libhidapi-hidraw.so.0 => /lib/x86_64-linux-gnu/libhidapi-hidraw.so.0 (0x00007f57136d3000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f57136ce000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f57136c9000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5712dd8000)
libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007f571369d000)
/lib64/ld-linux-x86-64.so.2 (0x00007f571370e000)
avid@david-iMac:~$ ~/.platformio/packages/toolchain-rp2040-earlephilhower/bin/arm-none-eabi-gdb
GNU gdb (GDB) 13.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) Quit
(gdb)
Not sure if this is useful:
(gdb) show configuration
This GDB was configured as follows:
configure --host=x86_64-linux-gnu --target=arm-none-eabi
--with-auto-load-dir=$debugdir:$datadir/auto-load
--with-auto-load-safe-path=$debugdir:$datadir/auto-load
--with-expat
--with-gdb-datadir=/workdir/arm-none-eabi.x86_64/share/gdb (relocatable)
--with-jit-reader-dir=/workdir/arm-none-eabi.x86_64/lib/gdb (relocatable)
--without-libunwind-ia64
--without-lzma
--without-babeltrace
--without-intel-pt
--with-mpfr
--without-xxhash
--without-python
--without-python-libdir
--without-debuginfod
--without-guile
--disable-source-highlight
--enable-threading
--with-separate-debug-dir=/workdir/arm-none-eabi.x86_64/lib/debug (relocatable)
sh-5.1$ pio debug --interface=gdb -- -x .pioinit
[333 preload-host-spawn-strategy] Warning: waitpid override ignores groups
Warning! Please install `99-platformio-udev.rules`.
More details: https://docs.platformio.org/en/latest/core/installation/udev-rules.html
/home/david/.platformio/packages/tool-openocd-rp2040-earlephilhower/bin/openocd: error while loading shared libraries: libhidapi-hidraw.so.0: cannot open shared object file: No such file or directory
/home/david/.platformio/packages/toolchain-rp2040-earlephilhower/bin/arm-none-eabi-gdb: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
[333 preload-host-spawn-strategy] Warning: waitpid override ignores groups
sh-5.1$
I have installed the ‘99-platformio-udev.rules’ but not sure how to check.
But that’s very weird. ldd finds all libraries but in VSCOde it can’t find it? And VSCode is not running in a containerized environment like a flatpak?
Can you try executing sudo ldconfig and reboot the system and retry?
OK, that has helped a lot but not quite there yet (so much quicker!). When debugging I get:
Downloading...
Unpacking...
Tool Manager: tool-openocd-rp2040-earlephilhower@5.120300.230911 has been installed!
undefinedOpen On-Chip Debugger 0.12.0-g4d87f6dca (2023-09-11-23:12)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : Hardware thread awareness created
Info : Hardware thread awareness created
adapter speed: 1000 kHz
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : Using CMSIS-DAPv2 interface with VID:PID=0x2e8a:0x000c, serial=E66164084331B832
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: Atomic commands supported
Info : CMSIS-DAP: Test domain timer supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 0 TDI = 0 TDO = 0 nTRST = 0 nRESET = 0
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x0bc12477, DLPIDR 0x00000001
Info : SWD DPIDR 0x0bc12477, DLPIDR 0x10000001
Info : [rp2040.core0] Cortex-M0+ r0p1 processor detected
Info : [rp2040.core0] target has 4 breakpoints, 2 watchpoints
Info : [rp2040.core1] Cortex-M0+ r0p1 processor detected
Info : [rp2040.core1] target has 4 breakpoints, 2 watchpoints
Info : starting gdb server for rp2040.core0 on 3333
Info : Listening on port 3333 for gdb connections
Reading symbols from /home/david/Documents/PlatformIO/Projects/Greenhouse_Heater_2/.pio/build/pico/firmware.elf...
Warning: 'set target-async', an alias for the command 'set mi-async', is deprecated.
Use 'set mi-async'.
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = cmsis-dap
PlatformIO: Initializing remote target...
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
.pioinit:13: Error in sourced command file:
Remote replied unexpectedly to 'vMustReplyEmpty': timeout
That’s in general looking good, both Cortex-M0+ CPUs were detected, so the SWD connection is alright. I am not sure why it throws that error. Does uploading via upload_protocol = cmsis-dap work? Have you tried replugging the USB cables for a power cycle of the boards?
I’ve tried both of your suggestions but no luck. Nothing has changed.
It waits a while at this line (about a minute) before giving the first error. Both the yellow and green leds come on and stay on on the debug probe (D):
PlatformIO: Initializing remote target...
I have tried another computer (old Mac running same Linux Mint) and get the same error when debugging.
I’ve tried another Pico, made no difference.
I will look at buying another Debug Probe. Not sure what else to try! Any suggestions welcome.