From 10fca18b55261c2bee6a0aa6701213a4be159d98 Mon Sep 17 00:00:00 2001 From: Abdelatif Guettouche Date: Sat, 20 Feb 2021 21:24:35 +0100 Subject: [PATCH] boards/*/esp32: Add instructions on how to use the configs with QEMU. Signed-off-by: Abdelatif Guettouche --- boards/risc-v/esp32c3/esp32c3-devkit/README.txt | 6 +++--- boards/xtensa/esp32/esp32-devkitc/README.txt | 14 ++++++++++++++ boards/xtensa/esp32/esp32-ethernet-kit/README.txt | 14 ++++++++++++++ boards/xtensa/esp32/esp32-wrover-kit/README.txt | 15 +++++++++++++++ 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/boards/risc-v/esp32c3/esp32c3-devkit/README.txt b/boards/risc-v/esp32c3/esp32c3-devkit/README.txt index b847f7ad7d..cc0c936634 100644 --- a/boards/risc-v/esp32c3/esp32c3-devkit/README.txt +++ b/boards/risc-v/esp32c3/esp32c3-devkit/README.txt @@ -49,7 +49,7 @@ partition table, these are then presented as Github assets and can be downloaded from: https://github.com/espressif/esp-nuttx-bootloader/releases Download bootloader-esp32c3.bin and partition-table-esp32c3.bin and place them in a folder, the path to this folder will be used later to program them. This -can be: "../esp-bins/esp32c3/" +can be: "../esp-bins" Buttons and LEDs ================ @@ -111,8 +111,8 @@ included in the build process. The esptool.py command to flash all the binaries is `esptool.py --chip esp32c3 --port /dev/ttyUSBXX --baud 921600 write_flash 0x0 bootloader.bin 0x8000 partition-table.bin 0x10000 nuttx.bin` However, this is also included in the build process and we can use build and flash with: -`make download ESPTOOL_PORT=/dev/ttyUSBXX ESPTOOL_BINDIR=../esp-bins/esp32c3` -The "../esp-bins/esp32c3" path is the path to the folder containing the bootloader and the +`make download ESPTOOL_PORT=/dev/ttyUSBXX ESPTOOL_BINDIR=../esp-bins` +The "../esp-bins" path is the path to the folder containing the bootloader and the partition table for the ESP32-C3 as explained above. Note that this step is required only one time. Once the bootloader and partition table are flashed, we don't need to flash them again. So subsequent builds diff --git a/boards/xtensa/esp32/esp32-devkitc/README.txt b/boards/xtensa/esp32/esp32-devkitc/README.txt index 937aca9f3d..484b248f52 100644 --- a/boards/xtensa/esp32/esp32-devkitc/README.txt +++ b/boards/xtensa/esp32/esp32-devkitc/README.txt @@ -858,6 +858,20 @@ NOTES: Where x in the watchdog instance. +Using QEMU: +========== + +First follow the instructions at https://github.com/espressif/qemu/wiki to build QEMU. +Enable the ESP32_QEMU_IMAGE config found in "Board Selection -> ESP32 binary image for QEMU". +Download the bootloader and the partition table from https://github.com/espressif/esp-nuttx-bootloader/releases +and place them in a directory, say ../esp-bins. +Build and generate the QEMU image: `make ESPTOOL_BINDIR=../esp-bins` +A new image "esp32_qemu_image.bin" will be created. It can be run as: + + ~/PATH_TO_QEMU/qemu/build/xtensa-softmmu/qemu-system-xtensa -nographic \ + -machine esp32 \ + -drive file=esp32_qemu_image.bin,if=mtd,format=raw + Things to Do ============ diff --git a/boards/xtensa/esp32/esp32-ethernet-kit/README.txt b/boards/xtensa/esp32/esp32-ethernet-kit/README.txt index f2a158e238..ef4a1a3d13 100644 --- a/boards/xtensa/esp32/esp32-ethernet-kit/README.txt +++ b/boards/xtensa/esp32/esp32-ethernet-kit/README.txt @@ -67,3 +67,17 @@ Espressif has an offcial Ethernet development board: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-ethernet-kit.html +Using QEMU: +========== + +First follow the instructions at https://github.com/espressif/qemu/wiki to build QEMU. +Enable the ESP32_QEMU_IMAGE config found in "Board Selection -> ESP32 binary image for QEMU". +Download the bootloader and the partition table from https://github.com/espressif/esp-nuttx-bootloader/releases +and place them in a directory, say ../esp-bins. +Build and generate the QEMU image: `make ESPTOOL_BINDIR=../esp-bins` +A new image "esp32_qemu_image.bin" will be created. It can be run as: + + ~/PATH_TO_QEMU/qemu/build/xtensa-softmmu/qemu-system-xtensa -nographic \ + -machine esp32 \ + -drive file=esp32_qemu_image.bin,if=mtd,format=raw + diff --git a/boards/xtensa/esp32/esp32-wrover-kit/README.txt b/boards/xtensa/esp32/esp32-wrover-kit/README.txt index 58ee14c8f1..3dfad99b7d 100644 --- a/boards/xtensa/esp32/esp32-wrover-kit/README.txt +++ b/boards/xtensa/esp32/esp32-wrover-kit/README.txt @@ -77,3 +77,18 @@ Configurations nsh> gpio -w 14 /dev/gpint3 The pin is configured to as a rising edge interrupt, so after issuing the above command, connect it to 3.3V. + +Using QEMU: +========== + +First follow the instructions at https://github.com/espressif/qemu/wiki to build QEMU. +Enable the ESP32_QEMU_IMAGE config found in "Board Selection -> ESP32 binary image for QEMU". +Download the bootloader and the partition table from https://github.com/espressif/esp-nuttx-bootloader/releases +and place them in a directory, say ../esp-bins. +Build and generate the QEMU image: `make ESPTOOL_BINDIR=../esp-bins` +A new image "esp32_qemu_image.bin" will be created. It can be run as: + + ~/PATH_TO_QEMU/qemu/build/xtensa-softmmu/qemu-system-xtensa -nographic \ + -machine esp32 \ + -drive file=esp32_qemu_image.bin,if=mtd,format=raw +