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 2020/11/06 21:36:52 UTC

[incubator-nuttx] branch master updated (c7a9b66 -> f052a9b)

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 c7a9b66  arch/arm/src/imxrt: adds support for WDOG1
     new 2ac2ce5  arch/xtensa/src/esp32/esp32_allocateheap.c: Fix the memory regions with regards to the data used by the ROM. Static alloaction sections should end at the begining of the ROM data. The rest of memory (End of ROM data --> End of DRAM) is added to the heap.
     new f052a9b  baords/xtensa/esp32/esp32-core: Update all configs to add the new region of memory.

The 2 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/xtensa/src/esp32/esp32_allocateheap.c         | 28 ++++++++++++++++++++--
 .../esp32/esp32-core/configs/mmcsdspi/defconfig    |  1 +
 .../esp32/esp32-core/configs/netnsh/defconfig      |  1 +
 .../xtensa/esp32/esp32-core/configs/nsh/defconfig  |  1 +
 .../esp32/esp32-core/configs/ostest/defconfig      |  1 +
 .../xtensa/esp32/esp32-core/configs/pm/defconfig   |  1 +
 .../esp32/esp32-core/configs/random/defconfig      |  1 +
 .../xtensa/esp32/esp32-core/configs/smp/defconfig  |  1 +
 .../esp32/esp32-core/configs/spiflash/defconfig    |  1 +
 .../esp32/esp32-core/scripts/esp32.template.ld     |  7 +++++-
 10 files changed, 40 insertions(+), 3 deletions(-)


[incubator-nuttx] 01/02: arch/xtensa/src/esp32/esp32_allocateheap.c: Fix the memory regions with regards to the data used by the ROM. Static alloaction sections should end at the begining of the ROM data. The rest of memory (End of ROM data --> End of DRAM) is added to the heap.

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 2ac2ce55d22e9ed6289dc7ca9ad4829f6142a6e4
Author: Abdelatif Guettouche <ab...@espressif.com>
AuthorDate: Thu Nov 5 15:48:37 2020 +0000

    arch/xtensa/src/esp32/esp32_allocateheap.c: Fix the memory regions with
    regards to the data used by the ROM.
    Static alloaction sections should end at the begining of the ROM data.
    The rest of memory (End of ROM data --> End of DRAM) is added to the
    heap.
    
    Signed-off-by: Abdelatif Guettouche <ab...@espressif.com>
---
 arch/xtensa/src/esp32/esp32_allocateheap.c         | 28 ++++++++++++++++++++--
 .../esp32/esp32-core/scripts/esp32.template.ld     |  7 +++++-
 2 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/arch/xtensa/src/esp32/esp32_allocateheap.c b/arch/xtensa/src/esp32/esp32_allocateheap.c
index efb57ec..95effb3 100644
--- a/arch/xtensa/src/esp32/esp32_allocateheap.c
+++ b/arch/xtensa/src/esp32/esp32_allocateheap.c
@@ -53,6 +53,26 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
+/* Region 1 of the heap is the area from the end of the .data section to the
+ * begining of the ROM data.  The start address is defined from the linker
+ * script as "_sheap".  Then end is defined here, as follows:
+ */
+
+#define HEAP_REGION1_END 0x3ffe0000
+
+/* Region 2 of the heap is the area from the end of the ROM data to the end
+ * of DRAM.  The linker script has already set "_eheap" as the end of DRAM,
+ * the following defines the start of region2.
+ * N.B: That ROM data consists of 2 regions, one per CPU.  If SMP is not
+ * enabled include APP's region with the heap.
+ */
+
+#ifdef CONFIG_SMP
+#  define HEAP_REGION2_START 0x3ffe4350
+#else
+#  define HEAP_REGION2_START 0x3ffe0400
+#endif
+
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -77,10 +97,10 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
   board_autoled_on(LED_HEAPALLOCATE);
 #ifdef CONFIG_XTENSA_USE_SEPARATE_IMEM
   *heap_start = (FAR void *)&_sheap + CONFIG_XTENSA_IMEM_REGION_SIZE;
-  *heap_size = (size_t)((uintptr_t)&_eheap - (uintptr_t)*heap_start);
+  *heap_size = (size_t)(HEAP_REGION1_END - (uintptr_t)*heap_start);
 #else
   *heap_start = (FAR void *)&_sheap;
-  *heap_size = (size_t)((uintptr_t)&_eheap - (uintptr_t)&_sheap);
+  *heap_size = (size_t)(HEAP_REGION1_END - (uintptr_t)&_sheap);
 #endif
 }
 
@@ -96,6 +116,9 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
 #if CONFIG_MM_REGIONS > 1
 void xtensa_add_region(void)
 {
+  umm_addregion((FAR void *)HEAP_REGION2_START,
+                (size_t)(uintptr_t)&_eheap - HEAP_REGION2_START);
+
 #if defined(CONFIG_ESP32_SPIRAM)
   /* Check for any additional memory regions */
 
@@ -105,3 +128,4 @@ void xtensa_add_region(void)
 #endif
 }
 #endif
+
diff --git a/boards/xtensa/esp32/esp32-core/scripts/esp32.template.ld b/boards/xtensa/esp32/esp32-core/scripts/esp32.template.ld
index e63c703..454d1e8 100644
--- a/boards/xtensa/esp32/esp32-core/scripts/esp32.template.ld
+++ b/boards/xtensa/esp32/esp32-core/scripts/esp32.template.ld
@@ -43,10 +43,15 @@ MEMORY
   /* Shared data RAM, excluding memory reserved for ROM bss/data/stack.
    * Enabling Bluetooth & Trace Memory features in menuconfig will decrease
    * the amount of RAM available.
+   *
+   * Note: The length of this section should be 0x50000, and this extra
+   * DRAM is available in heap at runtime. However due to static ROM memory
+   * usage at this 176KB mark, the additional static memory temporarily cannot
+   * be used.
    */
 
   dram0_0_seg (RW) :     org = 0x3ffb0000 + CONFIG_ESP32_BT_RESERVE_DRAM,
-                         len = 0x50000 - CONFIG_ESP32_TRACEMEM_RESERVE_DRAM - CONFIG_ESP32_BT_RESERVE_DRAM
+                         len = 0x2c200 - CONFIG_ESP32_TRACEMEM_RESERVE_DRAM - CONFIG_ESP32_BT_RESERVE_DRAM
 
   /* Flash mapped constant data */
 


[incubator-nuttx] 02/02: baords/xtensa/esp32/esp32-core: Update all configs to add the new region of memory.

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 f052a9b1e6b64eada727a797ac1d5c6c98fc6669
Author: Abdelatif Guettouche <ab...@espressif.com>
AuthorDate: Fri Nov 6 19:43:03 2020 +0000

    baords/xtensa/esp32/esp32-core: Update all configs to add the new region
    of memory.
---
 boards/xtensa/esp32/esp32-core/configs/mmcsdspi/defconfig | 1 +
 boards/xtensa/esp32/esp32-core/configs/netnsh/defconfig   | 1 +
 boards/xtensa/esp32/esp32-core/configs/nsh/defconfig      | 1 +
 boards/xtensa/esp32/esp32-core/configs/ostest/defconfig   | 1 +
 boards/xtensa/esp32/esp32-core/configs/pm/defconfig       | 1 +
 boards/xtensa/esp32/esp32-core/configs/random/defconfig   | 1 +
 boards/xtensa/esp32/esp32-core/configs/smp/defconfig      | 1 +
 boards/xtensa/esp32/esp32-core/configs/spiflash/defconfig | 1 +
 8 files changed, 8 insertions(+)

diff --git a/boards/xtensa/esp32/esp32-core/configs/mmcsdspi/defconfig b/boards/xtensa/esp32/esp32-core/configs/mmcsdspi/defconfig
index e711c8d..d959840 100644
--- a/boards/xtensa/esp32/esp32-core/configs/mmcsdspi/defconfig
+++ b/boards/xtensa/esp32/esp32-core/configs/mmcsdspi/defconfig
@@ -36,6 +36,7 @@ CONFIG_INTELHEX_BINARY=y
 CONFIG_MAX_TASKS=16
 CONFIG_MMCSD=y
 CONFIG_MMCSD_SPICLOCK=4000000
+CONFIG_MM_REGIONS=2
 CONFIG_NFILE_DESCRIPTORS=8
 CONFIG_NSH_ARCHINIT=y
 CONFIG_NSH_BUILTIN_APPS=y
diff --git a/boards/xtensa/esp32/esp32-core/configs/netnsh/defconfig b/boards/xtensa/esp32/esp32-core/configs/netnsh/defconfig
index c7b0b7d..784fb30 100644
--- a/boards/xtensa/esp32/esp32-core/configs/netnsh/defconfig
+++ b/boards/xtensa/esp32/esp32-core/configs/netnsh/defconfig
@@ -28,6 +28,7 @@ CONFIG_HAVE_CXXINITIALIZE=y
 CONFIG_IDLETHREAD_STACKSIZE=3072
 CONFIG_INTELHEX_BINARY=y
 CONFIG_MAX_TASKS=16
+CONFIG_MM_REGIONS=2
 CONFIG_NETDB_DNSCLIENT=y
 CONFIG_NETDB_DNSSERVER_IPv4ADDR=0x08080808
 CONFIG_NETDB_HOSTFILE=y
