Skip to content

Commit

Permalink
cyw43: add Bluetooth support.
Browse files Browse the repository at this point in the history
Co-Authored-By: Brandon Ros <brandonros1@gmail.com>
  • Loading branch information
Dirbaio and brandonros committed Aug 5, 2024
1 parent afc8e68 commit 4f7ac19
Show file tree
Hide file tree
Showing 21 changed files with 1,037 additions and 84 deletions.
2 changes: 2 additions & 0 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ cargo batch \
--- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt' \
--- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'log,firmware-logs' \
--- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt,firmware-logs' \
--- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'log,firmware-logs,bluetooth' \
--- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt,firmware-logs,bluetooth' \
--- build --release --manifest-path cyw43-pio/Cargo.toml --target thumbv6m-none-eabi --features '' \
--- build --release --manifest-path cyw43-pio/Cargo.toml --target thumbv6m-none-eabi --features 'overclock' \
--- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840 \
Expand Down
Binary file modified cyw43-firmware/43439A0.bin
100755 → 100644
Binary file not shown.
Binary file added cyw43-firmware/43439A0_btfw.bin
Binary file not shown.
Binary file modified cyw43-firmware/43439A0_clm.bin
100755 → 100644
Binary file not shown.
11 changes: 8 additions & 3 deletions cyw43-firmware/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# WiFi firmware
# WiFi + Bluetooth firmware blobs

Firmware obtained from https://github.com/Infineon/wifi-host-driver/tree/master/WiFi_Host_Driver/resources/firmware/COMPONENT_43439
Firmware obtained from https://github.com/georgerobotics/cyw43-driver/tree/main/firmware

Licensed under the [Infineon Permissive Binary License](./LICENSE-permissive-binary-license-1.0.txt)

## Changelog

* 2023-07-28: synced with `ad3bad0` - Update 43439 fw from 7.95.55 ot 7.95.62
* 2023-08-21: synced with `a1dc885` - Update 43439 fw + clm to come from `wb43439A0_7_95_49_00_combined.h` + add Bluetooth firmware
* 2023-07-28: synced with `ad3bad0` - Update 43439 fw from 7.95.55 to 7.95.62

## Notes

If you update these files, please update the lengths in the `tests/rp/src/bin/cyw43_perf.rs` test (which relies on these files running from RAM).
9 changes: 8 additions & 1 deletion cyw43-pio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ where
let read_bits = read.len() * 32 + 32 - 1;

#[cfg(feature = "defmt")]
defmt::trace!("write={} read={}", write_bits, read_bits);
defmt::trace!("cmd_read write={} read={}", write_bits, read_bits);

#[cfg(feature = "defmt")]
defmt::trace!("cmd_read cmd = {:02x} len = {}", cmd, read.len());

unsafe {
instr::set_y(&mut self.sm, read_bits as u32);
Expand All @@ -201,6 +204,10 @@ where
.rx()
.dma_pull(self.dma.reborrow(), slice::from_mut(&mut status))
.await;

#[cfg(feature = "defmt")]
defmt::trace!("cmd_read cmd = {:02x} len = {} read = {:08x}", cmd, read.len(), read);

status
}
}
Expand Down
8 changes: 6 additions & 2 deletions cyw43/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ repository = "https://github.com/embassy-rs/embassy"
documentation = "https://docs.embassy.dev/cyw43"

[features]
defmt = ["dep:defmt", "heapless/defmt-03", "embassy-time/defmt"]
defmt = ["dep:defmt", "heapless/defmt-03", "embassy-time/defmt", "bt-hci?/defmt", "embedded-io-async?/defmt-03"]
log = ["dep:log"]
bluetooth = ["dep:bt-hci", "dep:embedded-io-async"]

# Fetch console logs from the WiFi firmware and forward them to `log` or `defmt`.
firmware-logs = []
Expand All @@ -31,9 +32,12 @@ futures = { version = "0.3.17", default-features = false, features = ["async-awa

embedded-hal-1 = { package = "embedded-hal", version = "1.0" }
num_enum = { version = "0.5.7", default-features = false }

heapless = "0.8.0"

# Bluetooth deps
embedded-io-async = { version = "0.6.0", optional = true }
bt-hci = { git = "https://github.com/alexmoon/bt-hci.git", rev = "b9cd5954f6bd89b535cad9c418e9fdf12812d7c3", optional = true, default-features = false }

[package.metadata.embassy_docs]
src_base = "https://github.com/embassy-rs/embassy/blob/cyw43-v$VERSION/cyw43/src/"
src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/cyw43/src/"
Expand Down
Loading

0 comments on commit 4f7ac19

Please sign in to comment.