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 2022/07/12 02:57:05 UTC

[incubator-nuttx] branch master updated (6de170b154 -> cc0ea2689c)

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 6de170b154 boards/xtensa: Remove outdated information.
     new 686c9f0ad7 esp32c3-devkit: Use prebuilt bootloader binaries on knsh defconfig
     new 5e32aa14bf risc-v/esp32c3: Fix verification of ROM function return values
     new c462ea6088 esp32c3-devkit: Improve documentation related to Protected Mode
     new cc0ea2689c esp32c3-devkit: Change output section identifiers to satisfy GDB

The 4 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/esp32c3_userspace.c        | 14 +++++------
 .../esp32c3/esp32c3-devkit/configs/knsh/defconfig  |  1 -
 .../esp32c3-devkit/scripts/protected.template.ld   | 21 +++++++++++------
 .../esp32c3/esp32c3-devkit/scripts/user-space.ld   | 27 ++++++++++++++--------
 4 files changed, 38 insertions(+), 25 deletions(-)


[incubator-nuttx] 04/04: esp32c3-devkit: Change output section identifiers to satisfy GDB

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 cc0ea2689c6ffe844a1e3acd4e74a4580e28a892
Author: Gustavo Henrique Nihei <gu...@espressif.com>
AuthorDate: Mon Jul 11 15:22:28 2022 -0300

    esp32c3-devkit: Change output section identifiers to satisfy GDB
    
    Signed-off-by: Gustavo Henrique Nihei <gu...@espressif.com>
---
 .../esp32c3/esp32c3-devkit/scripts/user-space.ld   | 27 ++++++++++++++--------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/boards/risc-v/esp32c3/esp32c3-devkit/scripts/user-space.ld b/boards/risc-v/esp32c3/esp32c3-devkit/scripts/user-space.ld
index 717c77efd9..f7bd85e576 100755
--- a/boards/risc-v/esp32c3/esp32c3-devkit/scripts/user-space.ld
+++ b/boards/risc-v/esp32c3/esp32c3-devkit/scripts/user-space.ld
@@ -30,7 +30,7 @@ SECTIONS
 
     LONG(ADDR(.userspace))
     LONG(LOADADDR(.userspace))
-    LONG(SIZEOF(.userspace) + SIZEOF(.flash.rodata))
+    LONG(SIZEOF(.userspace) + SIZEOF(.rodata))
 
     /* IROM metadata:
      * - Destination address (VMA) for IROM region
@@ -38,9 +38,9 @@ SECTIONS
      * - Size of IROM region
      */
 
-    LONG(ADDR(.flash.text))
-    LONG(LOADADDR(.flash.text))
-    LONG(SIZEOF(.flash.text))
+    LONG(ADDR(.text))
+    LONG(LOADADDR(.text))
+    LONG(SIZEOF(.text))
   } >metadata
 
   /* section info */
@@ -58,13 +58,20 @@ SECTIONS
   __ld_udram_size = LENGTH(UDRAM);
   __ld_udram_end = ORIGIN(UDRAM) + LENGTH(UDRAM);
 
-  _eronly = LOADADDR(.dram0.data);
+  _eronly = LOADADDR(.data);
 
   .userspace : {
     *(.userspace)
   } >UDROM AT>ROM
 
