You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2021/10/25 19:35:05 UTC

[incubator-nuttx] branch master updated (793266d -> eb889b0)

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

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


    from 793266d  espressif: Fix spacing style in Kconfig files
     new b555b3f  xtensa/esp32: Refactor and reorganize Partition Table related configs
     new 9d7b982  xtensa/esp32: Enable Partition Table allocation at custom offset
     new 211f899  risc-v/esp32c3: Refactor and reorganize Partition Table related configs
     new eb7ffd0  risc-v/esp32c3: Enable Partition Table allocation at custom offset
     new eb889b0  xtensa/esp32s2: Enable Partition Table allocation at custom offset

The 5 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:
 arch/risc-v/src/esp32c3/Bootloader.mk              |  1 +
 arch/risc-v/src/esp32c3/Kconfig                    | 44 ++++++++++-----------
 arch/risc-v/src/esp32c3/Make.defs                  |  2 +-
 arch/risc-v/src/esp32c3/esp32c3_partition.c        |  9 ++---
 arch/xtensa/src/esp32/Bootloader.mk                |  1 +
 arch/xtensa/src/esp32/Kconfig                      | 45 ++++++++++------------
 arch/xtensa/src/esp32/Make.defs                    |  2 +-
 arch/xtensa/src/esp32/esp32_partition.c            |  9 ++---
 arch/xtensa/src/esp32s2/Bootloader.mk              |  1 +
 arch/xtensa/src/esp32s2/Kconfig                    | 27 ++-----------
 .../esp32c3/esp32c3-devkit/src/esp32c3_bringup.c   |  2 +-
 .../xtensa/esp32/esp32-devkitc/src/esp32_bringup.c |  2 +-
 .../esp32/esp32-ethernet-kit/src/esp32_bringup.c   |  2 +-
 .../esp32/esp32-wrover-kit/src/esp32_bringup.c     |  2 +-
 .../esp32/ttgo_lora_esp32/src/esp32_bringup.c      |  2 +-
 tools/esp32/Config.mk                              |  2 +-
 tools/esp32c3/Config.mk                            |  2 +-
 tools/esp32s2/Config.mk                            |  2 +-
 18 files changed, 67 insertions(+), 90 deletions(-)

[incubator-nuttx] 05/05: xtensa/esp32s2: Enable Partition Table allocation at custom offset

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

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

commit eb889b0884bb9c8ccdc37dcde6493492439c0153
Author: Gustavo Henrique Nihei <gu...@espressif.com>
AuthorDate: Mon Oct 25 09:52:07 2021 -0300

    xtensa/esp32s2: Enable Partition Table allocation at custom offset
    
    Signed-off-by: Gustavo Henrique Nihei <gu...@espressif.com>
---
 arch/xtensa/src/esp32s2/Bootloader.mk |  1 +
 arch/xtensa/src/esp32s2/Kconfig       | 27 ++++-----------------------
 tools/esp32s2/Config.mk               |  2 +-
 3 files changed, 6 insertions(+), 24 deletions(-)

diff --git a/arch/xtensa/src/esp32s2/Bootloader.mk b/arch/xtensa/src/esp32s2/Bootloader.mk
index f6c666d..6009802 100644
--- a/arch/xtensa/src/esp32s2/Bootloader.mk
+++ b/arch/xtensa/src/esp32s2/Bootloader.mk
@@ -62,6 +62,7 @@ else ifeq ($(CONFIG_ESP32S2_APP_FORMAT_LEGACY),y)
 	$(Q) {                                                                                                \
 		echo "CONFIG_PARTITION_TABLE_CUSTOM=y";                                                           \
 		echo "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions.csv\"";                                 \
+		echo "CONFIG_PARTITION_TABLE_OFFSET=$(CONFIG_ESP32S2_PARTITION_TABLE_OFFSET)";                    \
 	} >> $(BOOTLOADER_CONFIG)
 endif
 
diff --git a/arch/xtensa/src/esp32s2/Kconfig b/arch/xtensa/src/esp32s2/Kconfig
index 0343984..1f4ba73 100644
--- a/arch/xtensa/src/esp32s2/Kconfig
+++ b/arch/xtensa/src/esp32s2/Kconfig
@@ -987,31 +987,12 @@ config ESP32S2_APP_MCUBOOT_HEADER_SIZE
 	default 32
 	depends on ESP32S2_APP_FORMAT_MCUBOOT
 
