Skip to content

Conversation

finalyards
Copy link
Contributor

The upcoming embassy changes in esp-hal are already documented, and can be prepared for.

This PR updates the examples/esp32 to be prepared for the next 1.0.0-rc version. I advocate that this wouldn't be merged, until rc1 or similar, is released. But we can already fine tune the examples.

"trouble-host/defmt",
"bt-hci/defmt",
#"embedded-io/defmt-03",
#"embedded-hal/defmt-03"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were meant to be fully removed in a previous PR. Using this opportunity to clean up.

pub mod ble_bas_central_sec;
pub mod ble_bas_peripheral;
#[cfg(feature = "security")]
pub mod ble_bas_peripheral_sec;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also these are #unrelated. Noticed that the _sec modules were not conditional, but they really should be. Consider this also a cleanup?

esp-radio = { version = "0.15.0", features = [ "unstable", "ble" ] }
esp-preempt = { version = "0.0.1", features = ["log-04"] }
esp-radio = { version = "0.15.0", features = ["ble", "log-04", "unstable"] }
esp-rtos = { version = "0.0.1", features = ["embassy", "log-04"] }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Background: esp-hal-embassy will be gone; esp-preempt was the interim name for the replacement, which eventually will be esp-rtos. The purpose (of esp-hal) is to consolidate async under one module. .

trouble-example-apps = { version = "0.1.0", path = "../apps", features = ["log"] }
trouble-host = { path = "../../host", features = ["default-packet-pool-mtu-255"] }
static_cell = "2"
#static_cell = "2"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be fully removed, but see discussion on radio, later.

esp-bootloader-esp-idf = {git = "https://github.com/lulf/esp-hal.git", branch = "bt-hci-fix"}
esp-hal-embassy = {git = "https://github.com/lulf/esp-hal.git", branch = "bt-hci-fix"}
esp-alloc = {git = "https://github.com/lulf/esp-hal.git", branch = "bt-hci-fix"}
esp-println = {git = "https://github.com/lulf/esp-hal.git", branch = "bt-hci-fix"}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changes in lulf's bt-hci-fix are present in esp-hal main, so I think it's safe to replace them with pointer to the esp-hal main, itself.

esp-hal = { git = "https://github.com/esp-rs/esp-hal.git" }
esp-println = { git = "https://github.com/esp-rs/esp-hal.git" }
esp-radio = { git = "https://github.com/esp-rs/esp-hal.git" }
esp-rtos = { git = "https://github.com/esp-rs/esp-hal.git" }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needed to test the PR, until 1.0.0-rc1 is released.

static RADIO: StaticCell<Controller<'static>> = StaticCell::new();
let radio = RADIO.init(esp_radio::init().unwrap());
//static RADIO: StaticCell<Controller<'static>> = StaticCell::new();
//let radio = RADIO.init(esp_radio::init().unwrap());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Q: is it okay to toss away the static initializatio of radio?

The code works (when changing to &radio, below), but I haven't seen mention of this in the esp-hal project. And their own samples still use StaticCell - here and here.

Opinions or knowledge?

#[cfg(feature = "esp32")]
{
esp_hal_embassy::init(timg0.timer1);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those blocks are no longer needed, due to the API change (esp_rtos).

use esp_radio::Controller;
use static_cell::StaticCell;
//use esp_radio::Controller;
//use static_cell::StaticCell;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

From here on, it's the same story for each of the samples.

@finalyards finalyards marked this pull request as draft October 3, 2025 12:44
@jamessizeland
Copy link
Collaborator

thanks for doing this!

@HaoboGu
Copy link
Collaborator

HaoboGu commented Oct 14, 2025

1.0.0-rc1 was released yesterday

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.

3 participants