I have been programming for Metro ESP32-S2 Express using ESP-IDF with PlatformIO. Contrary to the other ESP32 board I have (ESP32-DevKitC V4), after uploading the serial port disappears, making it difficult to monitor the output from the chip itself.
I have tried this code snippet:
Code: Select all
uart_config_t uart_config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
};
int intr_alloc_flags = 0;
QueueHandle_t uart_queue;
ESP_ERROR_CHECK(uart_driver_install(0, 1024, 1024, 10, &uart_queue, intr_alloc_flags));
ESP_ERROR_CHECK(uart_param_config(0, &uart_config));
ESP_ERROR_CHECK(uart_set_pin(0, 1, 3, -1, -1));
Thanks,
Simon