-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enabling MTU work-around for ESP32-C3 and all Xtensa based MCUs (#282)
Bringing back a 'Cargo.toml' section accidentially removed and needed by Xtensa Co-authored-by: Asko Kauppi <[email protected]>
- Loading branch information
Showing
3 changed files
with
21 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
/// Size of L2CAP packets | ||
#[cfg(not(any(feature = "esp32c2", feature = "esp32c6", feature = "esp32h2")))] | ||
pub const L2CAP_MTU: usize = 251; | ||
// Some esp chips only accept an MTU >= 255 | ||
#[cfg(any(feature = "esp32c2", feature = "esp32c6", feature = "esp32h2"))] | ||
pub const L2CAP_MTU: usize = 255; | ||
/// | ||
/// 'esp-hal' likely has a bug, causing _some_ ESP32 chips to give "Invalid HCI Command Parameters" BLE errors at launch, | ||
/// if the L2CAP MTU is set low enough. | ||
/// | ||
/// The error producing ranges go: | ||
/// - ESP32-C6: x..<255 // examples with 128, 251 would fail | ||
/// - ESP32-C2: RANGE NOT KNOWN // not having the hardware | ||
/// - ESP32-H2: RANGE NOT KNOWN // not having the hardware | ||
/// - ESP32, -C3, -S2: claimed not to be affected [1] | ||
/// [1]: https://github.com/embassy-rs/trouble/pull/236#issuecomment-2586457641 | ||
/// | ||
/// - ESP32-S3: 251 (presumably x..<255), see [2]: | ||
/// [2]: https://matrix.to/#/#esp-rs:matrix.org/$ZzC-QWHocidnEXtn5vAxcsGnUDLTnk4NGf9Cr7kVrjo | ||
/// | ||
/// Playing safe by using '255' (that works for all) | ||
pub const L2CAP_MTU: usize = 255; |