-
-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WSL2] Null bytes in virtual com port with a stlinkv2.1 #111
Comments
Apart from the large burst of:
log entries (which is a bit odd, but not wrong per se), I see nothing weird in the log. But |
minicom gives similar output
And switching to hex output gives a bunch of zeros
|
Given the The question really is, why does the pipe stall so often in the first place? I cannot explain that. The first few stalls are normal, for endpoint 0, during device setup. Unfortunately, I have no further clues on what is going wrong here... |
@bhav97 |
Thanks for the update! |
Thanks for testing. I'll keep trying... |
Hi! There was an error from my side. While installing there was a conflict due to powertoys awake and I think the installation wasn't completed properly. I uninstalled and reinstalled and got some logs again. No difference but here's the updated log file. Let me know if you need anything else |
@bhav97 |
Hi @dorssel , thanks for the update I'll collect some tshark logs as well Here's a tshark capture of attach, read data, detach |
@bhav97
To me this looks like: it is a custom firmware, where the device is supposed to spit out "Helloxxx\a" repeatedly. The packets quickly return 32 characters at a time, but the last one ends after 22 packets with a truncated packet at the 16-byte mark. Then NULs. Looks a lot like "buffer overrun" in the buffered serial output. I'm sorry, but I don't see anything wrong in the USBIP protocol, nor in the USB request, nor in |
Hi @dorssel , You're right the firmware simply prints out Helloxxx over UART. The onboard STlink serves the UART data over the VCOM. It works on Ubuntu20.04 and Win11.
I'm not sure if this behavior is because of different handling of bulk requests on these two platforms so I'll try collecting tshark logs on Ubuntu as well for a more appropriate comparison. Btw I use tio/minicom on WSL/Ubuntu and PuTTY on Windows. Here's the capture from the Windows host |
@bhav97 On WSL, the device is first booted, and then it takes a while before the attach happens and the Linux tty driver starts reading. In this time, it looks like the device is filling a buffer internally, because the USB requests haven't started yet. When the attach and Linux driver are finally loaded, the first USB requests start draining the buffer, returning 32 characters at a time. Your WSL capture did show that after a while, also on WSL the characters come in 1 at a time, without the NULs. Can you confirm this? My guess: on WSL the device needs to buffer the period from USB power up to 'attach + Linux driver load'. That goes somewhat OK (32 characters at a time for a while) but end in NULs because the device has overflowed its buffers. You don't see this on native Windows/bare Linux, because there is hardly any delay between power up and driver load. |
Root cause seems to be user firmware. Closing issue. |
Hi
I am running into a weird issue while using the stlink on my STM8 Nucleo-32 board. I have updated the stlink firmware to the latest available (V2J27M7) but the issue persists.
If I open the serial port on a windows application, everything works expected. After using usbipd to attach to wsl, I only read 0x0 from the serial port after an initial burst of data.
programming features of the stlink seem to be working as expected (using stm8flash). I have not used the mass storage device.
I don't see any exceptions in the usbipd log, and I'm not sure if it is a usbipd problem but I was hoping you could point me in the right direction
usbipd.log
The text was updated successfully, but these errors were encountered: