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

Add more esp32 examples #202

Merged
merged 1 commit into from
Dec 19, 2024
Merged

Conversation

bytedream
Copy link
Contributor

This PR adds more examples for the esp32 platform.

It introduces an optional esp32 feature to the examples/apps crate that influences the hardcoded L2CAP MTU and is intended to be set by the esp32 examples only. The current MTU of 128 causes a BleHost(Hci(Unsupported Feature or Parameter Value)) error here when using an esp:

trouble/host/src/host.rs

Lines 813 to 820 in aaf2d02

HostBufferSize::new(
host.rx_pool.mtu() as u16,
0,
config::L2CAP_RX_PACKET_POOL_SIZE as u16,
0,
)
.exec(&host.controller)
.await?;

This is a known limitation, as seen in an issue comment over at the esp-idf repo espressif/esp-idf#942 (comment). They wrote that any total host buffer size <= 1021 bytes aren't safe to use (1017 bytes ACL MTU + 4 bytes ACL Data Packet header) as long as ACL packet segmentation isn't implemented, so I've set the MTU to 1017 if the esp feature is activated.
I tested my changes with an ESP32C3 and ESP32S3 and in both cases I was able to use a lower MTU than 1017 but it still failed at 128 (200 failed too, 512 not)

Copy link
Member

@lulf lulf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lulf
Copy link
Member

lulf commented Dec 19, 2024

/test

@lulf lulf merged commit 19b02ee into embassy-rs:main Dec 19, 2024
2 checks passed
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.

2 participants