Wooohaaa opened a new pull request, #21894:
URL: https://github.com/apache/nuttx/pull/21894
## Summary
`up_set_format()` in `stm32_serial_m3m4_v1v2v3v4.c` had two problems
for the F3 and G4 families:
1. **F3 (F30XX/F33XX/F37XX)**: UE was never cleared, so
`tcsetattr(8E1)` returned 0 but the parity and word length did not
change.
2. **G4 (STM32G4XXX)**: UE|TE|RE were cleared but the original values
were not saved. At the end, UE|TE|RE were unconditionally OR-ed
back, which would incorrectly set them to 1 even if they were
originally 0.
## Change
- `arch/arm/src/common/stm32/stm32_serial_m3m4_v1v2v3v4.c`:
- Extend the UE clearing condition from G4-only to F3+G4.
- Save UE before clearing (instead of clearing UE|TE|RE without
saving).
- Clear only UE (instead of UE|TE|RE), matching the L4 (#20914)
pattern.
- Restore UE from the saved value (instead of unconditionally
OR-ing UE|TE|RE).
- Add a critical section around the UE toggle.
## Test plan
- Built `nucleo-f334r8:nsh` (F3) and `nucleo-g431rb:nsh` (G4) with
arm-none-eabi-gcc; the serial driver compiles cleanly for both.
- Not tested on hardware (no F3 or G4 board available).
- The change is gated on the F3/G4 `#if` conditions, so F1/F2/F4/L1
boards are unaffected.
Fixes #20969
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]