UART Parity bit missing

shih91
Posts: 9
Joined: Wed Nov 16, 2016 3:09 am

UART Parity bit missing

Postby shih91 » Wed Nov 16, 2016 3:13 am

Hey guys,

I have been playing with ESP32 module for the past few days. I have gotten around activating UART1 using IO 9 (RX) and IO 10 (TX). The following code is my UART setting:

Code: Select all

        int uart_num = 1;                                       //uart port number
        uart_config_t uart_config = {
                .baud_rate = 19200,                    //baudrate
                .data_bits = UART_DATA_8_BITS,                       //data bit mode
                .parity = UART_PARITY_EVEN,                       //parity mode
                .stop_bits = UART_STOP_BITS_1,                       //stop bit mode
                .flow_ctrl = UART_HW_FLOWCTRL_DISABLE,               //hardware flow control(cts/rts)
                .rx_flow_ctrl_thresh = 120,                          //flow control threshold
        };
        uart_param_config(uart_num, &uart_config);
        //QueueHandle_t uart_queue;
        if(uart_driver_install(uart_num, 1024 * 2, 1024 * 2, 0, UART_INTR_NUM, NULL) != ESP_OK){
                puts("uart driver install failed");
        }

        uart_set_pin(uart_num, 10, 9, 15, 13);
        uart_set_word_length(uart_num, UART_DATA_8_BITS);
        uart_set_parity(uart_num, UART_PARITY_EVEN);
But when I sent data through WiFi to ESP32:

Code: Select all

                if((recv(client_sock2, &recvbuffer,32,0))>0){
                        uart_write_bytes(uart_num, (const char*) recvbuffer, 32);
                }
And after I checked the oscilloscope on the TX line, I found out that the parity bit is missing.

Anybody has any idea if I did anything wrong?

ESP_Sprite
Posts: 9709
Joined: Thu Nov 26, 2015 4:08 am

Re: UART Parity bit missing

Postby ESP_Sprite » Wed Nov 16, 2016 6:48 am

Seems like a small bug in the uart driver. We're working on a fix, should arrive in master somewhere this week.

shih91
Posts: 9
Joined: Wed Nov 16, 2016 3:09 am

Re: UART Parity bit missing

Postby shih91 » Tue Nov 22, 2016 1:53 am

May I know if the bug has been fixed?? I don't see it in the commits.

ESP_Sprite
Posts: 9709
Joined: Thu Nov 26, 2015 4:08 am

Re: UART Parity bit missing

Postby ESP_Sprite » Tue Nov 22, 2016 3:05 am

Was fixed here, sorry for not updating you:
https://github.com/espressif/esp-idf/co ... 402845322f

shih91
Posts: 9
Joined: Wed Nov 16, 2016 3:09 am

Re: UART Parity bit missing

Postby shih91 » Tue Nov 22, 2016 6:03 am

sweet! thank you so much!

Who is online

Users browsing this forum: No registered users and 142 guests