Add esp-emu emulator targets for ESP32-C3 and ESP32-S3
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- go
- Área
- embedded-iot, tooling
Línea de trabajo
Start with the esp32-qemu target setup, EmulatorFormat() in compileopts/config.go, and the runtime exit handling in src/runtime/runtime_esp32xx_exit.go. Check how target inheritance and emulator commands are configured, then determine whether esp-emu can run the C3 and S3 .bin images. Done means both targets can launch the emulator and their documentation explains that exit codes are not propagated.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
esp-emu is Espressif's emulator for ESP32 series chips. It supports C3, C5, C6, H2, P4 and S3 (Xtensa, dual core). It does not support the classic ESP32. The S3 is the only chip it emulates with two cores, which makes it useful for testing -scheduler=cores without hardware. The prebuilt binary is available for macOS arm64 and Linux.
I tried it with TinyGo and found that two chips work, and that exit codes are the main gap.
What I tried
I built a small program with -serial=uart and ran it as esp-emu --chip <chip> --firmware main.bin --exit-on "<marker>". The .bin is the image TinyGo already writes for these targets.
| Chip | TinyGo target | Result |
|---|---|---|
| ESP32-C3 | esp32c3-generic |
Boots and prints, about 1 s per run |
| ESP32-S3 | esp32s3-generic |
Same, including -scheduler=cores |
| ESP32-C6 | xiao-esp32c6 |
Prints SHA-256 comparison failed, then garbage on the console |
| ESP32-H2 | esp32h2-devkitm-1 |
Same as C6 |
| ESP32 | n/a | Not supported by esp-emu |
I have not investigated why C6 and H2 fail. It may be the image hash or the UART setup.
Exit codes
esp-emu only stops on an --exit-on string match or on --timeout. Its documentation says an --exit-on match exits with code 0. I did not check the exit code on a timeout.
TinyGo's exit(code) on these chips (runtime_esp32xx_exit.go) calls abort() and drops the code. I didn't see any other exit mechanism in the esp-emu docs.
So tinygo run could work if the program prints a marker, but tinygo test could not tell a pass from a failure. esp32-qemu avoids this by using semihosting.
Proposed shape
- Add
esp32c3-emuandesp32s3-emutargets that inherit the-generictargets, likeesp32-qemu. Puttingemulatoron the base esp32 targets would change their gdb interface selection inmain.go. EmulatorFormat()incompileopts/config.goonly knows{img}. It needs a{bin}case that returns the target's.binformat.- Document that exit codes are not propagated, until esp-emu or the runtime can report them.
- Leave C6 and H2 for later.
Open questions
- Is a run-only target worth merging without exit codes?
- Should the runtime print an exit marker under an
esp_emubuild tag? esp-emu would still exit with code 0. - Should we ask Espressif for an exit-code mechanism in esp-emu, such as semihosting or a magic write?
- Lenguaje dominante
- Go
- Estrellas
- 17.8k
- Forks
- 1.1k
- Merge medio
- 1 d 4 h
- PR fusionados (30 d)
- 380
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de tinygo-org/tinygo
-
avr: SPI Mode2 runs as mode 1Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
tinygo-org/tinygo#6727 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
tinygo-org/tinygo#6711 ·
Los mantenedores suelen responder en 1 día
-
Builds are not reproducible: cgo snippet paths in debug infoPosiblemente ocupada @tridev-tej la tomó hace 2 días. Abiertoenhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
tinygo-org/tinygo#6619 ·
Los mantenedores suelen responder en 1 día
-
Fix the targets that tinygo build -target rejectsPosiblemente ocupada @narguis la tomó hace 2 días. Abiertobug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
tinygo-org/tinygo#6617 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
tinygo-org/tinygo#6312 ·
Los mantenedores suelen responder en 1 día
Todos los issues de tinygo-org/tinygo
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
sresarehumantoo/cc-artex#456 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ollama/ollama#20021 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
factory:subtask
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
release
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
github/gh-aw-mcpg#17603 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
bboerst/stratum-work#351 ·
Los mantenedores suelen responder en 1 día