BLE problem when using UART

miktr112
Posts: 2
Joined: Mon Sep 30, 2019 12:04 pm

BLE problem when using UART

Postby miktr112 » 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

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);
  1. [Codebox=c file=Untitled.c]
[/Codebox]

miktr112
Posts: 2
Joined: Mon Sep 30, 2019 12:04 pm

Re: BLE problem when using UART

Postby miktr112 » Wed Oct 09, 2019 12:22 pm

UPDATE!
I just changed the RX pin from GPIO_15 to GPIO_39.
This change made BLE work again.

Still, I have no idea why this made it work..

Anyone got a clue?

Who is online

Users browsing this forum: No registered users and 116 guests