Closed QuiGonRazor closed 3 months ago
Bluetooth over uart, is actually pass through for ESP-Hosted.
Have you configured your host uart pins to use bluetooth?
If you configure your Linux gpios in device tree or any other way, it should work.
Make sure you connect the uart pins correctly.
Check uart setup: https://github.com/espressif/esp-hosted/blob/master/esp_hosted_ng/docs/setup.md#23-sdiospi--uart-configuration
Here instead of Raspberry Pi setup, you need to configure for your host. ESP side setup steps can be referred from documentation.
ESP side controller directly supports standard HCI interface.
Check if you have configured ESP correctly from setup document. Also check the HCI over UART baud rate used in IDF.py menuconfig. Is it two pin or four pin uart, accordingly flow control enabled or disabled in both ESP and host,
Check if pin connection are correct (rx to tx and vice versa, rts to CTS and vice versa)
Once you setup Linux uart driver in HCI mode, it should just work. These messages are pass through for ESP-Hosted, meaning the HCI over UART messages from Linux directly end from Linux driver to ESP controller. These messages do not enter hosted kernel module at Linux and hosted slave driver at esp.
HCI over UART is independent of ESP-Hosted code.
I reply you per steps
&uart5{ uart-has-rtscts; pinctrl-names = "default", "sleep"; pinctrl-0 = <&uart5_pins_mx>; pinctrl-1 = <&uart5_sleep_pins_mx>; status = "okay"; };
This uart I'm 100% works (used before for other meanings)
As fas I remember ESP32 had default bad rate set to 921600, unless explicitly changed.
Also for c3, there was no default config from esp-idf, so we had added manual option that time. (Setup doc should be covering this, also you can search manually for 'UART.*BAUD' in sdkconfig generated after idf.py menuconfig. I will also check if any default option introduced and being used newly in esp-idf.
Could you try with 921600?
$ hciconfig -a
$ sudo killall hciattach
$ sudo hciattach -s <baud_rate> <serial_device_name> /dev/serial0 any <baud_rate> flow
$ hciconfig -a
Hello, sorry for being late.
Yesterday I tried with a second devkit I have and it worked correctly (setting HCI baud rate to 115200), same flashed binary
Today I'll try with the first one flashing it again with the default baud rate you've suggested
oh okay. Can you share your sdkconfig generated while building, for chipset you had experienced the problem?
Yeah sure, here attached I had to add txt extension to be able to upload it
considering
CONFIG_EXAMPLE_HCI_UART_BAUDRATE=115200
Edited https://github.com/espressif/esp-hosted/issues/440#issuecomment-2259588979 to correct baud rate for your case.
Hello, restoring the BAUDRATE to the default one (921600) works for both the devkits.
It seems all is working good.
Hello all, I've correctly setup an ESP32-C3 with NG fw. It correctly talks, brings up wlan0 interface and it works as expected (it connects via WiFi + communicates via Internet)
I'm now interested in having the BLE interface working. I've tried with both WiFi and BLE via SPI and all worked fine. Now I'm trying to switch to BLE HCI (H4). I followed the guide into the repo and connected all related GPIOs (CST, RTS, BLE RX, BLE TX).
It seems not working. When I launched the command
hciattach [PORT] 115200 any flow
my system tries to bring up the BLE interface, failing miserably. Using dmesg I can clearly see that hci bring up commands are failing due to timeout.Since I correctly managed to use the BLE via SPI I don't think it is an issue with the BLE module but something related with HCI communication
Can you help me please? What am I missing?