Skip to content

[tof] multiboard example cannot be run using probe-rs #12

Open
@lure23

Description

@lure23

Using espflash

Connecting the devkit to UART USB port, and using espflash for running:

make -f Makefile.dev ms
[...]
FlockResults { board_index: 0, res: ResultsData { target_status: [[[Valid, Valid, Valid, Valid], [Valid, Valid, Valid, Valid], [Valid, Valid, Valid, Valid], [Valid, Valid, Valid, Valid]]], distance_mm: [[[333, 286, 276, 856], [333, 372, 1143, 692], [436, 508, 612, 658], [440, 490, 596, 531]]] }, temp_degc: TempC(27), time_stamp: Instant { ticks: 4159808 } }

OK

Using probe-rs

However, if connected to the JTAG USB port (without serial output, just using Watch from embassy-sync) and run using probe-rs:

$ make -f Makefile.dev m
EXAMPLE=many-emb \
  FEATURES=flock,distance_mm \
  EMBASSY_EXECUTOR_TASK_ARENA_SIZE=50000 make -f Makefile.dev --no-print-directory _build _run
DEFMT_LOG=debug cargo build --release --features=flock,distance_mm,defmt --example many-emb
   Compiling vl53l5cx_uld v0.0.0 (/home/ubuntu/VL53L5CX_rs.tof/tof/vl53l5cx_uld)
   Compiling vl53l5cx v0.0.0 (/home/ubuntu/VL53L5CX_rs.tof/tof/vl53l5cx)
    Finished `release` profile [optimized + debuginfo] target(s) in 8.93s
probe-rs run --log-format '{t:dimmed} [{L:bold}] {s}' /home/ubuntu/target/riscv32imac-unknown-none-elf/release/examples/many-emb
      Erasing ✔ 100% [####################] 320.00 KiB @ 104.14 KiB/s (took 3s)
  Programming ✔ 100% [####################] 151.73 KiB @   2.88 KiB/s (took 53s)                                                                                                                    Finished in 52.77s
0.902575 [INFO ] Targets powered off and on again.
0.902657 [DEBUG] I2C ADDR: 0 -> 0x29_u7
0.906255 [DEBUG] Ping succeeded: 0xf0,0x02
3.644096 [DEBUG] Board now reachable as: 0x29_u7
3.644375 [DEBUG] Init of board 0 succeeded
3.646323 [INFO ] Init succeeded
3.996597 [ERROR] Exception 'Load access fault' mepc=0x42008f64, mtval=0x11000500
3.996718 [ERROR] TrapFrame { ra: 1107438014, t0: 3996453, t1: 914391040, t2: 0, t3: 67305733, t4: 251658240, t5: 0, t6: 0, a0: 1082554016, a1: 1, a2: 1, a3: 4, a4: 1107332882, a5: 1082138760, a6: 0, a7: 0, s0: 1082577264, s1: 2328, s2: 1082137632, s3: 0, s4: 4294967295, s5: 4294967293, s6: 4, s7: 285213952, s8: 1082136312, s9: 1082135967, s10: 1082136272, s11: 0, gp: 1082134704, tp: 0, sp: 1082577184, pc: 1107332964, mstatus: 6273, mcause: 5, mtval: 285213952 }
3.997030 [ERROR] 0x420229ba
3.997064 [ERROR] 0x42024c96
3.997098 [ERROR] 0x420097a2
3.997131 [ERROR] 0x4200745e
3.997163 [ERROR] 0x42001d2e
3.997195 [ERROR] 0x42001b84
3.997228 [ERROR] 0x4201bb76
3.997262 [ERROR] 0x4200a2ec
3.997295 [ERROR] 0x42000130
Frame 0: syscall_readonly @ 0x42022924 inline
       /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/semihosting-0.1.16/src/sys/arm_compat/syscall/riscv.rs:35:9

Without --release:

$ make -f Makefile.dev md
EXAMPLE=many-emb \
  FEATURES=flock,distance_mm \
  BUILD_MODE="" \
  EMBASSY_EXECUTOR_TASK_ARENA_SIZE=50000 make -f Makefile.dev --no-print-directory _build _run
DEFMT_LOG=debug cargo build  --features=flock,distance_mm,defmt --example many-emb
[...]
probe-rs run --log-format '{t:dimmed} [{L:bold}] {s}' /home/ubuntu/target/riscv32imac-unknown-none-elf/debug/examples/many-emb
[...]
4.781192 [DEBUG] Timing [ms] (total 99.314): wait+read 99.306, passing 0.008
4.883343 [INFO ] Data #0: (30°C, +792ms)
4.883415 [INFO ] .target_status:    [[[Valid, Valid, Valid, Valid], [Valid, Valid, Valid, Valid], [Valid, Valid, Valid, Valid], [Valid, Valid, Valid, Valid]]]
4.883524 [INFO ] .distance_mm:      [[[395, 290, 276, 861], [333, 353, 1142, 695], [428, 491, 641, 673], [447, 505, 590, 565]]]

= works

Conclusion

The combination of:

  • embassy-sync Watch feature (not yet released, from GitHub main)
  • probe-rs (probe-rs 0.24.0 (git commit: 21739db0))
  • --release build

..causes the above exception.

Have reported this in:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions