|
From: Jerri L. <Jer...@pr...> - 2024-04-27 16:16:40
|
On Saturday, April 27th, 2024 at 7:51 AM, Xiaofan Chen <xia...@gm...> wrote: > > Windows standard Serial API or Posix serial API. > I'd prefer to avoid the nitty-gritty of using tty directly. They've stood the test of time, but the API is also 50+ (?) years old and it shows. > You can even try a cross-platform library like libserialport. > https://sigrok.org/wiki/Libserialport > That indeed may be a good option, but that's not the issue I raised. Your solution to "I'm getting poor performance with libusb" is "don't use libusb"? It doesn't seem like libusb is actually the cause here, but still, in principle there's no reason why it shouldn't work. > Sorry but no idea why dd is relevant here. That is probably only relevant if > you use a USB mass storage device. It's relevant because dd, as it happens, indirectly uses the serial API you suggest by talking to the device through /dev/ttyX. Incidentally, it's the way ST officially recommends for measuring CDC throughput. > For a CDC-ACM device, the OS will assign the USB serial driver to the device. Yes, I've mentioned that several times. > If you want to use libusb, then do not use CDC-ACM at all why?? why shouldn't I use libusb to talk to any USB endpoint I want to? Using CDC has several big benefits, including default drivers on linux/win, and the convenience of using a terminal program during development. Also, dead simple code generation with the STM32 IDE. All of that minimizes the amount of code I have to write, and maximizes flexibility. For me, it's a no-brainer that CDC is a good choice. > You may also want to give libusbK kBench a try to see how fast you can get Thank you for all the pointers and performance numbers - much appreciated. I'll go through the links you suggested and report back. There's also an alternate FOSS USB stack for stm32, I've thought about trying that instead and seeing if the problem clears. I'm not sure how easy it would be to bring up, I don't really want to get bogged down with this. > You can also use libusb based libusbdotnet benchmarkcon For this and other suggested benchmark tools, it's worth notice that I've already benchmarked with dd and got near 1MB/s. The only interest is if they get significantly above 1MB/s (theoratical MX is 1.2MB/s IIRC), or if the performance varies among them, since then some tracing may offer clues as to the underlying issue. |