Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 22 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,15 @@ jobs:
- name: check esp32-hal (common features)
run: |
cd esp32-hal/
cargo check --examples --features=eh1,ufmt,log
cargo check --examples --features=eh1,ufmt,defmt
cargo build --examples --features=eh1,ufmt,log
cargo build --examples --features=eh1,ufmt,defmt
- name: check esp32-hal (embassy)
run: |
cd esp32-hal/
cargo check --example=embassy_hello_world --features=embassy,embassy-time-timg0,embassy-executor-thread
cargo check --example=embassy_multicore --features=embassy,embassy-time-timg0,embassy-executor-thread
cargo check --example=embassy_multicore_interrupt --features=embassy,embassy-time-timg0,embassy-executor-interrupt
cargo check --example=embassy_multiprio --features=embassy,embassy-time-timg0,embassy-executor-interrupt
cargo check --examples --features=embassy,embassy-time-timg0,embassy-executor-interrupt,embassy-executor-thread,defmt
cargo check --examples --features=embassy,embassy-time-timg0,embassy-executor-interrupt,embassy-executor-thread,log
- name: check esp32-hal (embassy, async)
run: |
cd esp32-hal/
Expand Down Expand Up @@ -140,8 +138,8 @@ jobs:
- name: check esp32c2-hal (common features)
run: |
cd esp32c2-hal/
cargo +nightly check --examples --features=eh1,ufmt,log
cargo +nightly check --examples --features=eh1,ufmt,defmt
cargo +nightly build --examples --features=eh1,ufmt,log
cargo +nightly build --examples --features=eh1,ufmt,defmt
- name: check esp32c2-hal (async, systick)
run: cd esp32c2-hal/ && cargo +nightly check --example=embassy_hello_world --features=embassy,embassy-time-systick
- name: check esp32c2-hal (async, timg0)
Expand All @@ -155,9 +153,9 @@ jobs:
- name: check esp32c2-hal (async, i2c)
run: cd esp32c2-hal/ && cargo +nightly check --example=embassy_i2c --features=embassy,embassy-time-systick,async
- name: check esp32c2-hal (interrupt-preemption)
run: cd esp32c2-hal/ && cargo check --example=interrupt_preemption --features=interrupt-preemption
run: cd esp32c2-hal/ && cargo +nightly check --example=interrupt_preemption --features=interrupt-preemption
- name: check esp32c2-hal (direct-vectoring)
run: cd esp32c2-hal/ && cargo check --example=direct-vectoring --features=direct-vectoring
run: cd esp32c2-hal/ && cargo +nightly check --example=direct-vectoring --features=direct-vectoring
- name: check esp32c2-hal (embassy, log/defmt)
run: |
cd esp32c2-hal/
Expand Down Expand Up @@ -194,8 +192,8 @@ jobs:
- name: check esp32c3-hal (common features)
run: |
cd esp32c3-hal/
cargo +nightly check --examples --features=eh1,ufmt,log
cargo +nightly check --examples --features=eh1,ufmt,defmt
cargo +nightly build --examples --features=eh1,ufmt,log
cargo +nightly build --examples --features=eh1,ufmt,defmt
- name: check esp32c3-hal (async, systick)
run: cd esp32c3-hal/ && cargo +nightly check --example=embassy_hello_world --features=embassy,embassy-time-systick
- name: check esp32c3-hal (async, timg0)
Expand All @@ -209,9 +207,9 @@ jobs:
- name: check esp32c3-hal (async, i2c)
run: cd esp32c3-hal/ && cargo +nightly check --example=embassy_i2c --features=embassy,embassy-time-systick,async
- name: check esp32c3-hal (interrupt-preemption)
run: cd esp32c3-hal/ && cargo check --example=interrupt_preemption --features=interrupt-preemption
run: cd esp32c3-hal/ && cargo +nightly check --example=interrupt_preemption --features=interrupt-preemption
- name: check esp32c3-hal (direct-vectoring)
run: cd esp32c3-hal/ && cargo check --example=direct-vectoring --features=direct-vectoring
run: cd esp32c3-hal/ && cargo +nightly check --example=direct-vectoring --features=direct-vectoring
- name: check esp32c3-hal (embassy, log/defmt)
run: |
cd esp32c3-hal/
Expand Down Expand Up @@ -251,8 +249,8 @@ jobs:
- name: check esp32c6-hal (common features)
run: |
cd esp32c6-hal/
cargo +nightly check --examples --features=eh1,ufmt,log
cargo +nightly check --examples --features=eh1,ufmt,defmt
cargo +nightly build --examples --features=eh1,ufmt,log
cargo +nightly build --examples --features=eh1,ufmt,defmt
- name: check esp32c6-hal (async, systick)
run: cd esp32c6-hal/ && cargo +nightly check --example=embassy_hello_world --features=embassy,embassy-time-systick
- name: check esp32c6-hal (async, timg0)
Expand All @@ -266,9 +264,9 @@ jobs:
- name: check esp32c6-hal (async, i2c)
run: cd esp32c6-hal/ && cargo +nightly check --example=embassy_i2c --features=embassy,embassy-time-systick,async
- name: check esp32c6-hal (interrupt-preemption)
run: cd esp32c6-hal/ && cargo check --example=interrupt_preemption --features=interrupt-preemption
run: cd esp32c6-hal/ && cargo +nightly check --example=interrupt_preemption --features=interrupt-preemption
- name: check esp32c6-hal (direct-vectoring)
run: cd esp32c6-hal/ && cargo check --example=direct-vectoring --features=direct-vectoring
run: cd esp32c6-hal/ && cargo +nightly check --example=direct-vectoring --features=direct-vectoring
- name: check esp32c6-hal (embassy, log/defmt)
run: |
cd esp32c6-hal/
Expand Down Expand Up @@ -323,8 +321,8 @@ jobs:
- name: check esp32h2-hal (common features)
run: |
cd esp32h2-hal/
cargo +nightly check --examples --features=eh1,ufmt,log
cargo +nightly check --examples --features=eh1,ufmt,defmt
cargo +nightly build --examples --features=eh1,ufmt,log
cargo +nightly build --examples --features=eh1,ufmt,defmt
- name: check esp32h2-hal (async, systick)
run: cd esp32h2-hal/ && cargo +nightly check --example=embassy_hello_world --features=embassy,embassy-time-systick
- name: check esp32h2-hal (async, timg0)
Expand All @@ -338,9 +336,9 @@ jobs:
- name: check esp32h2-hal (async, i2c)
run: cd esp32h2-hal/ && cargo +nightly check --example=embassy_i2c --features=embassy,embassy-time-systick,async
- name: check esp32h2-hal (interrupt-preemption)
run: cd esp32h2-hal/ && cargo check --example=interrupt_preemption --features=interrupt-preemption
run: cd esp32h2-hal/ && cargo +nightly check --example=interrupt_preemption --features=interrupt-preemption
- name: check esp32h2-hal (direct-vectoring)
run: cd esp32h2-hal/ && cargo check --example=direct-vectoring --features=direct-vectoring
run: cd esp32h2-hal/ && cargo +nightly check --example=direct-vectoring --features=direct-vectoring
- name: check esp32h2-hal (embassy, log/defmt)
run: |
cd esp32h2-hal/
Expand Down Expand Up @@ -371,8 +369,8 @@ jobs:
- name: check esp32s2-hal (common features)
run: |
cd esp32s2-hal/
cargo check --examples --features=eh1,ufmt,log
cargo check --examples --features=eh1,ufmt,defmt
cargo build --examples --features=eh1,ufmt,log
cargo build --examples --features=eh1,ufmt,defmt
# FIXME: `time-systick` feature disabled for now, see 'esp32s2-hal/Cargo.toml'.
# - name: check esp32s2-hal (async, systick)
# run: cd esp32s2-hal/ && cargo check --example=embassy_hello_world --features=embassy,embassy-time-systick,executor
Expand Down Expand Up @@ -428,8 +426,8 @@ jobs:
- name: check esp32s3-hal (common features)
run: |
cd esp32s3-hal/
cargo check --examples --features=eh1,ufmt,log
cargo check --examples --features=eh1,ufmt,defmt
cargo build --examples --features=eh1,ufmt,log
cargo build --examples --features=eh1,ufmt,defmt
- name: check esp32s3-hal (embassy, timg0)
run: |
cd esp32s3-hal/
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- S3: Allow powering down RC_FAST_CLK (#796)
- UART/ESP32: fix calculating FIFO counter with `get_rx_fifo_count()` (#804)
- Xtensa targets: Use ESP32Reset - not Reset (#823)
- Examples should now work with the `defmt` feature (#810)

### Removed

Expand Down
6 changes: 3 additions & 3 deletions esp32-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ embedded-io-async = "0.5.0"
esp-alloc = "0.3.0"
esp-backtrace = { version = "0.8.0", features = ["esp32", "panic-handler", "exception-handler", "print-uart"] }
esp-hal-smartled = { version = "0.5.0", features = ["esp32"], path = "../esp-hal-smartled" }
esp-println = { version = "0.6.0", features = ["esp32", "log"] }
esp-println = { version = "0.6.0", features = ["esp32"] }
heapless = "0.7.16"
lis3dh-async = "0.8.0"
sha2 = { version = "0.10.7", default-features = false}
Expand All @@ -54,9 +54,9 @@ default = ["rt", "vectored", "xtal-40mhz"]
async = ["esp-hal-common/async"]
bluetooth = []
debug = ["esp-hal-common/debug"]
defmt = ["esp-hal-common/defmt"]
defmt = ["esp-hal-common/defmt", "esp-println/defmt"]
eh1 = ["esp-hal-common/eh1"]
log = ["esp-hal-common/log"]
log = ["esp-hal-common/log", "esp-println/log"]
rt = []
ufmt = ["esp-hal-common/ufmt"]
vectored = ["esp-hal-common/vectored"]
Expand Down
3 changes: 3 additions & 0 deletions esp32-hal/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ fn main() -> Result<(), Box<dyn Error>> {
// instead of when any part of the source code changes.
println!("cargo:rerun-if-changed=ld/memory.x");

#[cfg(feature = "defmt")]
println!("cargo:rustc-link-arg=-Tdefmt.x");

Ok(())
}

Expand Down
10 changes: 6 additions & 4 deletions esp32-hal/examples/embassy_i2s_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use esp32_hal::{
IO,
};
use esp_backtrace as _;
use esp_println::println;
use static_cell::make_static;

#[embassy_executor::task]
Expand All @@ -45,16 +46,16 @@ async fn i2s_task(
>,
) {
let buffer = dma_buffer();
esp_println::println!("Start");
println!("Start");

let mut data = [0u8; 5000];
let mut transaction = i2s_rx.read_dma_circular_async(buffer).unwrap();
loop {
let avail = transaction.available().await;
esp_println::println!("available {}", avail);
println!("available {}", avail);

let count = transaction.pop(&mut data).await.unwrap();
esp_println::println!(
println!(
"got {} bytes, {:x?}..{:x?}",
count,
&data[..10],
Expand All @@ -65,8 +66,9 @@ async fn i2s_task(

#[entry]
fn main() -> ! {
#[cfg(feature = "log")]
esp_println::logger::init_logger_from_env();
esp_println::println!("Init!");
println!("Init!");
let peripherals = Peripherals::take();
let system = peripherals.SYSTEM.split();
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
Expand Down
10 changes: 6 additions & 4 deletions esp32-hal/examples/embassy_i2s_sound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ use esp32_hal::{
IO,
};
use esp_backtrace as _;
use esp_println::println;
use static_cell::make_static;

const SINE: [i16; 64] = [
Expand Down Expand Up @@ -86,25 +87,26 @@ async fn i2s_task(
let mut filler = [0u8; 10000];
let mut idx = 32000 % data.len();

esp_println::println!("Start");
println!("Start");
let mut transaction = i2s_tx.write_dma_circular_async(buffer).unwrap();

loop {
for i in 0..filler.len() {
filler[i] = data[(idx + i) % data.len()];
}
esp_println::println!("Next");
println!("Next");

let written = transaction.push(&filler).await.unwrap();
idx = (idx + written) % data.len();
esp_println::println!("written {}", written);
println!("written {}", written);
}
}

#[entry]
fn main() -> ! {
#[cfg(feature = "log")]
esp_println::logger::init_logger_from_env();
esp_println::println!("Init!");
println!("Init!");
let peripherals = Peripherals::take();
let system = peripherals.SYSTEM.split();
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
Expand Down
1 change: 1 addition & 0 deletions esp32-hal/examples/embassy_rmt_rx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ async fn signal_task(mut pin: Gpio15<Output<PushPull>>) {

#[entry]
fn main() -> ! {
#[cfg(feature = "log")]
esp_println::logger::init_logger_from_env();
println!("Init!");
let peripherals = Peripherals::take();
Expand Down
8 changes: 5 additions & 3 deletions esp32-hal/examples/embassy_rmt_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use esp32_hal::{
IO,
};
use esp_backtrace as _;
use esp_println::println;
use static_cell::make_static;

#[embassy_executor::task]
Expand All @@ -36,17 +37,18 @@ async fn rmt_task(mut channel: Channel0<0>) {
data[data.len() - 1] = PulseCode::default();

loop {
esp_println::println!("transmit");
println!("transmit");
channel.transmit(&data).await.unwrap();
esp_println::println!("transmitted\n");
println!("transmitted\n");
Timer::after(Duration::from_millis(500)).await;
}
}

#[entry]
fn main() -> ! {
#[cfg(feature = "log")]
esp_println::logger::init_logger_from_env();
esp_println::println!("Init!");
println!("Init!");
let peripherals = Peripherals::take();
let system = peripherals.SYSTEM.split();
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
Expand Down
1 change: 1 addition & 0 deletions esp32-hal/examples/psram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ fn main() -> ! {
#[cfg(debug_assertions)]
compile_error!("PSRAM on ESP32 needs to be built in release mode");

#[cfg(feature = "log")]
esp_println::logger::init_logger_from_env();

let peripherals = Peripherals::take();
Expand Down
6 changes: 3 additions & 3 deletions esp32c2-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ embedded-hal-1 = { version = "=1.0.0-rc.1", package = "embedded-hal" }
embedded-hal-async = "=1.0.0-rc.1"
embedded-io-async = "0.5.0"
esp-backtrace = { version = "0.8.0", features = ["esp32c2", "panic-handler", "exception-handler", "print-uart"] }
esp-println = { version = "0.6.0", features = ["esp32c2", "log"] }
esp-println = { version = "0.6.0", features = ["esp32c2"] }
heapless = "0.7.16"
lis3dh-async = "0.8.0"
sha2 = { version = "0.10.7", default-features = false}
Expand All @@ -52,12 +52,12 @@ p256 = {version = "0.13.2", default-features = false, features = ["
default = ["rt", "vectored", "xtal-40mhz"]
async = ["esp-hal-common/async"]
debug = ["esp-hal-common/debug"]
defmt = ["esp-hal-common/defmt"]
defmt = ["esp-hal-common/defmt", "esp-println/defmt"]
direct-boot = ["esp-hal-common/rv-init-data"]
direct-vectoring = ["esp-hal-common/direct-vectoring"]
eh1 = ["esp-hal-common/eh1"]
interrupt-preemption = ["esp-hal-common/interrupt-preemption"]
log = ["esp-hal-common/log"]
log = ["esp-hal-common/log", "esp-println/log"]
rt = []
ufmt = ["esp-hal-common/ufmt"]
vectored = ["esp-hal-common/vectored"]
Expand Down
6 changes: 6 additions & 0 deletions esp32c2-hal/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ fn main() -> Result<(), Box<dyn Error>> {
// instead of when any part of the source code changes.
println!("cargo:rerun-if-changed=ld/memory.x");

#[cfg(feature = "defmt")]
println!("cargo:rustc-link-arg=-Tdefmt.x");

Ok(())
}

Expand All @@ -40,6 +43,9 @@ fn main() -> Result<(), Box<dyn Error>> {
// instead of when any part of the source code changes.
println!("cargo:rerun-if-changed=ld/memory.x");

#[cfg(feature = "defmt")]
println!("cargo:rustc-link-arg=-Tdefmt.x");

Ok(())
}

Expand Down
6 changes: 3 additions & 3 deletions esp32c3-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ embedded-hal-async = "=1.0.0-rc.1"
embedded-io-async = "0.5.0"
esp-backtrace = { version = "0.8.0", features = ["esp32c3", "panic-handler", "exception-handler", "print-uart"] }
esp-hal-smartled = { version = "0.5.0", features = ["esp32c3"], path = "../esp-hal-smartled" }
esp-println = { version = "0.6.0", features = ["esp32c3", "log"] }
esp-println = { version = "0.6.0", features = ["esp32c3"] }
heapless = "0.7.16"
hmac = { version = "0.12.1", default-features = false }
lis3dh-async = "0.8.0"
Expand All @@ -55,12 +55,12 @@ static_cell = { version = "1.2.0", features = ["nightly"] }
default = ["rt", "vectored", "esp-hal-common/rv-zero-rtc-bss"]
async = ["esp-hal-common/async"]
debug = ["esp-hal-common/debug"]
defmt = ["esp-hal-common/defmt"]
defmt = ["esp-hal-common/defmt", "esp-println/defmt"]
direct-boot = ["esp-hal-common/rv-init-data", "esp-hal-common/rv-init-rtc-data"]
direct-vectoring = ["esp-hal-common/direct-vectoring"]
eh1 = ["esp-hal-common/eh1"]
interrupt-preemption = ["esp-hal-common/interrupt-preemption"]
log = ["esp-hal-common/log"]
log = ["esp-hal-common/log", "esp-println/log"]
mcu-boot = []
rt = []
ufmt = ["esp-hal-common/ufmt"]
Expand Down
9 changes: 9 additions & 0 deletions esp32c3-hal/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ fn main() -> Result<(), Box<dyn Error>> {
// instead of when any part of the source code changes.
println!("cargo:rerun-if-changed=ld/memory.x");

#[cfg(feature = "defmt")]
println!("cargo:rustc-link-arg=-Tdefmt.x");

Ok(())
}

Expand All @@ -51,6 +54,9 @@ fn main() -> Result<(), Box<dyn Error>> {
// instead of when any part of the source code changes.
println!("cargo:rerun-if-changed=ld/memory.x");

#[cfg(feature = "defmt")]
println!("cargo:rustc-link-arg=-Tdefmt.x");

Ok(())
}

Expand All @@ -71,5 +77,8 @@ fn main() -> Result<(), Box<dyn Error>> {
// instead of when any part of the source code changes.
println!("cargo:rerun-if-changed=ld/memory.x");

#[cfg(feature = "defmt")]
println!("cargo:rustc-link-arg=-Tdefmt.x");

Ok(())
}
Loading