-endmenu # Application Image Configuration
-
-if ESP32S2_APP_FORMAT_LEGACY
-
-config ESP32S2_PARTITION
-	bool "ESP32-S2 Partition"
-	default n
-	select ESP32S2_SPIFLASH
-	---help---
-		Decode partition file and initialize partition as MTD.
-
-menu "Partition Configuration"
-	depends on ESP32S2_PARTITION
-
-config ESP32S2_PARTITION_OFFSET
-	hex "Partition offset"
+config ESP32S2_PARTITION_TABLE_OFFSET
+	hex "Partition Table offset"
 	default "0x8000"
+	depends on ESP32S2_APP_FORMAT_LEGACY
 
-config ESP32S2_PARTITION_MOUNT
-	string "Partition mount point"
-	default "/dev/esp/partition/"
-
-endmenu # Partition Configuration
-
-endif
+endmenu # Application Image Configuration
 
 menu "AES accelerate"
 	depends on ESP32S2_AES_ACCELERATOR
diff --git a/tools/esp32s2/Config.mk b/tools/esp32s2/Config.mk
index 26a7b76..62b9496 100644
--- a/tools/esp32s2/Config.mk
+++ b/tools/esp32s2/Config.mk
@@ -65,7 +65,7 @@ ESPTOOL_FLASH_OPTS := -fs $(FLASH_SIZE) -fm $(FLASH_MODE) -ff $(FLASH_FREQ)
 ifdef ESPTOOL_BINDIR
 	ifeq ($(CONFIG_ESP32S2_APP_FORMAT_LEGACY),y)
 		BL_OFFSET       := 0x1000
-		PT_OFFSET       := 0x8000
+		PT_OFFSET       := $(CONFIG_ESP32S2_PARTITION_TABLE_OFFSET)
 		BOOTLOADER      := $(ESPTOOL_BINDIR)/bootloader-esp32s2.bin
 		PARTITION_TABLE := $(ESPTOOL_BINDIR)/partition-table-esp32s2.bin
 		FLASH_BL        := $(BL_OFFSET) $(BOOTLOADER)

[incubator-nuttx] 03/05: risc-v/esp32c3: Refactor and reorganize Partition Table related configs

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

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

commit 211f899b6288439bb3ba2acf8eccc104cef3dead
Author: Gustavo Henrique Nihei <gu...@espressif.com>
AuthorDate: Mon Oct 25 09:41:18 2021 -0300

    risc-v/esp32c3: Refactor and reorganize Partition Table related configs
    
    Signed-off-by: Gustavo Henrique Nihei <gu...@espressif.com>
---
 arch/risc-v/src/esp32c3/Kconfig                    | 44 +++++++++++-----------
 arch/risc-v/src/esp32c3/Make.defs                  |  2 +-
 arch/risc-v/src/esp32c3/esp32c3_partition.c        |  9 ++---
 .../esp32c3/esp32c3-devkit/src/esp32c3_bringup.c   |  2 +-
 4 files changed, 27 insertions(+), 30 deletions(-)

diff --git a/arch/risc-v/src/esp32c3/Kconfig b/arch/risc-v/src/esp32c3/Kconfig
index 9305658..e59e9aa 100644
--- a/arch/risc-v/src/esp32c3/Kconfig
+++ b/arch/risc-v/src/esp32c3/Kconfig
@@ -895,6 +895,23 @@ config ESP32C3_SPIFLASH_DEBUG
 		If this option is enabled, SPI Flash driver read and write functions
 		will output input parameters and return values (if applicable).
 
+if ESP32C3_APP_FORMAT_LEGACY
+
+comment "Partition Table configuration"
+
+config ESP32C3_PARTITION_TABLE
+	bool "Create MTD partitions from Partition Table"
+	default n
+	---help---
+		Decode partition table and initialize partitions as MTD.
+
+config ESP32C3_PARTITION_MOUNTPT
+	string "Partition mount point"
+	default "/dev/esp/partition/"
+	depends on ESP32C3_PARTITION_TABLE
+
+endif
+
 endmenu # SPI Flash configuration
 
 menu "GDMA Configuration"
@@ -1019,30 +1036,11 @@ config ESP32C3_APP_MCUBOOT_HEADER_SIZE
 	default 32
 	depends on ESP32C3_APP_FORMAT_MCUBOOT
 
-endmenu # Application Image Configuration
-
-if ESP32C3_APP_FORMAT_LEGACY
-
-config ESP32C3_PARTITION
-	bool "ESP32-C3 Partition"
-	default n
-	select ESP32C3_SPIFLASH
-	---help---
-		Decode partition file and initialize partition as MTD.
-
-menu "Partition Configuration"
-	depends on ESP32C3_PARTITION
-
-config ESP32C3_PARTITION_OFFSET
-	hex "Partition offset"
+config ESP32C3_PARTITION_TABLE_OFFSET
+	hex "Partition Table offset"
 	default "0x8000"
+	depends on ESP32C3_APP_FORMAT_LEGACY
 
-config ESP32C3_PARTITION_MOUNT
-	string "Partition mount point"
-	default "/dev/esp/partition/"
-
-endmenu # Partition Configuration
-
-endif
+endmenu # Application Image Configuration
 
 endif # ARCH_CHIP_ESP32C3
diff --git a/arch/risc-v/src/esp32c3/Make.defs b/arch/risc-v/src/esp32c3/Make.defs
index 5ac4124..5c9039b 100644
--- a/arch/risc-v/src/esp32c3/Make.defs
+++ b/arch/risc-v/src/esp32c3/Make.defs
@@ -83,7 +83,7 @@ ifeq ($(CONFIG_ESP32C3_SPIFLASH),y)
 CHIP_CSRCS += esp32c3_spiflash.c
 endif
 
-ifeq ($(CONFIG_ESP32C3_PARTITION),y)
+ifeq ($(CONFIG_ESP32C3_PARTITION_TABLE),y)
 CHIP_CSRCS += esp32c3_partition.c
 endif
 
diff --git a/arch/risc-v/src/esp32c3/esp32c3_partition.c b/arch/risc-v/src/esp32c3/esp32c3_partition.c
index 7fa1083..7850f67 100644
--- a/arch/risc-v/src/esp32c3/esp32c3_partition.c
+++ b/arch/risc-v/src/esp32c3/esp32c3_partition.c
@@ -59,11 +59,11 @@
 
 /* Partition offset in SPI Flash */
 
-#define ESP32C3_PARTITION_OFFSET CONFIG_ESP32C3_PARTITION_OFFSET
+#define PARTITION_TABLE_OFFSET CONFIG_ESP32C3_PARTITION_TABLE_OFFSET
 
 /* Partition MTD device mount point */
 
