0

I have an STM32 connected over USB to and OpenWRT Linux device and it appears under /dev/ttyACM0. I have a custom C application that communicates with it. In my C application the device basically is treated like a serial port.

Until now this always worked 100%, I could always read and write, I built a new image for my LIMA module and now suddenly I can no longer write to my STM32 from my C application.

However this works fine and the message is received by the STM: echo -n -e "\x02\x00\x01\x02" > /dev/ttyACM0

When I look in dmesg I do see something funny:

[ 389.334398] usb 1-1.3: new full-speed USB device number 11 using ehci-platform
[ 389.458391] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 424.476642] cdc_acm 1-1.3:1.0: failed to set dtr/rts

Do you guys know what might be after going wrong? Could some USB package that updated itself have screwed something up?

Engo
  • 39
  • 4
  • Did you see this question? https://stackoverflow.com/questions/47480214/connect-usb-scale-in-ubuntu-cdc-acm-says-failed-to-set-dtr-trs - it sounds like almost a complete duplicate – Anya Shenanigans Oct 25 '21 at 18:29
  • Thank you, it is related but not identical, i actually tried that fix and it did not work. I don't know if the dtr rts error is hindering me at all, it may have been there even when it was working for months. Write direct to /dev/ttyACm0 from console works still, just not from C – Engo Oct 25 '21 at 18:44
  • You can no longer write... do you get an error when you try? What function fails, what is errno? You can typically find out very quickly using ptrace. – Ben Voigt Oct 25 '21 at 22:02
  • I solved the issue, it seems Openwrt did some update of libusb driver, i backtracked it and it works again – Engo Nov 02 '21 at 13:48

0 Answers0