Conversation
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
The route through INAV has now been exercised on a TBS Lucid H7 Wing with an Avian: the handshake, telemetry and the whole settings menu read back through MSP_SET_PASSTHROUGH. Changing and saving a setting that way has not been tried, nor a bus at 400000, which that Avian does not offer. It also showed that two things the README promised need a fix in INAV to happen over MSP: ending the session with +++, and mirroring the host's baud rate onto the wire. INAV applies both to the first port it is given, and the MSP passthrough gave it the ESC's, so without iNavFlight/inav#12003 the board stays in the passthrough until power cycled. The README now says so instead of saying nothing needs adding to INAV. The telemetry log also names the TextGen rows the ESC sends, row number and text, where it used to print them as an undecoded sensor.
PR Summary by QodoFix MSP passthrough host-port ordering
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR |
|
++ drops the passthrough? It seems to me this will drop the every passthrough connection, randomly, on average every few KB. Would drop every few kilobytes: Is there something I'm missing here? |
|
The escape needs a second of silence before the I tried it on a Lucid H7 Wing with this PR: That's how I read it, but please tell me if I'm the one missing something: I'd never want to introduce a bug. I'm also going to test maintenance-10.x thoroughly with my PRs applied on top. |
serialPassthrough() does two things for whoever opened the session, and does them for its first port only: it looks there for the +++ that ends the session, and when that port is USB it mirrors the host's line coding onto the other one. The CLI passes the host first. The MSP passthrough passed it second, so a session opened with MSP_SET_PASSTHROUGH could not be closed from the host, and could not change the rate of the port it opened. On a bench, a tool configuring an SRXL2 ESC through MSP_SET_PASSTHROUGH left the board stuck in the passthrough after every session: the +++ reached the ESC's wire and came back as its echo, but the board never left the loop and answered no MSP until it was power cycled. With the host first the same session ends on +++ and the board carries on. The rate the host asks for is now mirrored as well, which is what lets such a tool negotiate an SRXL2 bus up to 400000. The mirror is baselined on the host's line coding when the session starts and only follows changes made during it, so opening a session does not touch the rate of the port being bridged.
1d7c771 to
01445e5
Compare
|
RAM / Flash usage vs. base commit
See RAM/flash optimization guide for techniques to reduce usage. |
|
Test firmware build ready — commit Download firmware for PR #12003 250 targets built. Find your board's
|
What this fixes
serialPassthrough()does two things for whoever opened the session, and does them for itsfirst port only:
+++that ends the session;The CLI passes the host first. The MSP passthrough (
MSP_SET_PASSTHROUGH) passed it second,so a session opened over MSP could not be closed from the host and could not change the rate
of the port it had opened.
How it showed up
A tool that configures an SRXL2 ESC through
MSP_SET_PASSTHROUGH, on a TBS Lucid H7 Wingwith an Avian ESC on UART8:
+++at the end of the sessionThe last row is what lets such a tool negotiate an SRXL2 bus up to 400000.
What I changed
The port the request came in on now goes first, as it does in the CLI. Nothing else calls
serialPassthrough()with the host second: the GPS passthrough has a loop of its own.The mirror is baselined on the host's line coding when the session starts and only follows
changes made during it (see the comment above it, from #11783), so opening a session does not
touch the rate of the port being bridged. A session opened over MSP on a UART rather than USB
gets the
+++exit it was missing, and no mirroring, as before.Testing
On the bench described above: find, telemetry and the full settings menu read through the
passthrough, the session ending on
+++and the board answering MSP right after it, wherebefore every session needed a power cycle. Built for SITL and TBS_LUCID_H7_WING.