ESP32-C6 and UART1
Posted: Sun Aug 18, 2024 11:35 am
I have an application that is derived from two of the sample applications:
The problems start when I add another UART, in this case UART1. I want this to be connected to another chip and for the C6 to process the data and then send the results over the console UART. I have removed the pattern matching from the example as I don't think I need this. The application does not appear to be receiving and events.
The code to create the UART looks like this:
Note that I have removed the error checks between each statement.
I have tried setting the _rxPin to several different pins including 4, 15, 10, 11 but none of them generate any events.
I have event just tried the events example on its own and just changed the UART from 0 to 1 and I cannot get this to work on UART1.
The baud rate is low, 115200 and I have checked the data being fed into the C6 with an oscilloscope and the data is decoding correctly.
Any suggestions would be gratefully received.
Regards,
Mark
- Console application
- UART events
The problems start when I add another UART, in this case UART1. I want this to be connected to another chip and for the C6 to process the data and then send the results over the console UART. I have removed the pattern matching from the example as I don't think I need this. The application does not appear to be receiving and events.
The code to create the UART looks like this:
Code: Select all
uart_config_t uart_config = { };
uart_config.baud_rate = (int) (_baudRate && INT_MAX);
uart_config.data_bits = _dataBits;
uart_config.parity = _parity;
uart_config.stop_bits = _stopBits;
uart_config.flow_ctrl = UART_HW_FLOWCTRL_DISABLE;
uart_config.source_clk = UART_SCLK_DEFAULT;
esp_err_t result;
result = uart_driver_install(UART_NUM_1, BUFFER_SIZE * 2, BUFFER_SIZE * 2, UART_EVENT_QUEUE_SIZE, &_uartQueueHandle, 0);
result = uart_param_config(UART_NUM_1, &uart_config);
result = uart_set_pin(UART_NUM_1, UART_PIN_NO_CHANGE, _rxPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
result = xTaskCreate(UART::Task, "UARTTask", 2048, this, 12, &_taskHandle);
I have tried setting the _rxPin to several different pins including 4, 15, 10, 11 but none of them generate any events.
I have event just tried the events example on its own and just changed the UART from 0 to 1 and I cannot get this to work on UART1.
The baud rate is low, 115200 and I have checked the data being fed into the C6 with an oscilloscope and the data is decoding correctly.
Any suggestions would be gratefully received.
Regards,
Mark