Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

component/bt: allow setting a higher baudrate in UART HCI mode (IDFGH-2779) #4844

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

redchenjs
Copy link
Contributor

The ESP32 datasheet specifies that the internal Bluetooth UART HCI baudrate can reach up to 4 Mbps, but the baudrate range is limited to 921600 bps in Kconfig.

I tried to use a FT232R usb serial converter to communicate with the Bluetooth controller at 3 Mbps baudrate (the maximum baudrate supported by the FT232R chip), and it worked as expected.

When using 921600 bps baudrate the SPP speed is limited to 90 KB/s, after changing the baudrate to 3 Mbps the SPP speed is increased to 260 KB/s, so just allow users to set a higher baudrate as the hardware does support it.

Example: controller_hci_uart

ESP32

@github-actions github-actions bot changed the title component/bt: allow setting a higher baudrate in UART HCI mode component/bt: allow setting a higher baudrate in UART HCI mode (IDFGH-2779) Feb 26, 2020
@Alvin1Zhang
Copy link
Collaborator

@redchenjs Thanks for the contribution.

@AbnerFederer
Copy link

AbnerFederer commented Mar 3, 2020

Hi, @redchenjs

I have to do a bunch of tests to verify the 3M baud rate is proper for the controller to handle.
If all tests pass, I will merge this PR, so please wait for my update.

Thanks
Abner

@redchenjs
Copy link
Contributor Author

An update:

I tried another serial converter FT232H (not FT232R), which supports the baud rate of 4 Mbps, the controller can handle it as well.

@AbnerFederer
Copy link

Hi @redchenjs

Have you done some throughput actions to test?
Any update for this PR is welcomed.

Thanks
Abner

@redchenjs
Copy link
Contributor Author

Hi @redchenjs

Have you done some throughput actions to test?
Any update for this PR is welcomed.

Thanks
Abner

Hi @AbnerFederer

Here's my test result:

Baudrate  Speed(SPP)

921600 bps: 90 KB/s
1 Mbps: 97 KB/s
1.5 Mbps: 147 KB/s
2 Mbps: 194 KB/s
2.5 Mbps: 241 KB/s
3 Mbps: 247 Kb/s - 255 KB/s
3.5 Mbps: 247 Kb/s - 255 KB/s
4 Mbps: 247 Kb/s - 255 KB/s

It looks like there is almost no difference between 3M and 4M baud rates :)

@CLAassistant
Copy link

CLAassistant commented Mar 13, 2020

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@redchenjs
Copy link
Contributor Author

@AbnerFederer @Alvin1Zhang Is there any update?

@ghost
Copy link

ghost commented Apr 23, 2021

Hi

I'm afraid this will cause some errors. So, could you please help add some comments in Help part?
And what about adding several levels of baud rate selections, like 115200, 921600, 200000, 300000, 400000?

Thanks

@redchenjs
Copy link
Contributor Author

Hi

I'm afraid this will cause some errors. So, could you please help add some comments in Help part?
And what about adding several levels of baud rate selections, like 115200, 921600, 200000, 300000, 400000?

Thanks

Hi @Wth-Esp,

How does it look now? Now we can select the baud rate in menuconfig, and all these baud rates are from linux/drivers/tty/tty_baudrate.c, they should be the standard baud rate.

@ghost
Copy link

ghost commented Apr 23, 2021

Hi @redchenjs

LGTM now.
I will do the PR handling procedure as soon as possible.

Thanks for your contribution.

@Alvin1Zhang
Copy link
Collaborator

Thanks for your contribution, and sorry for late reply, we have put the changes into our internal review queue, and the PR will be updated once the changes are available on GitHub. Thanks.

@maciejopalinski
Copy link

Hi @redchenjs
Have you done some throughput actions to test?
Any update for this PR is welcomed.
Thanks
Abner

Hi @AbnerFederer

Here's my test result:

Baudrate  Speed(SPP)

921600 bps: 90 KB/s
1 Mbps: 97 KB/s
1.5 Mbps: 147 KB/s
2 Mbps: 194 KB/s
2.5 Mbps: 241 KB/s
3 Mbps: 247 Kb/s - 255 KB/s
3.5 Mbps: 247 Kb/s - 255 KB/s
4 Mbps: 247 Kb/s - 255 KB/s

It looks like there is almost no difference between 3M and 4M baud rates :)

It is very interesting that there is no difference between 3M, 3.5M and 4M baud rates. I checked the communication with a logic analyzer and 3.5M/4M baud is giving the same exact signal as 3M. I calculated it being exactly 3M baud. Is this a linux bug or a limitation of my CH340 chip?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants