Closed 244219195 closed 3 months ago
some hci log was update.please check it .
Can you please add ESP side and host side logs:
Esp: idf.py monitor OR minicom logs from start
Host:
Also send us the picture or photo how do you connect esp32-c3 to Linux.
maybe can't see more things ,but i was open esp32 SPI log .so i think SPI channel was ok.
Can you please send us full logs stated in https://github.com/espressif/esp-hosted/issues/428#issuecomment-2224392347
Where is ESP32-C3 in your picture? Is it PCB embedded?
Also please send us full and textual logs.
I will go and retrieve the corresponding log. ESP32 C3 was on pcba
logs_for_spi_esp32c3.zip @mantriyogesh Here are log file. how to get possibly bluetoothd (BlueZ) debug logs?hci log not enough?
Please spare us some time, to get back on this.
Your current Linux kernel version is:
Linux version 5.4.238 (aarch64)
Please check https://stackoverflow.com/questions/61935284/invalid-params-issue-when-doing-hciconfig-hci0-reset
This seems to be fixed in newer kernel, so please consider down/upgrading your kernel. This doesn't look like ESP-Hosted bug as such, anyway.
You kernel code references: https://elixir.bootlin.com/linux/v5.4.238/source/net/bluetooth/hci_request.c#L1617
fix 5.7.7 : https://elixir.bootlin.com/linux/v5.7.7/source/net/bluetooth/hci_request.c#L942
Do you have another method?down/upgrading my kernel maybe difficulty.down/upgrading blue-z version can resolve this issue?
I will try to change my kernel code for https://elixir.bootlin.com/linux/v5.7.7/source/net/bluetooth/hci_request.c#L942 maybe it can useful.
I think it would be better, to change and re-flash your kernel as per expected change, in case you do not wish to upgrade. Let us know how it goes.
Change my kernel code for https://elixir.bootlin.com/linux/v5.7.7/source/net/bluetooth/hci_request.c#L942 it can't useful.
@mantriyogesh hello, Do you have other way to continue debugging this issue?
Although the correct way to fix this issue is to upgrade the kernel, but which seems not possible for your side.
Disclaimer:
After a lot of playing with gpt, and customisations, I ended up in live patching feature
of kernel. You yourself can dig more info, how is it done. Obviously it is non tested code, I will leave it to you. :
I was use the patch ,it doesn't work .Bluetooth broadcast packet still setting failed
Can you please provide the process for successfully using BLE broadcasting, which is closer to the Linux system version I am using and the blue Z version. Use the latest SPI solution from ESP32C3. I am willing to try replacing the Bluez version. I tried to modify the kernel code, but it didn't work.So i want to change blue Z version
As explained, if kernel code is a problem. I am curious,how you will solve kernel code issue with different BlueZ version?
I directly replaced the version of BlueZ without modifying its code
Please refer to https://stackoverflow.com/questions/61935284/invalid-params-issue-when-doing-hciconfig-hci0-reset again.
Check the function definition. If the function returns value of 0 than 1, which is handled internal by kernel itself (not exposed to outer module), how changing the input or output, through BlueZ would help, I am not sure..
for your answer,https://stackoverflow.com/questions/61935284/invalid-params-issue-when-doing-hciconfig-hci0-reset This seems to be fixed in newer kernel, so please consider down/upgrading your kernel.Therefore, I attempted to replace the Bluetooth related code.however ,it doesn't work. Can you provide another suggestion? For my Esp log,The SPI log shows that the parameter 'name' has been obtained, but why was it not broadcasted during Bluetooth broadcast.? The Linux system runs on ARM and is connected to ESP32-C3 through SPI. The version of Blue Z-5.64 needs to support the operation of ESP32-C3. Do you need to apply some blue-Z or bluetooth patches ?Because I have used Bluetooth chips from other projects and have had similar operations before.
If you have any success log with non ESP device with exact same environment , with same Linux with same machine, please collect exact logs and send to us.
For our Linux systems we do not observe this issue
Also, as we are talking about ESP, do you observe this issue with pure IDF example with similar scenario?
If it fails, we will ask bluetooth team to look into it.
Esp-Hosted is simple relay. It doesn't do any processing of packets. It sends packets from one end to other. Apart from this communication, any issues arising out of kernel, bluetooth stack, etc are out of scope for us.
If you face issues in controller as stated above with esp-idf example, either you can raise the issue with esp-idf team or we pass the logs to them.
Esp hosted code is available to you. If the tx msg is end at ESP and vice versa, ESP-Hosted scope is done. Do you see any packets corrupt in between the communication from/to ESP on the spi/sdio?
Thank you for your reply,SPI packet not seen lost. I will continue to try debugging Linux/ESP32 code.If there is a result, I will reply. Based on this driver, can l implement Bluetooth broadcasting, reading and writing of Bluetooth characteristic values via SPl communication, thereby achieving Bluetoothtransparent transmission functionality? if there's no quick solution available on the Linux side, then l might consider trying this approach.
Actually there is one more way to even verify this issue, if it is hosted specific or not.
Right now you use HCI over spi. There is also spi+uart way, where control path and wifi goes over wifi and bluetooth uses uart.
HCI over UART doesn't even enter hosted kernel driver and directly ends in bluetooth controller of ESP chipset.
If you can configure spi+uart solution. You might have to additionally configure extra pins for uart, change the ESP to use bluetooth controller over uart and reflash - check documentation)
You can collect HCI over spi vs HCI vs uart.
Obviously bt controller issues cannot be ruled out, but then at least scope is reduced. But I seriously doubt if it is controller issues as such.
I hope this comment helps.
hello,mantriyogesh Can you provide me with an HCI log that includes the complete Bluetooth broadcast process? I use it to compare my existing HCI logs and see if there are any errors, which makes it easier for me to fix kernel related issues
It is best to use adjacent versions of the kernel, as well as the BlueZ version. Thank you.
We cannot use exact version what you used, so the dumps would be really not helpful. If your SoC can hold multiple kernels, evaluate upgrading your kernel and test on one of the fixed kernel.
Easiest would be to rebuild and load current kernel with fix. if you want to revert, the procedure is same and everything is still in your control.
the kernel versions we have are much ahead than 5.4.x.
I don't need the same kernel version. On my end, I need to confirm whether the HCI command sent to ESP32 is correct for analysis, and identify which stage of the command is problematic. When I tried to modify the Bluetooth name using hcitool cmd, the Bluetooth broadcast was successful. But the commands issued by Bluez are not consistent. This is clearly not an issue with the kernel version
In theory, when I issue the HCI command to Bluetooth, the Bluetooth should respond accordingly. So I need to compare your normal HCI process to analyze the problem.
Okay, I will send you all the success logs at our side. What all the things minimally you wish to do? I will do that on my existing setup and get you all the logs.
6.Enable GATT
I have made progress on my end. The Bluetooth driver repair is in linux version 5.8, not version 5.7.so I was change the kernel code .And then ,it was working . Thank for you help .
Thank you for the update. This info might help someone later.
If you are unblocked, can we please this issue?
OK
Software operating environment:
this error message appears after setting it up
when i use advertise on funtion ,phone show that Broadcast was empty
here are some hci log .