Open icex2 opened 2 years ago
i don't have any possibility to test this since i sold my tasoller some time ago.
if anyone else can test it and confirm this is fixing the issue, i am happy to accept a merge request with the patched firmware.
In GitLab by @akiroz on Jan 26, 2022, 22:23
I can confirm that wMaxPacketSize
is indeed 1024 when poking around with the WinUSB API. However, I don't have a USB host controller that's incompatible to reproduce the issue.
In GitLab by @shtokopep on Jan 30, 2022, 01:13
A friend of mine still has his tasoller and the unsupported device bug when plugging into the usb 2.0 ports of his motherboard (not sure if that's supposed to be supported in the first place), and after a little bit of testing :
cross-referencing akiroz' bitmaps, it looked like the led transfer was indeed truncated to the 64 first bytes, which made me investigate their chuniio.dll a little...
they use the libusb asynchronous I/O (with a call to libusb_fill_bulk_transfer ) but their callback function doesn't take the rearm into account (since we're sending more data (240 bytes) than the endpoint size (64 bytes), it will require 4 different transfers and the callback function is then supposed to take care of tracking whether there are still more bytes to send).
I'll write the patch, get my friend to test and prepare a PR
In GitLab by @shtokopep on Jan 31, 2022, 01:29
My patch to chuniio.dll seems to be working correctly in terms of packet handling, however it didn't fix the issue.
I then wrote a small test app (just sending red/green/blue/white to the panel) using libusb synchronous I/O to have a simple test case, and it exhibits the same problem (first 26 keys working fine, last 6+sides not working, see attached picture) even though libusb tells me it succesfully wrote 240 bytes.
I think while 240 bytes are indeed sent to the endpoint, the device firmware is not able to correctly reconstruct the data packet (maybe the wrong endpoint size is also hardcoded elsewhere in the transfer handling routine, but i'm not gonna look for other occurrences of a single byte lol)
On a more positive note, I've noticed that the device advertises itself as a full speed device in the device descriptor rather than high (in fact I learnt that a size of 1024 does exist for superspeed, but this also requires BOS descriptors which the tasoller doesn't have...), and it also reports an interval polling rate which should be 0 for bulk endpoints (technically it's ignored, but I've had enumeration issues with some microcontrollers for this exact reason before) so there's hope that this is the reason why it was still failing to enumerate.
TL;DR I spent a little while patching chuniio.dll for nothing, but I've got another lead on a firmware patch, will report back soon
Great work. Looking forward to that patch.
In GitLab by @shtokopep on Feb 3, 2022, 12:34
mmhh, after more attempts, unfortunately nothing worked.. interestingly enough, the mcu inside seems to be a NUC140 according to akiroz ( "It's likely an NUC140, the DFU manufacturer says "SS140" and the QFP48 pinout matches with the crystal and USB pins" )
if that's the case then the mcu is actually only capable of fullspeed usb, not highspeed/superspeed, which might explain why I still saw it enumerated as full speed and why it's up to the chipset to accept fullspeed with an endpoint packet size of 512+ despite it being out of spec.
the next step would be to properly implement either the high speed "other speed descriptor" (which might probably only cause more issues if mcu is not capable of high speed anyways), or fix the packet reading behavior so that fragmented packets can be reconstructed as they should... however both of these solutions would require firmware disassembly and more time than I'd like to spend on it :p
Therefore I've decided to send an email to dao support instead, as the fix would be trivial for them if they know what they need to change in the firmware. Hopefully they will listen
that's unfortunate, but thanks for digging and giving a summary about it. FYI that i tried to reach out to dao about this issue quite a while ago and didn't get an answer, unfortunately. maybe the result is different this time. keep us posted.
Copy-paste from chat with CrazyRedMachine on discord