mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-16 21:05:35 +01:00
CI: Add ESP32-C3 QEMU support (#914)
* CI: ESP32-C3: QEMU support * CI: ESP32C3: Script for preparing and running * CI: gitignore qemu.log * ESP32-C3: Example sw_and_hw output
This commit is contained in:
parent
420ca51058
commit
e4cc5fd17b
5 changed files with 153 additions and 3 deletions
|
|
@ -1,5 +1,9 @@
|
|||
[target.riscv32imc-unknown-none-elf]
|
||||
runner = "espflash flash --monitor"
|
||||
# Real hardware
|
||||
#runner = "espflash flash --monitor"
|
||||
|
||||
# QEMU emulator
|
||||
runner = "./runner.sh"
|
||||
|
||||
[build]
|
||||
rustflags = [
|
||||
|
|
|
|||
29
examples/esp32c3/runner.sh
Executable file
29
examples/esp32c3/runner.sh
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
echo "No arguments supplied! Provide path to ELF as argument"
|
||||
fi
|
||||
|
||||
outputfilenamecargo=$1
|
||||
outputfilename="$outputfilenamecargo".bin
|
||||
|
||||
logfile=qemu.log
|
||||
|
||||
qemuexec=qemu-system-riscv32
|
||||
|
||||
# Building ESP32-C3 image
|
||||
espflash save-image --chip esp32c3 --merge "$outputfilenamecargo" "$outputfilename" 1>&2
|
||||
|
||||
# Get stats
|
||||
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" &
|
||||
|
||||
# Let it run
|
||||
sleep 3s
|
||||
|
||||
# Kill QEMU nicely by sending 'q' (quit) over tcp
|
||||
echo q | nc -N 127.0.0.1 55555
|
||||
cat "$logfile"
|
||||
Loading…
Add table
Add a link
Reference in a new issue