diff --git a/boards/xtensa/esp32/esp32-core/configs/nsh/defconfig b/boards/xtensa/esp32/esp32-core/configs/nsh/defconfig
index 0579ffb..ecbdb6b 100644
--- a/boards/xtensa/esp32/esp32-core/configs/nsh/defconfig
+++ b/boards/xtensa/esp32/esp32-core/configs/nsh/defconfig
@@ -26,6 +26,7 @@ CONFIG_HAVE_CXXINITIALIZE=y
 CONFIG_IDLETHREAD_STACKSIZE=3072
 CONFIG_INTELHEX_BINARY=y
 CONFIG_MAX_TASKS=16
+CONFIG_MM_REGIONS=2
 CONFIG_NFILE_DESCRIPTORS=8
 CONFIG_NSH_ARCHINIT=y
 CONFIG_NSH_BUILTIN_APPS=y
diff --git a/boards/xtensa/esp32/esp32-core/configs/ostest/defconfig b/boards/xtensa/esp32/esp32-core/configs/ostest/defconfig
index 4796e33..a4db4a4 100644
--- a/boards/xtensa/esp32/esp32-core/configs/ostest/defconfig
+++ b/boards/xtensa/esp32/esp32-core/configs/ostest/defconfig
@@ -25,6 +25,7 @@ CONFIG_IDLETHREAD_STACKSIZE=3072
 CONFIG_INTELHEX_BINARY=y
 CONFIG_LIB_BOARDCTL=y
 CONFIG_MAX_TASKS=16
+CONFIG_MM_REGIONS=2
 CONFIG_NFILE_DESCRIPTORS=8
 CONFIG_PREALLOC_TIMERS=4
 CONFIG_RAM_SIZE=114688
diff --git a/boards/xtensa/esp32/esp32-core/configs/pm/defconfig b/boards/xtensa/esp32/esp32-core/configs/pm/defconfig
index b2c89ae..a3a49b0 100644
--- a/boards/xtensa/esp32/esp32-core/configs/pm/defconfig
+++ b/boards/xtensa/esp32/esp32-core/configs/pm/defconfig
@@ -26,6 +26,7 @@ CONFIG_HAVE_CXXINITIALIZE=y
 CONFIG_IDLETHREAD_STACKSIZE=3072
 CONFIG_INTELHEX_BINARY=y
 CONFIG_MAX_TASKS=16
+CONFIG_MM_REGIONS=2
 CONFIG_NFILE_DESCRIPTORS=8
 CONFIG_NSH_ARCHINIT=y
 CONFIG_NSH_BUILTIN_APPS=y
diff --git a/boards/xtensa/esp32/esp32-core/configs/random/defconfig b/boards/xtensa/esp32/esp32-core/configs/random/defconfig
index 88d0018..80d7bd7 100644
--- a/boards/xtensa/esp32/esp32-core/configs/random/defconfig
+++ b/boards/xtensa/esp32/esp32-core/configs/random/defconfig
@@ -28,6 +28,7 @@ CONFIG_HAVE_CXXINITIALIZE=y
 CONFIG_IDLETHREAD_STACKSIZE=3072
 CONFIG_INTELHEX_BINARY=y
 CONFIG_MAX_TASKS=16
+CONFIG_MM_REGIONS=2
 CONFIG_NFILE_DESCRIPTORS=8
 CONFIG_NSH_ARCHINIT=y
 CONFIG_NSH_BUILTIN_APPS=y
diff --git a/boards/xtensa/esp32/esp32-core/configs/smp/defconfig b/boards/xtensa/esp32/esp32-core/configs/smp/defconfig
index 151dcd0..ecb1924 100644
--- a/boards/xtensa/esp32/esp32-core/configs/smp/defconfig
+++ b/boards/xtensa/esp32/esp32-core/configs/smp/defconfig
@@ -31,6 +31,7 @@ CONFIG_HAVE_CXXINITIALIZE=y
 CONFIG_IDLETHREAD_STACKSIZE=3072
 CONFIG_INTELHEX_BINARY=y
 CONFIG_MAX_TASKS=16
+CONFIG_MM_REGIONS=2
 CONFIG_NFILE_DESCRIPTORS=8
 CONFIG_NSH_ARCHINIT=y
 CONFIG_NSH_BUILTIN_APPS=y
diff --git a/boards/xtensa/esp32/esp32-core/configs/spiflash/defconfig b/boards/xtensa/esp32/esp32-core/configs/spiflash/defconfig
index fd391d3..8353045 100644
--- a/boards/xtensa/esp32/esp32-core/configs/spiflash/defconfig
+++ b/boards/xtensa/esp32/esp32-core/configs/spiflash/defconfig
@@ -27,6 +27,7 @@ CONFIG_HAVE_CXXINITIALIZE=y
 CONFIG_IDLETHREAD_STACKSIZE=3072
 CONFIG_INTELHEX_BINARY=y
 CONFIG_MAX_TASKS=16
+CONFIG_MM_REGIONS=2
 CONFIG_MTD_SMART=y
 CONFIG_NFILE_DESCRIPTORS=8
 CONFIG_NSH_ARCHINIT=y