mirror of
https://github.com/apache/nuttx.git
synced 2026-09-10 10:56:41 +00:00
The STM32 serial drivers already treat 0 as not present for optional GPIO fields (CTS, RTS), guarding each call site with a != 0 check. TX and RX GPIO fields lacked this guard, so boards that define GPIO_UARTx_TX or GPIO_UARTx_RX as 0 (pin not routed) caused stm32_configgpio(0) to be called, which silently configures PA0 as a floating input, corrupting any other peripheral using that pin. Having an optional TX/RX UART is useful for several cases: * RX-only connections: e.g. radio control input on flight-controllers where no TX is wired. * Single-wire (half-duplex) connections: e.g. ESC telemetry connections. * Output-only NSH which prints output but does not allow entering inputs. Without a sentinel value for these cases one must assign the unused GPIO to a NC pin, which is misleading when reading board configuration files. Add != 0 guards for tx_gpio and rx_gpio across all STM32 serial driver families. Using 0 as the sentinel is safe for TX/RX because any valid UART config requires GPIO_ALT bits set in the config word, so 0 can never represent a real TX or RX pin configuration. Signed-off-by: alexcekay <alexander@auterion.com> |
||
|---|---|---|
| .. | ||
| arm | ||
| arm64 | ||
| avr | ||
| ceva | ||
| dummy | ||
| hc | ||
| mips | ||
| misoc | ||
| or1k | ||
| renesas | ||
| risc-v | ||
| sim | ||
| sparc | ||
| tricore | ||
| x86 | ||
| x86_64 | ||
| xtensa | ||
| z16 | ||
| z80 | ||
| CMakeLists.txt | ||
| Kconfig | ||