-  .flash.rodata :
+  /* Output sections for the Userspace image are given standard names, so
+   * instead of the Espressif-usual ".flash.text" we name it as ".text".
+   * The motivation is to ease debugging with GDB when loading symbols from
+   * both Kernel and User images since GDB's "add-symbol-file" command
+   * expects to find a .text section at the provided offset.
+   */
+
+  .rodata :
   {
     _srodata = ABSOLUTE(.);
 
@@ -142,7 +149,7 @@ SECTIONS
 
   /* Shared RAM */
 
-  .dram0.bss (NOLOAD) :
+  .bss (NOLOAD) :
   {
     . = ALIGN (8);
     _sbss = ABSOLUTE(.);
@@ -175,7 +182,7 @@ SECTIONS
     *(.noinit.*)
   } >UDRAM
 
-  .dram0.data :
+  .data :
   {
     _sdata = ABSOLUTE(.);
     *(.data)
@@ -197,10 +204,10 @@ SECTIONS
 
   .flash_text_dummy (NOLOAD) : ALIGN(0x00010000)
   {
-    . = SIZEOF(.userspace) + SIZEOF(.flash.rodata);
+    . = SIZEOF(.userspace) + SIZEOF(.rodata);
   } >UIROM
 
-  .flash.text : ALIGN(0x00010000)
+  .text : ALIGN(0x00010000)
   {
     _stext = .;
 


[incubator-nuttx] 01/04: esp32c3-devkit: Use prebuilt bootloader binaries on knsh defconfig

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 686c9f0ad76d6ce5a5af8f922a5372d406c60ca1
Author: Gustavo Henrique Nihei <gu...@espressif.com>
AuthorDate: Mon Jul 11 14:35:41 2022 -0300

    esp32c3-devkit: Use prebuilt bootloader binaries on knsh defconfig
    
    After #6400 the prebuilt bootloader may be used for loading the NuttX
    images when BUILD_PROTECTED is enabled.
    
    Signed-off-by: Gustavo Henrique Nihei <gu...@espressif.com>
---
 boards/risc-v/esp32c3/esp32c3-devkit/configs/knsh/defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/boards/risc-v/esp32c3/esp32c3-devkit/configs/knsh/defconfig b/boards/risc-v/esp32c3/esp32c3-devkit/configs/knsh/defconfig
index 85ae6a6af3..32aa988959 100644
--- a/boards/risc-v/esp32c3/esp32c3-devkit/configs/knsh/defconfig
+++ b/boards/risc-v/esp32c3/esp32c3-devkit/configs/knsh/defconfig
@@ -30,7 +30,6 @@ CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_SYMBOLS=y
 CONFIG_DEBUG_WARN=y
 CONFIG_DEV_ZERO=y
-CONFIG_ESP32C3_BOOTLOADER_BUILD_FROM_SOURCE=y
 CONFIG_FS_PROCFS=y
 CONFIG_IDLETHREAD_STACKSIZE=2048
 CONFIG_INIT_ENTRYPOINT="nsh_main"


[incubator-nuttx] 03/04: esp32c3-devkit: Improve documentation related to Protected Mode

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 c462ea6088ff78f0a8af1eefb36d97dbb8d2b1ef
Author: Gustavo Henrique Nihei <gu...@espressif.com>
AuthorDate: Mon Jul 11 15:22:05 2022 -0300

    esp32c3-devkit: Improve documentation related to Protected Mode
    
    Signed-off-by: Gustavo Henrique Nihei <gu...@espressif.com>
---
 .../esp32c3-devkit/scripts/protected.template.ld    | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/boards/risc-v/esp32c3/esp32c3-devkit/scripts/protected.template.ld b/boards/risc-v/esp32c3/esp32c3-devkit/scripts/protected.template.ld
index 6e0e33ab6b..64750c1afd 100644
--- a/boards/risc-v/esp32c3/esp32c3-devkit/scripts/protected.template.ld
+++ b/boards/risc-v/esp32c3/esp32c3-devkit/scripts/protected.template.ld
@@ -22,8 +22,12 @@
  * This file describes the memory layout (memory blocks) as virtual
  * memory addresses.
  *
+ * kernel-space.ld and user-space.ld contain output sections to link compiler
+ * output into these memory blocks for the Kernel and User images,
+ * respectively.
+ *
  * NOTE: That this is not the actual linker script but rather a "template"
- * for the esp32c3_out.ld script.  This template script is passed through
+ * for the esp32c3_out.ld script. This template script is passed through
  * the C preprocessor to include selected configuration options.
  *
  ****************************************************************************/
@@ -66,7 +70,8 @@ MEMORY
 
   /* Flash mapped instruction data. */
 
-  /* The 0x20 offset is a convenience for the app binary image generation.
+  /* The 0x20 offset for the KIROM region is a convenience for the Kernel
+   * binary image generation in Espressif Application Image format.
    * Flash cache has 64KB pages. The .bin file which is flashed to the chip
    * has a 0x18 byte file header, and each segment has a 0x08 byte segment
    * header. Setting this offset makes it simple to meet the flash cache MMU's
@@ -83,11 +88,13 @@ MEMORY
 
   /* Flash mapped constant data */
 
-  /* The 0x20 offset is a convenience for the app binary image generation.
-   * Flash cache has 64KB pages. The .bin file which is flashed to the chip
-   * has a 0x18 byte file header, and each segment has a 0x08 byte segment
-   * header. Setting this offset makes it simple to meet the flash cache MMU's
-   * constraint that (paddr % 64KB == vaddr % 64KB).
+  /* See KIROM region documentation above for the meaning of the 0x20 offset.
+   *
+   * The 0x18 offset for the UDROM region is a convenience for the User
+   * binary image generation following a custom image format, which defines
+   * a "metadata" output section containing some information that the Kernel
+   * needs for properly configuring the External Flash MMU when loading the
+   * User application image.
    */
 
   KDROM (R)  :      org = 0x3c000020, len = 0x80000 - 0x20


[incubator-nuttx] 02/04: risc-v/esp32c3: Fix verification of ROM function return values

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 5e32aa14bfa513a8d1d9ec6feb791b443a588430
Author: Gustavo Henrique Nihei <gu...@espressif.com>
AuthorDate: Mon Jul 11 15:16:41 2022 -0300

    risc-v/esp32c3: Fix verification of ROM function return values
    
    cache_dbus_mmu_set and cache_ibus_mmu_set return positive values in case
    of errors, so DEBUVERIFY could never detect them since this macro checks
    for negative values.
    Besides, the successful execution of those functions is mandatory for
    the reliable operation under Protected Mode, so the verification is
    always performed, even when DEBUG is not enabled.
    
    Signed-off-by: Gustavo Henrique Nihei <gu...@espressif.com>
---
 arch/risc-v/src/esp32c3/esp32c3_userspace.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/risc-v/src/esp32c3/esp32c3_userspace.c b/arch/risc-v/src/esp32c3/esp32c3_userspace.c
index 9f885a92e5..5628c90603 100755
--- a/arch/risc-v/src/esp32c3/esp32c3_userspace.c
+++ b/arch/risc-v/src/esp32c3/esp32c3_userspace.c
@@ -157,16 +157,16 @@ static noinline_function IRAM_ATTR void configure_mmu(void)
   drom_lma_aligned = app_drom_lma & MMU_FLASH_MASK;
   drom_vma_aligned = app_drom_vma & MMU_FLASH_MASK;
   drom_page_count = calc_mmu_pages(app_drom_size, app_drom_vma);
-  DEBUGVERIFY(cache_dbus_mmu_set(MMU_ACCESS_FLASH, drom_vma_aligned,
+  ASSERT(cache_dbus_mmu_set(MMU_ACCESS_FLASH, drom_vma_aligned,
                                  drom_lma_aligned, 64,
-                                 (int)drom_page_count, 0));
+                                 (int)drom_page_count, 0) == 0);
 
   irom_lma_aligned = app_irom_lma & MMU_FLASH_MASK;
   irom_vma_aligned = app_irom_vma & MMU_FLASH_MASK;
   irom_page_count = calc_mmu_pages(app_irom_size, app_irom_vma);
-  DEBUGVERIFY(cache_ibus_mmu_set(MMU_ACCESS_FLASH, irom_vma_aligned,
-                                 irom_lma_aligned, 64,
-                                 (int)irom_page_count, 0));
+  ASSERT(cache_ibus_mmu_set(MMU_ACCESS_FLASH, irom_vma_aligned,
+                            irom_lma_aligned, 64,
+                            (int)irom_page_count, 0) == 0);
 
   cache_resume_icache(autoload);
 }
@@ -197,8 +197,8 @@ static noinline_function IRAM_ATTR const void *map_flash(uint32_t src_addr,
 
   src_addr_aligned = src_addr & MMU_FLASH_MASK;
   page_count = calc_mmu_pages(size, src_addr);
-  DEBUGVERIFY(cache_dbus_mmu_set(MMU_ACCESS_FLASH, MMU_BLOCK63_VADDR,
-                                 src_addr_aligned, 64, (int)page_count, 0));
+  ASSERT(cache_dbus_mmu_set(MMU_ACCESS_FLASH, MMU_BLOCK63_VADDR,
+                            src_addr_aligned, 64, (int)page_count, 0) == 0);
 
   cache_resume_icache(autoload);