fix: prevent ESP32 KISS modem stalls under USB backpressure#2819
fix: prevent ESP32 KISS modem stalls under USB backpressure#2819ViezeVingertjes wants to merge 3 commits into
Conversation
Switch ESP32-S3 KISS modem environments to HWCDC and move outbound KISS writes to a non-blocking queued frame path so loop() and TX completion keep progressing when the host reads slowly. Add native backpressure regression tests and correct the native_kiss_modem test filter so this suite runs directly with pio test.
The new test_kiss_modem suite needs KissModem headers and sources that only native_kiss_modem provides. Scope native to test_utils and run both envs in the unit test workflow.
|
What do you think about this solution, @agessaman? I didn't want to butcher your branch/PR, so I made it a separate one. If we end up going with this approach, all the credit goes to you since you brought up the idea in the first place. Happy to add you as a co-author as well. It's a bigger change in terms of LOC, but with KISS gaining popularity, I think it makes sense to make it as resilient as possible. Most of the changes in this PR are test related anyway. If you filter on the three files under I've tested it both in code and on hardware, but if you get a chance to do the same and give it a try, it can get merged a bit quicker. |
|
In case this one gets merged, it might need a change on your side too or not? @rightup |
|
Thanks, @agessaman |
|
Sorry I didn't see this earlier. I'm vacationing at the moment and haven't been giving my email much time. I gave it a skim and I don't have any additional thoughts. Users will definitely appreciate being able to use those devices. |
|
Would be great if this one could go through @liamcottle @ripplebiz 💯 It doesnt affect many devices; but the devices it does (Heltec v4 for example) are probably amongst the most popular ones for this purpose. |
setTxTimeoutMs() and setTxBufferSize() are HWCDC-only APIs; calling them on HardwareSerial (UART-bridge boards like T-Beam) fails to compile. Co-Authored-By: Adam Gessaman <adam@gessaman.com>
879037b to
03d1c09
Compare
Switch ESP32-S3 KISS modem environments to HWCDC and move outbound KISS writes to a non-blocking queued frame path so loop() and TX completion keep progressing when the host reads slowly. Add native backpressure regression tests and correct the native_kiss_modem test filter so this suite runs directly with pio test.
Also should resolve #2646
write()blocks →loop()permanently wedgedloop()keeps running