Repository navigation
Conversation
|
Thank you for your contribution! |
|
This is my first PR proposing a firmware change here; I've also submitted the CLA in #1641. I have other changes I'd like to contribute, but before submitting those I'd appreciate feedback on whether this PR's scope, format, and validation are appropriate for the project. The code and tests in this PR are AI-generated. I do what I can to independently validate that the changes work as intended and do not introduce unintended side effects, including hands-on testing with my own UHK80. I welcome feedback on the implementation, test coverage, and contribution process. |
|
Hi!
In the first place, it seems to me that it answers the entirelly wrong questions. Or that it even doesn't ask many. The right questions might be:
My take on these is:
Well, maybe let's focus on the actual problem?
This (a 10 second uart stall) should never happen.
If it does, it indicates a serious problem with the uart control logic (the resending logic and its control thread), and possibly another problem ith uart driver implementation. That is what needs to be investigated and fixed.
So, let's assume this scenario actually happens. Uart goes into a 10 second stall. Someone else wants to send another message. Clearly, that transfer is either already successfuly finished (and we just don't know that), or dead (and we don't know that). You propose to continue waiting on the stall, without attempting to recover in any way. Actually, instead of throwing out the old message and attempting a new transfer, you just throw out the new message, and that's it. What is the motivation for that?
Adding a complex mocking setup that (probably) (more or less) depends on an exact code form just to test a scenario that should never ever happen? Definitely no. Given the above, additional questions suggests themself:
|
|
Good questions, I forgot to put this into context... I've really want the ability to connect a 2nd computer to the left USB connection so I didn't have to use a wireless dongle. With AI's help, I have a version of this that more or less works (leadZERO#2) but want to work on testing things a lot more. It was adding the left-half connection manually that won't make sense once it's using the Agent for adding the left host connection. Before submitting a big PR like that, I wanted to better understand how things were submitted. During my testing for the aforementioned left-host-connection change, I discovered a few things that the agent and I changed along the way. This was the smallest change that seemed like it might be a fix (but again, this was largely agent driven). I had the agent pull this out to submit as my first PR just to start understanding better how I might go about the larger submissions. (There were 2 other items that seemed to fix issues I was having but those were again more substantive:: leadZERO#8 and leadZERO#7). Anyway, I hope that missing context helps. |
|
Well, this is a nice illustration of the problem with ai agents. They tend to follow the wrong scent and then fail to put their findings into the real world context. To answer your question in general:
What I see here is (without offense) unfortunately just a noise submitted without any (visible) validation, for me to pick out things from. That could still be useful if there was some story behind it (reproducible or even non-reproducible but present issue, or a specific concern). Regarding c2usb, if you believe you have found an issue, please report it here: https://github.com/IntergatedCircuits/c2usb . (Prior experience (learned the hard way) says that Benedek reacts promptly if (and only if) a real issue is reported.) Looking forward to further PRs, but it can happen that I will prefer if you continue maintaining that usb extension on your own fork. |
If
UartBridge_SendMessage()cannot acquiretxBufferBusywithin its 10-second timeout, it logs the error but continues without owning the transmit buffer. It can then overwrite the outstanding frame, change its watermark, and attempt another transmission.Return the semaphore error before changing the frame or link state. This adds one early return to the production code, plus a regression test for timeout ownership and the existing successful-send and error paths.
Changelog:
Validation:
python3 tests/uart_bridge/test_send_timeout.py.The timeout test deliberately held the transmit slot over canary storage before DMA. Neither a natural stall nor a timeout with active DMA was reproduced, so this does not establish the cause of a reported typing failure. Unbound module buttons were not tested. The linked notes retain an earlier intermittent module-discovery discrepancy and one USB transfer-error log entry; their causes remain unestablished, and the final hands-on checks passed.