-#define ESP32C3_PARTITION_MOUNT CONFIG_ESP32C3_PARTITION_MOUNT
+#define PARTITION_MOUNT_POINT CONFIG_ESP32C3_PARTITION_MOUNTPT
 
 /****************************************************************************
  * Private Types
@@ -567,7 +567,7 @@ int esp32c3_partition_init(void)
   struct mtd_dev_priv_s *mtd_priv;
   int ret = 0;
   const int num = PARTITION_MAX_SIZE / sizeof(struct partition_info_priv_s);
-  const char path_base[] = ESP32C3_PARTITION_MOUNT;
+  const char path_base[] = PARTITION_MOUNT_POINT;
   char label[PARTITION_LABEL_LEN + 1];
   char path[PARTITION_LABEL_LEN + sizeof(path_base)];
 
@@ -595,8 +595,7 @@ int esp32c3_partition_init(void)
       goto errout_with_mtd;
     }
 
-  ret = MTD_READ(mtd, ESP32C3_PARTITION_OFFSET,
-                 PARTITION_MAX_SIZE, pbuf);
+  ret = MTD_READ(mtd, PARTITION_TABLE_OFFSET, PARTITION_MAX_SIZE, pbuf);
   if (ret != PARTITION_MAX_SIZE)
     {
       ferr("ERROR: Failed to get read data from MTD\n");
diff --git a/boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_bringup.c b/boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_bringup.c
index fc0de5a..3ca88c2 100644
--- a/boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_bringup.c
+++ b/boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_bringup.c
@@ -155,7 +155,7 @@ int esp32c3_bringup(void)
     }
 #endif
 
-#ifdef CONFIG_ESP32C3_PARTITION
+#ifdef CONFIG_ESP32C3_PARTITION_TABLE
   ret = esp32c3_partition_init();
   if (ret < 0)
     {

[incubator-nuttx] 02/05: xtensa/esp32: Enable Partition Table allocation at custom offset

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

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

commit 9d7b9821b3f98bb5082c23842811b375d296eae9
Author: Gustavo Henrique Nihei <gu...@espressif.com>
AuthorDate: Mon Oct 25 09:51:45 2021 -0300

    xtensa/esp32: Enable Partition Table allocation at custom offset
    
    Signed-off-by: Gustavo Henrique Nihei <gu...@espressif.com>
---
 arch/xtensa/src/esp32/Bootloader.mk | 1 +
 tools/esp32/Config.mk               | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/xtensa/src/esp32/Bootloader.mk b/arch/xtensa/src/esp32/Bootloader.mk
index c264f89..4d06770 100644
--- a/arch/xtensa/src/esp32/Bootloader.mk
+++ b/arch/xtensa/src/esp32/Bootloader.mk
@@ -62,6 +62,7 @@ else ifeq ($(CONFIG_ESP32_APP_FORMAT_LEGACY),y)
 	$(Q) {                                                                                              \
 		echo "CONFIG_PARTITION_TABLE_CUSTOM=y";                                                         \
 		echo "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions.csv\"";                               \
+		echo "CONFIG_PARTITION_TABLE_OFFSET=$(CONFIG_ESP32_PARTITION_TABLE_OFFSET)";                    \
 	} >> $(BOOTLOADER_CONFIG)
 endif
 
diff --git a/tools/esp32/Config.mk b/tools/esp32/Config.mk
index fe242b4..5f0c867 100644
--- a/tools/esp32/Config.mk
+++ b/tools/esp32/Config.mk
@@ -65,7 +65,7 @@ ESPTOOL_FLASH_OPTS := -fs $(FLASH_SIZE) -fm $(FLASH_MODE) -ff $(FLASH_FREQ)
 ifdef ESPTOOL_BINDIR
 	ifeq ($(CONFIG_ESP32_APP_FORMAT_LEGACY),y)
 		BL_OFFSET       := 0x1000
-		PT_OFFSET       := 0x8000
+		PT_OFFSET       := $(CONFIG_ESP32_PARTITION_TABLE_OFFSET)
 		BOOTLOADER      := $(ESPTOOL_BINDIR)/bootloader-esp32.bin
 		PARTITION_TABLE := $(ESPTOOL_BINDIR)/partition-table-esp32.bin
 		FLASH_BL        := $(BL_OFFSET) $(BOOTLOADER)

[incubator-nuttx] 01/05: xtensa/esp32: Refactor and reorganize Partition Table related configs

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

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

commit b555b3f89ea575be8aac8a350ffcdda65855c9d3
Author: Gustavo Henrique Nihei <gu...@espressif.com>
AuthorDate: Fri Oct 8 13:42:23 2021 -0300

    xtensa/esp32: Refactor and reorganize Partition Table related configs
    
    Signed-off-by: Gustavo Henrique Nihei <gu...@espressif.com>
---
 arch/xtensa/src/esp32/Kconfig                      | 45 ++++++++++------------
 arch/xtensa/src/esp32/Make.defs                    |  2 +-
 arch/xtensa/src/esp32/esp32_partition.c            |  9 ++---
 .../xtensa/esp32/esp32-devkitc/src/esp32_bringup.c |  2 +-
 .../esp32/esp32-ethernet-kit/src/esp32_bringup.c   |  2 +-
 .../esp32/esp32-wrover-kit/src/esp32_bringup.c     |  2 +-
 .../esp32/ttgo_lora_esp32/src/esp32_bringup.c      |  2 +-
 7 files changed, 30 insertions(+), 34 deletions(-)

diff --git a/arch/xtensa/src/esp32/Kconfig b/arch/xtensa/src/esp32/Kconfig
index f2a3e4b..766e105 100644
--- a/arch/xtensa/src/esp32/Kconfig
+++ b/arch/xtensa/src/esp32/Kconfig
@@ -907,6 +907,23 @@ config ESP32_SPIFLASH_DEBUG
 		Enable this option, read and write of SPI Flash
 		will show input arguments and result.
 
+if ESP32_APP_FORMAT_LEGACY
+
+comment "Partition Table configuration"
+
+config ESP32_PARTITION_TABLE
+	bool "Create MTD partitions from Partition Table"
+	default n
+	---help---
+		Decode partition table and initialize partitions as MTD.
+
+config ESP32_PARTITION_MOUNTPT
+	string "Partition mount point"
+	default "/dev/esp/partition/"
+	depends on ESP32_PARTITION_TABLE
+
+endif
+
 endmenu # ESP32_SPIFLASH
 
 menu "SPI RAM Config"
@@ -1337,32 +1354,12 @@ config ESP32_APP_MCUBOOT_HEADER_SIZE
 	default 32
 	depends on ESP32_APP_FORMAT_MCUBOOT
 
-endmenu # Application Image Configuration
-
-if ESP32_APP_FORMAT_LEGACY
-
-config ESP32_PARTITION
-	bool "ESP32 Partition"
-	default n
-	select ESP32_SPIFLASH
-	---help---
-		Decode esp-idf's partition file and initialize
-		partition by nuttx MTD.
-
-menu "Partition Configuration"
-	depends on ESP32_PARTITION
-
-config ESP32_PARTITION_OFFSET
-	hex "Partition offset"
+config ESP32_PARTITION_TABLE_OFFSET
+	hex "Partition Table offset"
 	default "0x8000"
+	depends on ESP32_APP_FORMAT_LEGACY
 
-config ESP32_PARTITION_MOUNT
-	string "Partition mount point"
-	default "/dev/esp/partition/"
-
-endmenu # Partition Configuration
-
-endif
+endmenu # Application Image Configuration
 
 config ESP32_AUTO_SLEEP
 	bool "Auto-sleep"
diff --git a/arch/xtensa/src/esp32/Make.defs b/arch/xtensa/src/esp32/Make.defs
index da00928..e8f901b 100644
--- a/arch/xtensa/src/esp32/Make.defs
+++ b/arch/xtensa/src/esp32/Make.defs
@@ -167,7 +167,7 @@ ifeq ($(CONFIG_ESP32_FREERUN),y)
 CHIP_CSRCS += esp32_freerun.c
 endif
 
-ifeq ($(CONFIG_ESP32_PARTITION),y)
+ifeq ($(CONFIG_ESP32_PARTITION_TABLE),y)
 CHIP_CSRCS += esp32_partition.c
 endif
 
diff --git a/arch/xtensa/src/esp32/esp32_partition.c b/arch/xtensa/src/esp32/esp32_partition.c
index fa6b1dd..ab47646 100644
--- a/arch/xtensa/src/esp32/esp32_partition.c
+++ b/arch/xtensa/src/esp32/esp32_partition.c
@@ -59,11 +59,11 @@
 
 /* Partition offset in SPI Flash */
 
