mirror of
https://github.com/micropython/micropython.git
synced 2026-01-31 00:00:32 +01:00
esp32/machine_uart: Change default UART(1) pins on ESP32 with SPIRAM.
SPIRAM usually uses GPIO 9 and 10 on ESP32, so don't use them as default UART pins. Fixes issue #18544. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -380,6 +380,9 @@ tx 1 10 17
|
||||
rx 3 9 16
|
||||
===== ===== ===== =====
|
||||
|
||||
On ESP32 with SPIRAM, the default pins for UART1 are ``tx=5`` and ``rx=4``
|
||||
to avoid possible conflicts with the SPIRAM pins.
|
||||
|
||||
PWM (pulse width modulation)
|
||||
----------------------------
|
||||
|
||||
|
||||
@@ -278,8 +278,14 @@ static void mp_machine_uart_init_helper(machine_uart_obj_t *self, size_t n_args,
|
||||
self->tx = UART_PIN_NO_CHANGE; // GPIO 1
|
||||
break;
|
||||
case UART_NUM_1:
|
||||
#if CONFIG_IDF_TARGET_ESP32 && CONFIG_SPIRAM
|
||||
// ESP32 usually uses pins 9 and 10 for SPIRAM bus, so avoid those pins as defaults.
|
||||
self->rx = 4;
|
||||
self->tx = 5;
|
||||
#else
|
||||
self->rx = 9;
|
||||
self->tx = 10;
|
||||
#endif
|
||||
break;
|
||||
#if SOC_UART_HP_NUM > 2
|
||||
case UART_NUM_2:
|
||||
|
||||
Reference in New Issue
Block a user