Skip to content

Commit 9c4fea8

Browse files
committed
ci: remove ESP32 from QEMU smoke tests, add stack trace analysis
- Remove ESP32 original from smoke tests (QEMU doesn't emulate PHY correctly) - Add automatic addr2line stack trace decoding on crash - Remove examples/uart/espectre-esp32.yaml (not testable in QEMU) - Update documentation with ESP32 exclusion note
1 parent 55ac45e commit 9c4fea8

File tree

6 files changed

+42
-93
lines changed

6 files changed

+42
-93
lines changed

.github/actions/qemu-smoke-test/action.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,39 @@ runs:
7878
echo ""
7979
echo "SMOKE TEST FAILED - CRASH DETECTED!"
8080
grep -iE "panic|abort|Guru Meditation|assert failed|stack smashing" qemu_output.log
81+
82+
# Decode stack trace if backtrace is present
83+
BACKTRACE=$(grep -oE "Backtrace: [0-9a-fx: ]+" qemu_output.log | head -1 | sed 's/Backtrace: //')
84+
if [ -n "$BACKTRACE" ]; then
85+
echo ""
86+
echo "=== Stack Trace Analysis ==="
87+
FIRMWARE_ELF=$(find examples -name "firmware.elf" -type f | head -1)
88+
if [ -n "$FIRMWARE_ELF" ]; then
89+
# Extract addresses and decode with addr2line
90+
ADDRS=$(echo "$BACKTRACE" | grep -oE "0x[0-9a-f]+" | tr '\n' ' ')
91+
92+
# Select addr2line based on architecture
93+
if [ "${{ inputs.arch }}" = "xtensa" ]; then
94+
ADDR2LINE=$(find ~/.platformio/tools -name "xtensa-*-elf-addr2line" 2>/dev/null | head -1)
95+
else
96+
ADDR2LINE=$(find ~/.platformio/tools -name "riscv32-*-elf-addr2line" 2>/dev/null | head -1)
97+
fi
98+
99+
if [ -n "$ADDR2LINE" ]; then
100+
echo "Using: $ADDR2LINE"
101+
echo "ELF: $FIRMWARE_ELF"
102+
echo ""
103+
$ADDR2LINE -pfiaC -e "$FIRMWARE_ELF" $ADDRS
104+
else
105+
echo "addr2line not found, showing raw addresses:"
106+
echo "$BACKTRACE"
107+
fi
108+
else
109+
echo "ELF file not found, showing raw backtrace:"
110+
echo "$BACKTRACE"
111+
fi
112+
fi
113+
81114
exit 1
82115
fi
83116

.github/workflows/ci.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,8 @@ jobs:
150150
config: examples/espectre-c5.yaml
151151
- chip: ESP32-C6
152152
config: examples/espectre-c6.yaml
153-
# QEMU boot tests (examples/uart/)
154-
- chip: ESP32
155-
config: examples/uart/espectre-esp32.yaml
156-
qemu_chip: esp32
157-
qemu_arch: xtensa
158-
qemu_machine: esp32
153+
# QEMU smoke tests (examples/uart/)
154+
# Note: ESP32 original excluded - QEMU doesn't emulate PHY registers correctly
159155
- chip: ESP32-S3
160156
config: examples/uart/espectre-s3.yaml
161157
qemu_chip: esp32s3

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ Useful for recalibrating after room layout changes (furniture, sensor position)
2424

2525
Added automated smoke tests using QEMU emulation to catch firmware crashes early.
2626

27-
- **Supported chips**: ESP32, ESP32-S3, ESP32-C3, ESP32-C6
27+
- **Supported chips**: ESP32-S3, ESP32-C3, ESP32-C6
2828
- **Detection**: Kernel panics, Guru Meditation errors, assertion failures, stack smashing
29-
- **Architecture coverage**: Both Xtensa (ESP32, S3) and RISC-V (C3, C6)
29+
- **Stack trace analysis**: Automatic `addr2line` decoding on crash for easier debugging
30+
- **Architecture coverage**: Both Xtensa (S3) and RISC-V (C3, C6)
3031

3132
New UART configurations in `examples/uart/` for boards with USB-UART bridges (CH340, CP2102, CH343) and QEMU smoke tests.
3233

34+
> Note: ESP32 original is excluded from QEMU testing as the emulator doesn't correctly emulate PHY/radio registers, causing false positive crashes.
35+
3336
---
3437

3538
## [2.3.0] - 2025-12-31

examples/.gitignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/uart/espectre-esp32.yaml

Lines changed: 0 additions & 79 deletions
This file was deleted.

test/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,12 @@ act -j build --matrix chip:"QEMU ESP32-C3" -P ubuntu-latest=catthehacker/ubuntu:
111111

112112
| Chip | Architecture | QEMU Machine |
113113
|------|--------------|--------------|
114-
| ESP32 | Xtensa | esp32 |
115114
| ESP32-S3 | Xtensa | esp32s3 |
116115
| ESP32-C3 | RISC-V | esp32c3 |
117116
| ESP32-C6 | RISC-V | esp32c6 |
118117

118+
> Note: ESP32 original is excluded - QEMU doesn't emulate PHY registers correctly, causing false crashes.
119+
119120
> **Note**: Smoke tests appear as "Smoke Test ESP32-C3" etc. in CI.
120121
121122
---

0 commit comments

Comments
 (0)