akauppi / Embassy-playground-2024

Embassy playground for ESP32-{C3|C6} chips
1 stars 0 forks source link

Avoid using `ESP32-C3-DevKitC-02` - for now #1

Open akauppi opened 4 months ago

akauppi commented 4 months ago

On C6:

$ make run
make[1]: Entering directory '/home/ubuntu/Embassy-playground-2024'
cargo build --release --features=esp32c6 --target=riscv32imac-unknown-none-elf
   Compiling esp-hal v0.19.0
   Compiling esp-hal-embassy v0.2.0
   Compiling playground v0.1.0 (/home/ubuntu/Embassy-playground-2024)
    Finished `release` profile [optimized + debuginfo] target(s) in 24.32s
make[1]: Leaving directory '/home/ubuntu/Embassy-playground-2024'
probe-rs run --chip esp32c6 target/riscv32imac-unknown-none-elf/release/app
      Erasing ✔ [00:00:01] [##############################################################################################################] 128.00 KiB/128.00 KiB @ 112.12 KiB/s (eta 0s )
  Programming ✔ [00:00:05] [##################################################################################################################] 26.10 KiB/26.10 KiB @ 4.47 KiB/s (eta 0s )    Finished in 7.681s
INFO  RWDT watchdog enabled!
└─ app::____embassy_main_task::{async_fn#0} @ src/bin/app.rs:47  
INFO  Embassy initialized!
└─ app::____embassy_main_task::{async_fn#0} @ src/bin/app.rs:59  

The erasing and programming starts pretty instantaneously after the probe-rs run command.

INFO RTT messages are shown on the console.

On C3, however:

$ CHIP=esp32c3 make run
make[1]: Entering directory '/home/ubuntu/Embassy-playground-2024'
cargo build --release --features=esp32c3 --target=riscv32imc-unknown-none-elf
   Compiling esp32c3 v0.24.0
   Compiling esp-hal v0.19.0
   Compiling esp-hal-embassy v0.2.0
   Compiling playground v0.1.0 (/home/ubuntu/Embassy-playground-2024)
    Finished `release` profile [optimized + debuginfo] target(s) in 1m 12s
make[1]: Leaving directory '/home/ubuntu/Embassy-playground-2024'
probe-rs run --chip esp32c3 target/riscv32imc-unknown-none-elf/release/app
      Erasing ✔ [00:00:01] [##############################################################################################################] 192.00 KiB/192.00 KiB @ 138.98 KiB/s (eta 0s )
  Programming ✔ [00:00:06] [##################################################################################################################] 25.50 KiB/25.50 KiB @ 4.00 KiB/s (eta 0s )    Finished in 8.459s
 WARN probe_rs::session: Failed to deconfigure device during shutdown: A RISC-V specific error occurred.

Caused by:
    Error occurred during execution of an abstract command: HaltResume
Error: Failed to attach to RTT

Caused by:
    Error attempting to attach to RTT: RTT control block not found in target memory.
    - Make sure RTT is initialized on the target, AND that there are NO target breakpoints before RTT initialization.
    - For VSCode and probe-rs-debugger users, using `halt_after_reset:true` in your `launch.json` file will prevent RTT
    initialization from happening on time.
    - Depending on the target, sleep modes can interfere with RTT.
make: *** [Makefile:53: run] Error 1
probe-rs 0.24.0
akauppi commented 4 months ago

Worth trying - #later:

akauppi commented 4 months ago

Root cause might be here.

akauppi commented 3 months ago

A user called okhsunrog brought this up on Matrix, and likely caused a fix to be made: https://github.com/probe-rs/probe-rs/pull/2742/commits/3085cc174dc40cfeccaca23354678097651987f8