Update support/example for ESP32-C3 to use latest versions of dependencies (#975)

* Update `rtic` package to use latest version of `esp32c3` dependency

* Update `rtic-macros` ESP32-C3 bindings to reflect changes in HAL

* Update the ESP32-C3 examples to use latest versions of all dependencies

* Update changelogs

* adjust expected qemu output, add compile-time checks

* remove runtime checks, this is checked at compile time

* fix expected qemu output

* Clean up interrupt enable code a bit

* Update `rtic-monotonic` to use the latest PAC for ESP32-C3

* Update `CHANGELOG.md` for `rtic-monotonic`

* ci: esp32c3: Format runner.sh

* ci: esp32c3: Default to silent boot

export DEBUGGING while running to get verbose boot

env DEBUGGING=1 cargo xtask ...

* ci: esp32c3: Update expected example output

---------

Co-authored-by: onsdagens <pawdzi-7@student.ltu.se>
Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
This commit is contained in:
Jesse Braham 2024-10-16 12:29:51 -07:00 committed by GitHub
parent 89d76a53d8
commit 1f6b6a42e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 463 additions and 440 deletions

File diff suppressed because it is too large Load diff

View file

@ -7,18 +7,17 @@ license = "MIT OR Apache-2.0"
[workspace]
[dependencies]
rtic = {path = "../../rtic/"}
rtic = { path = "../../rtic/" }
rtic-monotonics = {path = "../../rtic-monotonics/"}
esp-hal = { version = "0.16.1", features = ["esp32c3", "direct-vectoring", "interrupt-preemption"] }
esp-backtrace = { version = "0.11.0", features = [
esp-hal = { version = "0.20.1", features = ["esp32c3"] }
esp-backtrace = { version = "0.14.0", features = [
"esp32c3",
"panic-handler",
"exception-handler",
"println",
] }
esp32c3 = {version = "0.22.0", features = ["critical-section"]}
esp-println = { version = "0.9.0", features = ["esp32c3", "uart"] }
esp32c3 = {version = "0.25.0", features = ["critical-section"]}
esp-println = { version = "0.11.0", features = ["esp32c3"] }
[features]
test-critical-section = []

View file

@ -4,17 +4,17 @@
mod app {
use esp_backtrace as _;
use esp_hal::{
gpio::{Event, Gpio9, Input, PullDown, IO},
gpio::{Event, GpioPin, Input, Io, Pull},
peripherals::Peripherals,
prelude::*,
};
use esp_println::println;
#[shared]
struct Shared {}
#[local]
struct Local {
button: Gpio9<Input<PullDown>>,
button: Input<'static, GpioPin<9>>,
}
// do nothing in init
@ -22,14 +22,14 @@ mod app {
fn init(_: init::Context) -> (Shared, Local) {
println!("init");
let peripherals = Peripherals::take();
let io = IO::new(peripherals.GPIO, peripherals.IO_MUX);
let mut button = io.pins.gpio9.into_pull_down_input();
let io = Io::new_no_bind_interrupt(peripherals.GPIO, peripherals.IO_MUX);
let mut button = Input::new(io.pins.gpio9, Pull::Up);
button.listen(Event::FallingEdge);
foo::spawn().unwrap();
(Shared {}, Local { button })
}
#[idle()]
#[idle]
fn idle(_: idle::Context) -> ! {
println!("idle");
loop {}
@ -46,6 +46,7 @@ mod app {
}
println!("Leaving high prio task.");
}
#[task(priority = 2)]
async fn bar(_: bar::Context) {
println!("Inside low prio task, press button now!");

View file

@ -1,8 +1,7 @@
#!/bin/bash
if [ $# -eq 0 ]
then
echo "No arguments supplied! Provide path to ELF as argument"
if [ $# -eq 0 ]; then
echo "No arguments supplied! Provide path to ELF as argument"
fi
outputfilenamecargo=$1
@ -19,13 +18,20 @@ espflash save-image --chip esp32c3 --merge "$outputfilenamecargo" "$outputfilena
esptool.py image_info --version 2 "$outputfilename" 1>&2
# Run in QEMU
$qemuexec -nographic -monitor tcp:127.0.0.1:55555,server,nowait -icount 3 -machine esp32c3 -drive file="$outputfilename",if=mtd,format=raw -serial file:"$logfile" &
$qemuexec -nographic -monitor tcp:127.0.0.1:55555,server,nowait -icount 3 -machine esp32c3 -drive file="$outputfilename",if=mtd,format=raw -serial file:"$logfile" &
# Let it run
sleep 3s
# Kill QEMU nicely by sending 'q' (quit) over tcp
echo q | nc -N 127.0.0.1 55555
# Output that will be compared, remove the esp_image segments as they change
# between runs
cat "$logfile" | sed 's/esp_image: .*$/esp_image: REDACTED/'
# Output that will be compared must be printed to stdout
# Make boot phase silent, for debugging change, run with e.g. $ `env DEBUGGING=true` cargo xtask....
if [ -n "${DEBUGGING}" ]; then
# Debugging: strip leading "I (xyz)" where xyz is an incrementing number, and esp_image specifics
sed -e 's/esp_image: .*$/esp_image: REDACTED/' -e 's/I\s\([0-9]*\)(.*)/\1/' < $logfile
else
tail -n +12 "$logfile" | sed -e '/I\s\([0-9]*\)(.*)/d'
fi