]> granicus.if.org Git - esp-idf/commitdiff
bootloader_support: Fix UART RXD pin for console output (CUSTOM option)
authorKonstantin Kondrashov <konstantin@espressif.com>
Thu, 16 May 2019 10:46:00 +0000 (18:46 +0800)
committerKonstantinKondrashov <konstantin@espressif.com>
Mon, 20 May 2019 10:37:26 +0000 (18:37 +0800)
The RXD pin is assigned as input (fix for custom uart option).

Closes: https://github.com/espressif/esp-idf/issues/2843
Closes: IDFGH-505
components/bootloader_support/src/bootloader_init.c

index 42afbb54dfb118a0c5732f71c84cfc6a6f93e234..8d3f33269c260fbd93a37b9f1d683f6902724918 100644 (file)
 #include "soc/cpu.h"
 #include "soc/rtc.h"
 #include "soc/dport_reg.h"
-#include "soc/io_mux_reg.h"
 #include "soc/efuse_reg.h"
 #include "soc/rtc_cntl_reg.h"
 #include "soc/timer_group_reg.h"
-#include "soc/gpio_reg.h"
-#include "soc/gpio_sig_map.h"
+#include "soc/gpio_periph.h"
 
 #include "sdkconfig.h"
 #include "esp_image_format.h"
@@ -430,6 +428,10 @@ static void uart_console_configure(void)
         const uint32_t rx_idx_list[3] = { U0RXD_IN_IDX, U1RXD_IN_IDX, U2RXD_IN_IDX };
         const uint32_t tx_idx = tx_idx_list[uart_num];
         const uint32_t rx_idx = rx_idx_list[uart_num];
+
+        PIN_INPUT_ENABLE(GPIO_PIN_MUX_REG[uart_rx_gpio]);
+        gpio_pad_pullup(uart_rx_gpio);
+
         gpio_matrix_out(uart_tx_gpio, tx_idx, 0, 0);
         gpio_matrix_in(uart_rx_gpio, rx_idx, 0);
     }