Add esp-emu emulator targets for ESP32-C3 and ESP32-S3
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- go
- 領域
- embedded-iot, tooling
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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?
- 主要言語
- Go
- スター
- 17.8k
- フォーク
- 1.1k
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 380
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tinygo-org/tinygo のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tinygo-org/tinygo#6727 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
tinygo-org/tinygo#6711 ·
メンテナーはふだん 1 日以内に返信
-
Builds are not reproducible: cgo snippet paths in debug info対応中かも @tridev-tej が 1 日前に担当しました。 オープンenhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tinygo-org/tinygo#6619 ·
メンテナーはふだん 1 日以内に返信
-
Fix the targets that tinygo build -target rejects対応中かも @narguis が 2 日前に担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
tinygo-org/tinygo#6617 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
tinygo-org/tinygo#6312 ·
メンテナーはふだん 1 日以内に返信
tinygo-org/tinygo の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
sresarehumantoo/cc-artex#456 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ollama/ollama#20021 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
factory:subtask
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
release
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
github/gh-aw-mcpg#17603 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
bboerst/stratum-work#351 ·
メンテナーはふだん 1 日以内に返信