ESP32-C3 IDF5.0串口报错
Posted: Sat Apr 15, 2023 9:16 am
- 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,
- .source_clk = UART_SCLK_DEFAULT
- };
- uart_param_config(UART_NUM_1, &uart_config);
- uart_set_pin(UART_NUM_1, GPIO_NUM_7, GPIO_NUM_6, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
- uart_driver_install(UART_NUM_1, 16, 0, 0, NULL, 0);
- char* send_check = "AT\r\n";
- uart_write_bytes(UART_NUM_1, send_check, strlen(send_check));
- char recv_check[128];
- uart_read_bytes(UART_NUM_1, &recv_check, 128, 100);
- ESP_LOGI(TAG, "dataIn:%s", &recv_check);
- [0;31mE (253) uart: uart_driver_install(1562): uart rx buffer length error[0m
- [0;31mE (253) uart: uart_write_bytes(1244): uart driver error[0m
- [0;31mE (263) uart: uart_read_bytes(1281): uart driver error[0m
- [0;32mI (263) scan: dataIn:[0m