From 37626147f91f9964c11cff5c2b0ff9105d255c1c Mon Sep 17 00:00:00 2001 From: Hiroki Noda Date: Sat, 2 Mar 2024 02:15:54 +0900 Subject: [PATCH 1/3] Update Qemu page --- src/tooling/simulating/qemu.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/tooling/simulating/qemu.md b/src/tooling/simulating/qemu.md index 2fd7768..6a21d46 100644 --- a/src/tooling/simulating/qemu.md +++ b/src/tooling/simulating/qemu.md @@ -1,12 +1,12 @@ # QEMU Espressif maintains a fork of QEMU in [espressif/QEMU][espressif-qemu] with the necessary patches to make it work on Espressif chips. -See the [QEMU wiki][qemu-wiki] for instructions on how to build QEMU and emulate projects with it. +See the [ESP-specific instructions for running QEMU][esp-qemu-doc] for instructions on how to build QEMU and emulate projects with it. Once you have built QEMU, you should have the `qemu-system-xtensa` file. [espressif-qemu]: https://github.com/espressif/qemu -[qemu-wiki]: https://github.com/espressif/qemu/wiki +[esp-qemu-doc]: https://github.com/espressif/esp-toolchain-docs/tree/main/qemu/esp32#overview ## Running Your Project Using QEMU @@ -15,18 +15,20 @@ Once you have built QEMU, you should have the `qemu-system-xtensa` file. For running our project in QEMU, we need a firmware/image with bootloader and partition table merged in it. We can use [`cargo-espflash`][cargo-espflash] to generate it: -```shell +```console cargo espflash save-image --chip esp32 --merge --release ``` If you prefer to use [`espflash`][espflash], you can achieve the same result by building the project first and then generating image: -```shell + +```console cargo build --release -espflash save-image --merge ESP32 target/xtensa-esp32-espidf/release/ +espflash save-image --chip ESP32 --merge target/xtensa-esp32-espidf/release/ ``` Now, run the image in QEMU: -```shell + +```console /path/to/qemu-system-xtensa -nographic -machine esp32 -drive file=,if=mtd,format=raw ``` From f30350590ba7b5887f47d8e0ba539cbeb899536c Mon Sep 17 00:00:00 2001 From: Hiroki Noda Date: Mon, 4 Mar 2024 17:55:33 +0900 Subject: [PATCH 2/3] back to use bash --- src/tooling/simulating/qemu.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tooling/simulating/qemu.md b/src/tooling/simulating/qemu.md index 6a21d46..9a3d867 100644 --- a/src/tooling/simulating/qemu.md +++ b/src/tooling/simulating/qemu.md @@ -15,20 +15,20 @@ Once you have built QEMU, you should have the `qemu-system-xtensa` file. For running our project in QEMU, we need a firmware/image with bootloader and partition table merged in it. We can use [`cargo-espflash`][cargo-espflash] to generate it: -```console +```bash cargo espflash save-image --chip esp32 --merge --release ``` If you prefer to use [`espflash`][espflash], you can achieve the same result by building the project first and then generating image: -```console +```bash cargo build --release espflash save-image --chip ESP32 --merge target/xtensa-esp32-espidf/release/ ``` Now, run the image in QEMU: -```console +```bash /path/to/qemu-system-xtensa -nographic -machine esp32 -drive file=,if=mtd,format=raw ``` From 8b5bc7588e74e9f16f5995d5bc25e33d831a5cf3 Mon Sep 17 00:00:00 2001 From: Hiroki Noda Date: Mon, 4 Mar 2024 18:04:09 +0900 Subject: [PATCH 3/3] Back to use shell Co-authored-by: Sergio Gasquez Arcos --- src/tooling/simulating/qemu.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tooling/simulating/qemu.md b/src/tooling/simulating/qemu.md index 9a3d867..303a052 100644 --- a/src/tooling/simulating/qemu.md +++ b/src/tooling/simulating/qemu.md @@ -15,20 +15,20 @@ Once you have built QEMU, you should have the `qemu-system-xtensa` file. For running our project in QEMU, we need a firmware/image with bootloader and partition table merged in it. We can use [`cargo-espflash`][cargo-espflash] to generate it: -```bash +```shell cargo espflash save-image --chip esp32 --merge --release ``` If you prefer to use [`espflash`][espflash], you can achieve the same result by building the project first and then generating image: -```bash +```shell cargo build --release espflash save-image --chip ESP32 --merge target/xtensa-esp32-espidf/release/ ``` Now, run the image in QEMU: -```bash +```shell /path/to/qemu-system-xtensa -nographic -machine esp32 -drive file=,if=mtd,format=raw ```