summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-06-26 00:03:52 +1000
committerDamien George <damien@micropython.org>2025-07-08 13:18:05 +1000
commita2e3055d2d4d84577d4c9c95b2dc740a705d1bfd (patch)
tree4259fde3ed44e9185a16980475e5116f79015fc5
parentbb484b6d81516ecfd110973af371a6eb00918e85 (diff)
tests/extmod_hardware: Add UART config for STM32WB boards.
Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--tests/extmod_hardware/machine_uart_irq_rx.py11
-rw-r--r--tests/extmod_hardware/machine_uart_irq_rxidle.py11
2 files changed, 16 insertions, 6 deletions
diff --git a/tests/extmod_hardware/machine_uart_irq_rx.py b/tests/extmod_hardware/machine_uart_irq_rx.py
index ecc95e62a..3602c260e 100644
--- a/tests/extmod_hardware/machine_uart_irq_rx.py
+++ b/tests/extmod_hardware/machine_uart_irq_rx.py
@@ -24,9 +24,14 @@ elif "esp32" in sys.platform:
tx_pin = 4
rx_pin = 5
elif "pyboard" in sys.platform:
- uart_id = 4
- tx_pin = None # PA0
- rx_pin = None # PA1
+ if "STM32WB" in sys.implementation._machine:
+ # LPUART(1) is on PA2/PA3
+ uart_id = "LP1"
+ else:
+ # UART(4) is on PA0/PA1
+ uart_id = 4
+ tx_pin = None
+ rx_pin = None
elif "samd" in sys.platform and "ItsyBitsy M0" in sys.implementation._machine:
uart_id = 0
tx_pin = "D1"
diff --git a/tests/extmod_hardware/machine_uart_irq_rxidle.py b/tests/extmod_hardware/machine_uart_irq_rxidle.py
index af2412c75..634369150 100644
--- a/tests/extmod_hardware/machine_uart_irq_rxidle.py
+++ b/tests/extmod_hardware/machine_uart_irq_rxidle.py
@@ -26,9 +26,14 @@ elif "mimxrt" in sys.platform:
uart_id = 1
tx_pin = None
elif "pyboard" in sys.platform:
- uart_id = 4
- tx_pin = None # PA0
- rx_pin = None # PA1
+ if "STM32WB" in sys.implementation._machine:
+ # LPUART(1) is on PA2/PA3
+ uart_id = "LP1"
+ else:
+ # UART(4) is on PA0/PA1
+ uart_id = 4
+ tx_pin = None
+ rx_pin = None
elif "renesas-ra" in sys.platform:
uart_id = 9
tx_pin = None # P602 @ RA6M2