You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/02/21 17:59:28 UTC

[incubator-nuttx] branch master updated (8bb50b5 -> 2c338a3)

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from 8bb50b5  arch/stm32h7: add definitions for DAC
     new 86fd684  tools/esp32: Refine the QEMU image generation.
     new 10fca18  boards/*/esp32: Add instructions on how to use the configs with QEMU.
     new 2c338a3  tools/esp32xx/Config.mk: Update the binaries names to reflect the same name used with the esp-nuttx-bootloader repo.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 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 +++++
 tools/esp32/Config.mk                             |  6 +-
 tools/esp32/mk_qemu_img.sh                        | 81 +++++++++++++++++------
 tools/esp32c3/Config.mk                           |  4 +-
 7 files changed, 113 insertions(+), 27 deletions(-)


[incubator-nuttx] 02/03: boards/*/esp32: Add instructions on how to use the configs with QEMU.

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 10fca18b55261c2bee6a0aa6701213a4be159d98
Author: Abdelatif Guettouche <ab...@espressif.com>
AuthorDate: Sat Feb 20 21:24:35 2021 +0100

    boards/*/esp32: Add instructions on how to use the configs with QEMU.
    
    Signed-off-by: Abdelatif Guettouche <ab...@espressif.com>
---
 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 b847f7a..cc0c936 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 937aca9..484b248 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 f2a158e..ef4a1a3 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 58ee14c..3dfad99 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
+ 


[incubator-nuttx] 01/03: tools/esp32: Refine the QEMU image generation.

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 86fd6843c36e1c7d502949c2dd4f7dcb12fe8388
Author: Abdelatif Guettouche <ab...@espressif.com>
AuthorDate: Sat Feb 20 17:38:58 2021 +0100

    tools/esp32: Refine the QEMU image generation.
    
    Use the usual while loop idiom when parsing arguments.
    Add more options to the script to be able to specify the name of the
    NuttX binary and final image.
    
    Signed-off-by: Abdelatif Guettouche <ab...@espressif.com>
---
 tools/esp32/Config.mk      |  2 +-
 tools/esp32/mk_qemu_img.sh | 81 +++++++++++++++++++++++++++++++++++-----------
 2 files changed, 63 insertions(+), 20 deletions(-)

diff --git a/tools/esp32/Config.mk b/tools/esp32/Config.mk
index ddd5ca3..0d7acf4 100644
--- a/tools/esp32/Config.mk
+++ b/tools/esp32/Config.mk
@@ -42,7 +42,7 @@ else ifeq ($(CONFIG_ESP32_FLASH_16M),y)
 endif
 
 ifeq ($(CONFIG_ESP32_QEMU_IMAGE),y)
-	MK_QEMU_IMG=$(TOPDIR)/tools/esp32/mk_qemu_img.sh $(BOOTLOADER) $(PARTITION_TABLE)
+	MK_QEMU_IMG=$(TOPDIR)/tools/esp32/mk_qemu_img.sh -b $(BOOTLOADER) -p $(PARTITION_TABLE)
 else
 	MK_QEMU_IMG=
 endif
diff --git a/tools/esp32/mk_qemu_img.sh b/tools/esp32/mk_qemu_img.sh
index f23a2ff..19373e9 100755
--- a/tools/esp32/mk_qemu_img.sh
+++ b/tools/esp32/mk_qemu_img.sh
@@ -20,35 +20,78 @@
 ############################################################################
 
 SCRIPT_NAME=$(basename "${0}")
-USAGE="USAGE: ${SCRIPT_NAME} <bootloader_img> <partition_table_img>"
+
+BOOTLOADER_IMG=""
+PARTITION_IMG=""
+NUTTX_IMG="nuttx.bin"
+FLASH_IMG="esp32_qemu_img.bin"
+
+usage() {
+  echo ""
+  echo "USAGE: ${SCRIPT_NAME} [-h] -b <bootloader> -p <partition_table> [-n <nuttx>] [-i <image_name>]"
+  echo ""
+  echo "Where:"
+  echo "  -b <bootloader> path to the bootloader image"
+  echo "  -p <partition_table> path to the partition table image"
+  echo "  -n <nuttx> path to the nuttx image (default nuttx.bin)"
+  echo "  -i <image_name> name of the resulting image (default esp32_qemu_img.bin)"
+  echo "  -h will show this help and terminate"
+}
+
+while [ ! -z "$1" ]; do
+  case "$1" in
+  -b )
+    shift
+    BOOTLOADER_IMG=$1
+    ;;
+  -p )
+    shift
+    PARTITION_IMG=$1
+    ;;
+  -n )
+    shift
+    NUTTX_IMG=$1
+    ;;
+  -i )
+    shift
+    FLASH_IMG=$1
+    ;;
+  -h )
+    usage
+    exit 0
+    ;;
+  *)
+    usage
+    exit 1
+    ;;
+  esac
+  shift
+done
 
 # Make sure we have the required argument(s)
 
-if [ -z "${1}" ] || [ -z "${2}" ] ; then
-  printf "%s requires the bootloader and partition table binary images.\n " "${SCRIPT_NAME}"
-  printf "%s\n " "${USAGE}"
+if [ -z "${BOOTLOADER_IMG}" ] || [ -z "${PARTITION_IMG}" ] ; then
+  echo "Missing bootloader and partition table binary images."
+  usage
   exit 1
 fi
 
-BOOTLOADER=${1}
-PARTITION_TABLE=${2}
-
-printf "Generating esp32_qemu_image.bin...\n"
-printf "\tBootloader: %s\n" "${BOOTLOADER}"
-printf "\tPartition Table: %s\n" "${PARTITION_TABLE}"
+printf "Generating %s...\n" "${FLASH_IMG}"
+printf "\tBootloader: %s\n" "${BOOTLOADER_IMG}"
+printf "\tPartition Table: %s\n" "${PARTITION_IMG}"
 
-dd if=/dev/zero bs=1024 count=4096 of=esp32_qemu_image.bin && \
-dd if="${BOOTLOADER}" bs=1 seek="$(printf '%d' 0x1000)" of=esp32_qemu_image.bin conv=notrunc && \
-dd if="${PARTITION_TABLE}" bs=1 seek="$(printf '%d' 0x8000)" of=esp32_qemu_image.bin conv=notrunc && \
-dd if=nuttx.bin bs=1 seek="$(printf '%d' 0x10000)" of=esp32_qemu_image.bin conv=notrunc
+dd if=/dev/zero bs=1024 count=4096 of=${FLASH_IMG} && \
+dd if="${BOOTLOADER_IMG}" bs=1 seek="$(printf '%d' 0x1000)" of=${FLASH_IMG} conv=notrunc && \
+dd if="${PARTITION_IMG}" bs=1 seek="$(printf '%d' 0x8000)" of=${FLASH_IMG} conv=notrunc && \
+dd if=$NUTTX_IMG bs=1 seek="$(printf '%d' 0x10000)" of=${FLASH_IMG} conv=notrunc
 
 if [ ${?} -ne 0 ]; then
-  printf "Failed to generate esp32_qemu_image.bin.\n"
+  printf "Failed to generate ${FLASH_IMG}.\n"
   exit 1
 fi
 
-printf "Generated esp32_qemu_image.bin successfully!\n"
-printf "You can use QEMU for executing it with the following command line:\n"
-printf "\tqemu-system-xtensa -nographic -machine esp32 -drive file=esp32_qemu_image.bin,if=mtd,format=raw\n"
+printf "Generated ${FLASH_IMG} successfully!\n"
+printf "You can run it with QEMU using:\n"
+printf "\tqemu-system-xtensa -nographic -machine esp32 -drive file=${FLASH_IMG},if=mtd,format=raw\n"
 
-echo "esp32_qemu_image.bin" >> nuttx.manifest
+echo "${FLASH_IMG}" >> nuttx.manifest


[incubator-nuttx] 03/03: tools/esp32xx/Config.mk: Update the binaries names to reflect the same name used with the esp-nuttx-bootloader repo.

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 2c338a3ad04cdb1ade231ba3ade5a92969ced893
Author: Abdelatif Guettouche <ab...@espressif.com>
AuthorDate: Sat Feb 20 21:28:10 2021 +0100

    tools/esp32xx/Config.mk: Update the binaries names to reflect the same
    name used with the esp-nuttx-bootloader repo.
    
    Signed-off-by: Abdelatif Guettouche <ab...@espressif.com>
---
 tools/esp32/Config.mk   | 4 ++--
 tools/esp32c3/Config.mk | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/esp32/Config.mk b/tools/esp32/Config.mk
index 0d7acf4..19d2460 100644
--- a/tools/esp32/Config.mk
+++ b/tools/esp32/Config.mk
@@ -25,8 +25,8 @@
 ifdef ESPTOOL_BINDIR
 	BL_OFFSET=0x1000
 	PT_OFFSET=0x8000
-	BOOTLOADER=$(ESPTOOL_BINDIR)/bootloader.bin
-	PARTITION_TABLE=$(ESPTOOL_BINDIR)/partition-table.bin
+	BOOTLOADER=$(ESPTOOL_BINDIR)/bootloader-esp32.bin
+	PARTITION_TABLE=$(ESPTOOL_BINDIR)/partition-table-esp32.bin
 	FLASH_BL=$(BL_OFFSET) $(BOOTLOADER)
 	FLASH_PT=$(PT_OFFSET) $(PARTITION_TABLE)
 endif
diff --git a/tools/esp32c3/Config.mk b/tools/esp32c3/Config.mk
index c8ebc37..41af319 100644
--- a/tools/esp32c3/Config.mk
+++ b/tools/esp32c3/Config.mk
@@ -25,8 +25,8 @@
 ifdef ESPTOOL_BINDIR
 	BL_OFFSET=0x0
 	PT_OFFSET=0x8000
-	BOOTLOADER=$(ESPTOOL_BINDIR)/bootloader.bin
-	PARTITION_TABLE=$(ESPTOOL_BINDIR)/partition-table.bin
+	BOOTLOADER=$(ESPTOOL_BINDIR)/bootloader-esp32c3.bin
+	PARTITION_TABLE=$(ESPTOOL_BINDIR)/partition-table-esp32c3.bin
 	FLASH_BL=$(BL_OFFSET) $(BOOTLOADER)
 	FLASH_PT=$(PT_OFFSET) $(PARTITION_TABLE)
 endif