-#define ESP32_PARTITION_OFFSET CONFIG_ESP32_PARTITION_OFFSET
+#define PARTITION_TABLE_OFFSET CONFIG_ESP32_PARTITION_TABLE_OFFSET
 
 /* Partition MTD device mount point */
 
-#define ESP32_PARTITION_MOUNT CONFIG_ESP32_PARTITION_MOUNT
+#define PARTITION_MOUNT_POINT CONFIG_ESP32_PARTITION_MOUNTPT
 
 /****************************************************************************
  * Private Types
@@ -566,7 +566,7 @@ int esp32_partition_init(void)
   struct mtd_dev_priv *mtd_priv;
   int ret = 0;
   const int num = PARTITION_MAX_SIZE / sizeof(struct partition_info_priv);
-  const char path_base[] = ESP32_PARTITION_MOUNT;
+  const char path_base[] = PARTITION_MOUNT_POINT;
   char label[PARTITION_LABEL_LEN + 1];
   char path[PARTITION_LABEL_LEN + sizeof(path_base)];
 
@@ -594,8 +594,7 @@ int esp32_partition_init(void)
       goto errout_with_mtd;
     }
 
-  ret = MTD_READ(mtd, ESP32_PARTITION_OFFSET,
-                 PARTITION_MAX_SIZE, pbuf);
+  ret = MTD_READ(mtd, PARTITION_TABLE_OFFSET, PARTITION_MAX_SIZE, pbuf);
   if (ret != PARTITION_MAX_SIZE)
     {
       ferr("ERROR: Failed to get read data from MTD\n");
diff --git a/boards/xtensa/esp32/esp32-devkitc/src/esp32_bringup.c b/boards/xtensa/esp32/esp32-devkitc/src/esp32_bringup.c
index 79dfe73..703c262 100644
--- a/boards/xtensa/esp32/esp32-devkitc/src/esp32_bringup.c
+++ b/boards/xtensa/esp32/esp32-devkitc/src/esp32_bringup.c
@@ -206,7 +206,7 @@ int esp32_bringup(void)
     }
 #endif
 
-#ifdef CONFIG_ESP32_PARTITION
+#ifdef CONFIG_ESP32_PARTITION_TABLE
   ret = esp32_partition_init();
   if (ret < 0)
     {
diff --git a/boards/xtensa/esp32/esp32-ethernet-kit/src/esp32_bringup.c b/boards/xtensa/esp32/esp32-ethernet-kit/src/esp32_bringup.c
index 2d911bd..11f94e1 100644
--- a/boards/xtensa/esp32/esp32-ethernet-kit/src/esp32_bringup.c
+++ b/boards/xtensa/esp32/esp32-ethernet-kit/src/esp32_bringup.c
@@ -151,7 +151,7 @@ int esp32_bringup(void)
     }
 #endif
 
-#ifdef CONFIG_ESP32_PARTITION
+#ifdef CONFIG_ESP32_PARTITION_TABLE
   ret = esp32_partition_init();
   if (ret < 0)
     {
diff --git a/boards/xtensa/esp32/esp32-wrover-kit/src/esp32_bringup.c b/boards/xtensa/esp32/esp32-wrover-kit/src/esp32_bringup.c
index 264df38..068401e 100644
--- a/boards/xtensa/esp32/esp32-wrover-kit/src/esp32_bringup.c
+++ b/boards/xtensa/esp32/esp32-wrover-kit/src/esp32_bringup.c
@@ -185,7 +185,7 @@ int esp32_bringup(void)
     }
 #endif
 
-#ifdef CONFIG_ESP32_PARTITION
+#ifdef CONFIG_ESP32_PARTITION_TABLE
   ret = esp32_partition_init();
   if (ret < 0)
     {
diff --git a/boards/xtensa/esp32/ttgo_lora_esp32/src/esp32_bringup.c b/boards/xtensa/esp32/ttgo_lora_esp32/src/esp32_bringup.c
index 10e1432..feb947d 100644
--- a/boards/xtensa/esp32/ttgo_lora_esp32/src/esp32_bringup.c
+++ b/boards/xtensa/esp32/ttgo_lora_esp32/src/esp32_bringup.c
@@ -176,7 +176,7 @@ int esp32_bringup(void)
     }
 #endif
 
-#ifdef CONFIG_ESP32_PARTITION
+#ifdef CONFIG_ESP32_PARTITION_TABLE
   ret = esp32_partition_init();
   if (ret < 0)
     {

[incubator-nuttx] 04/05: risc-v/esp32c3: Enable Partition Table allocation at custom offset

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

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

commit eb7ffd014e9f86d5c1accb113eb7ee7b4a4a996e
Author: Gustavo Henrique Nihei <gu...@espressif.com>
AuthorDate: Mon Oct 25 09:42:26 2021 -0300

    risc-v/esp32c3: Enable Partition Table allocation at custom offset
    
    Signed-off-by: Gustavo Henrique Nihei <gu...@espressif.com>
---
 arch/risc-v/src/esp32c3/Bootloader.mk | 1 +
 tools/esp32c3/Config.mk               | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/risc-v/src/esp32c3/Bootloader.mk b/arch/risc-v/src/esp32c3/Bootloader.mk
index 8430a75..580221e 100644
--- a/arch/risc-v/src/esp32c3/Bootloader.mk
+++ b/arch/risc-v/src/esp32c3/Bootloader.mk
@@ -62,6 +62,7 @@ else ifeq ($(CONFIG_ESP32C3_APP_FORMAT_LEGACY),y)
 	$(Q) {                                                                                                \
 		echo "CONFIG_PARTITION_TABLE_CUSTOM=y";                                                           \
 		echo "CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions.csv\"";                                 \
+		echo "CONFIG_PARTITION_TABLE_OFFSET=$(CONFIG_ESP32C3_PARTITION_TABLE_OFFSET)";                    \
 	} >> $(BOOTLOADER_CONFIG)
 endif
 
diff --git a/tools/esp32c3/Config.mk b/tools/esp32c3/Config.mk
index af3f0ae..685cc2e 100644
--- a/tools/esp32c3/Config.mk
+++ b/tools/esp32c3/Config.mk
@@ -65,7 +65,7 @@ ESPTOOL_FLASH_OPTS := -fs $(FLASH_SIZE) -fm $(FLASH_MODE) -ff $(FLASH_FREQ)
 ifdef ESPTOOL_BINDIR
 	ifeq ($(CONFIG_ESP32C3_APP_FORMAT_LEGACY),y)
 		BL_OFFSET       := 0x0
-		PT_OFFSET       := 0x8000
+		PT_OFFSET       := $(CONFIG_ESP32C3_PARTITION_TABLE_OFFSET)
 		BOOTLOADER      := $(ESPTOOL_BINDIR)/bootloader-esp32c3.bin
 		PARTITION_TABLE := $(ESPTOOL_BINDIR)/partition-table-esp32c3.bin
 		FLASH_BL        := $(BL_OFFSET) $(BOOTLOADER)