Downgrade libusb and lib32-libusb to solve openocd doesn't work

After I upgrade lib32-libusb-1.0.25-2 and libusb-1.0.25-2, when I run open ocd command , I received some error like these:

❯ openocd  -f interface/stlink.cfg -f target/stm32f0x.cfg              

Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
[1]    18627 segmentation fault (core dumped)  openocd -f interface/stlink.cfg -f target/stm32f0x.cfg

Then I have checked dependence of “aur/openocd” package, it show four packages:

  • hidapi
  • libftdi-compat
  • libudev.so
  • libusb-compat

The last one——libusb-compat caught my eye,then I start checking for software update record(by software Pacmac). I have found these has been upgraded:

  • libusb (1.0.24-2 → 1.0.25-2)
  • lib32-libusb(1.0.24-1 → 1.0.25-2)

I start use downgrader to downgrade libusb and lib32-libusb, like this:

❯ downgrader  lib32-libusb          
                                                                             
 Downgrade package: lib32-libusb  
1: lib32-libusb-1.0.25-2  [installed]
2: lib32-libusb-1.0.25-1  (from ALA)
3: lib32-libusb-1.0.24-1  (from ALA)
4: lib32-libusb-1.0.23-2  (from ALA)
5: lib32-libusb-1.0.23-1  (from ALA)
6: lib32-libusb-1.0.22-1  (from ALA)
>> Please enter package number, [q] to quit 3
❯ downgrader  libusb       
                                                                                      
 Downgrade package: libusb  
1: libusb-1.0.25-2  [installed]
2: libusb-1.0.25-1  (from ALA)
3: libusb-1.0.24-2  (from ALA)
4: libusb-1.0.24-1  (from ALA)
5: libusb-1.0.23-3  (from ALA)
6: libusb-1.0.23-2  (from ALA)
7: libusb-1.0.23-1  (from ALA)
8: libusb-1.0.22-1  (from ALA)
>> Please enter package number, [q] to quit 3

After downgraded libusb and lib32-libusb, openocd work normally again, like this

❯ openocd  -f interface/stlink.cfg -f target/stm32f0x.cfg                                                        

Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Info : STLINK V2J36S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.201043
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : starting gdb server for stm32f0x.cpu on 3333
Info : Listening on port 3333 for gdb connections

I don’t know which developers should communicate this problem with, I don’t even know if it’s appropriate to post here. But I can’t seem to think of a more proper way now. So I share the solution here, hoping to help friends who encounter the same problem.

Was already reported and there might be a fix

1 Like
1 Like

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