How to debug USB related issues?
Hi
I use the STM32L452 which is configured as a USB CDC device using CubeMX. The device is used as a "gateway" that connects a linux host to a CAN bus system (essentially a USB-to-CAN adapter). The linux host configures the USB device as an SLCAN based interface so that it appears a a CAN socket.
The USB communication typically works stable for a couple of weeks, but then suddenly the host is unable to send data to the device. It can, however, still receive packets from the device. It seems like the OUT direction gets broken in some way?
On the linux side, writing the socket gives me: "errno=105, error=No buffer space available".
I'm not asking for a concrete solution to this problem, but rather some good advice on how to debug a problem like this?
Do you have some hints on where to look? Maybe tools that could help me investigate the problem?
What makes it difficult is that the problem seems hard to reproduce and it only appears every few weeks. So I want to be prepared for the next time it happens and extract as much information as possible.
Thanks
/ abaldur