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

ESP32-C6 BLE Support #262

Merged
merged 2 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,12 @@ jobs:
run: cd examples-${{ matrix.chip }} && cargo +nightly-2023-05-16 build --release --example=embassy_access_point --features=async,wifi,embassy-net

- name: check (common features + ble)
if: ${{ matrix.chip == 'esp32c2' || matrix.chip == 'esp32c3' }}
run: cd examples-${{ matrix.chip }} && cargo +nightly-2023-05-16 check --features=async,wifi,ble,esp-now,embassy-net,log
- name: check (common features + ble + defmt)
if: ${{ matrix.chip == 'esp32c2' || matrix.chip == 'esp32c3' }}
run: cd examples-${{ matrix.chip }} && cargo +nightly-2023-05-16 check --no-default-features --features=${{ matrix.chip }},async,wifi,ble,esp-now,embassy-net,defmt
- name: check (ble)
if: ${{ matrix.chip == 'esp32c2' || matrix.chip == 'esp32c3' }}
run: cd examples-${{ matrix.chip }} && cargo +nightly-2023-05-16 build --release --example=ble --features=ble
- name: check (async_ble)
if: ${{ matrix.chip == 'esp32c2' || matrix.chip == 'esp32c3' }}
run: cd examples-${{ matrix.chip }} && cargo +nightly-2023-05-16 build --release --example=async_ble --features=async,ble
- name: check (coex)
if: ${{ matrix.chip == 'esp32c3' }}
Expand Down
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,8 @@ futures-util = { version = "0.3.28", default-features = false }
esp-println = { version = "0.6.0" }
esp-backtrace = { version = "0.8.0", features = ["panic-handler", "exception-handler", "print-uart"] }
embedded-hal-async = { version = "1.0.0-rc.1" }

# patching esp32c6-hal for BLE - it would compile with 0.5.0 but not work
[patch.crates-io]
esp32c6-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "4c34ebe9e264fcc31fabba862274adae8daa680a" }
esp-hal-common = { git = "https://github.com/esp-rs/esp-hal.git", rev = "4c34ebe9e264fcc31fabba862274adae8daa680a" }
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If a cell contains am em dash (—) this means that the particular feature i
| ESP32-S3 | ✓ | ✓ | ✓ | ✓ |
| ESP32-C3 | ✓ | ✓ | ✓ | ✓ |
| ESP32-C2 | ✓ | ✓ | | ✓ |
| ESP32-C6 | ✓ | | | ✓ |
| ESP32-C6 | ✓ | | | ✓ |


## Usage
Expand Down
2 changes: 2 additions & 0 deletions esp-wifi-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ fn copy_libraries(out: &PathBuf) -> Result<()> {

#[cfg(feature = "esp32c6")]
fn copy_libraries(out: &PathBuf) -> Result<()> {
copy_file(out, "libs/esp32c6/libble_app.a", "libble_app.a")?;
copy_file(out, "libs/esp32c6/libbtbb.a", "libbtbb.a")?;
copy_file(out, "libs/esp32c6/libcoexist.a", "libcoexist.a")?;
copy_file(out, "libs/esp32c6/libcore.a", "libcore.a")?;
Expand All @@ -180,6 +181,7 @@ fn copy_libraries(out: &PathBuf) -> Result<()> {
"libwpa_supplicant.a",
)?;

println!("cargo:rustc-link-lib={}", "ble_app");
println!("cargo:rustc-link-lib={}", "btbb");
println!("cargo:rustc-link-lib={}", "coexist");
println!("cargo:rustc-link-lib={}", "core");
Expand Down
2 changes: 1 addition & 1 deletion esp-wifi-sys/include/include.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "phy.h"
#include "esp_timer.h"

#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C6)
#if !defined(CONFIG_IDF_TARGET_ESP32S2)
#include "esp_bt.h"
#include "esp_coexist_internal.h"
#include "esp_coexist_adapter.h"
Expand Down
Binary file modified esp-wifi-sys/libs/esp32c6/libble_app.a
Binary file not shown.
Binary file added esp-wifi-sys/libs/esp32h2/libble_app.a
Binary file not shown.