BLE problem when using UART
Posted: Wed Oct 02, 2019 12:00 pm
When running both BLE and UART communication, BLE stops working.
I have two tasks, a "BLE-task" and a "UART-task".
The BLE-task sets up a number of serivces (like in the gatt_server-example) and the UART-task sets up communication over UART using an event queue. (se relevant code below)
The problem is, that when the UART cables are connected and we actuallt get som data, BLE stops working.
I don't get any GAP-events about it but the device stops advertising, and it cannot be connected to.
NOTE: If I disconnect the UART cables, the BLE work fine, a client can connect to the servier and set and get values.
* HCI mode is set to VHCI.
* esp-idf v3.3
[/Codebox]
I have two tasks, a "BLE-task" and a "UART-task".
The BLE-task sets up a number of serivces (like in the gatt_server-example) and the UART-task sets up communication over UART using an event queue. (se relevant code below)
The problem is, that when the UART cables are connected and we actuallt get som data, BLE stops working.
I don't get any GAP-events about it but the device stops advertising, and it cannot be connected to.
NOTE: If I disconnect the UART cables, the BLE work fine, a client can connect to the servier and set and get values.
* HCI mode is set to VHCI.
* esp-idf v3.3
Code: Select all
uart_config_t uart_config =
{
.baud_rate = 9600,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 122,
};
uart_param_config(UART_NUM_1, &uart_config);
uart_set_pin(UART_NUM_1, 16, 15, 4, UART_PIN_NO_CHANGE);
uart_driver_install(UART_NUM_1,256 * 2,256 * 2,10,&xUartQueue, 0);
uart_set_mode(UART_NUM_1, UART_MODE_RS485_HALF_DUPLEX);
- [Codebox=c file=Untitled.c]