| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
Sorry, something went wrong.
PR Summary by QodoReconfigure HAL UART baud rates without port teardown 🐞 Bug fix 🕐 10-20 Minutes AI Description
|
Sorry, something went wrong.
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0) 1. Baud changes can stall the controller ✓ Resolved 🐞 Bug ☼ Reliability Description Code Evidence Agent prompt Tip of the day 💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history |
Sorry, something went wrong.
|
Good catch, thank you. The interrupt sources are now masked before the peripheral is reprogrammed, and enabled again at the end of the same function, which it already did for the rest. A port being opened has no handle yet, so there is nothing to mask and the masking is skipped. Measured again on the bench after the change, with a NEO-F10N on an H743: ten baud rate changes out of ten, no timeouts. |
Sorry, something went wrong.
uartSetBaudRate() went through uartReconfigure(), which starts with HAL_UART_DeInit(). That releases the peripheral and its pins, and the line noise it leaves behind is read as data by whatever is on the other end. A u-blox receiver stops taking input for about a second after hearing it, which is long enough to swallow the commands that follow. On a bench with a NEO-F10N, a sequence that only changed the port's rate before speaking to the receiver reached it 3 times out of 10; with the configuration done in place it reached it 10 times out of 10. Everything but the tear-down is now in uartConfigure(), which HAL_UART_Init() is happy to be called with again: it reconfigures a port that is already open and leaves the pins alone. Opening a port and changing its mode or options still go through the full reconfigure. A port reprogrammed in place still has its interrupts enabled, so they are masked for the duration: one taken while the HAL has the handle marked busy would find the peripheral half written. The function enables them again at its end, as it already did. A port being opened has no handle yet and nothing to mask. Only the HAL families are affected. The F4 and AT32 drivers already disable the peripheral and reprogram it without releasing anything.
|
RAM / Flash usage vs. base commit 86a0441 — commit 3446007
See RAM/flash optimization guide for techniques to reduce usage. |
Sorry, something went wrong.
|
Test firmware build ready — commit 3446007 Download firmware for PR #12000 251 targets built. Find your board's .hex file by name on that page (e.g. MATEKF405SE.hex). Files are individually downloadable — no GitHub login required.
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
What this fixes
uartSetBaudRate() goes through uartReconfigure(), which starts with HAL_UART_DeInit().
That releases the peripheral and its pins, and the line noise it leaves behind is read as
data by whatever is on the other end.
A u-blox receiver stops taking input for about a second after hearing it. On an H743 bench
with a NEO-F10N, a sequence that only stepped the port through other rates before speaking
to the receiver at its own rate reached it 3 times out of 10. With the port reconfigured in
place, the same sequence reached it 10 times out of 10.
Anything else INAV changes the rate of is exposed to the same noise, including the SRXL2 ESC
driver, which raises the bus to 400000 once the handshake is done.
What I changed
Everything but the tear-down now lives in uartConfigure(). HAL_UART_Init() is happy to be
called on a port that is already open: it reconfigures the peripheral and leaves the pins
alone. Opening a port, and changing its mode or options, still go through the full
reconfigure, tear-down included.
Only the HAL families are affected. The F4 and AT32 drivers already disable the peripheral
and reprogram it without releasing anything.
Testing
Bench measurement above, on an H743 with a NEO-F10N. Built for F722 and H743; F405 and AT32
are untouched by this change but were built as well.