You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by da...@apache.org on 2023/02/10 07:30:57 UTC

[nuttx] branch master updated (1cc6e4b1fa -> 80ebff90d5)

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

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


    from 1cc6e4b1fa sim: add uart dma mode & use work instead of loop.
     new 777c6c4aad arch: imxrt: Fix imxrt for CONFIG_BUILD_PROTECTED=y
     new e95b032c74 boards: imxrt1060-evk: Fix knsh and related linker script files
     new 80ebff90d5 boards: imxrt1060-evk: Update knsh

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:
 arch/arm/src/imxrt/imxrt_allocateheap.c            | 30 ++++++++++++++++++++++
 arch/arm/src/imxrt/imxrt_mpuinit.c                 |  4 +++
 .../arm/imxrt/imxrt1060-evk/configs/knsh/defconfig | 19 ++++++++++++++
 .../imxrt/imxrt1060-evk/scripts/kernel-space.ld    | 21 +++++++++++++++
 boards/arm/imxrt/imxrt1060-evk/scripts/memory.ld   |  7 ++---
 5 files changed, 78 insertions(+), 3 deletions(-)


[nuttx] 03/03: boards: imxrt1060-evk: Update knsh

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

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

commit 80ebff90d51b992e892b6990cb20bd948acbb4ae
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Fri Feb 10 10:18:20 2023 +0900

    boards: imxrt1060-evk: Update knsh
    
    Summary:
    - Add built-in apps such as ostest, getprime, hello
    - Enable some debug configurations
    - Enable interrupt stack and stack coloring
    
    Impact:
    - None
    
    Testing:
    - Tested with imxrt1060-evk
    
    Signed-off-by: Masayuki Ishikawa <Ma...@jp.sony.com>
---
 boards/arm/imxrt/imxrt1060-evk/configs/knsh/defconfig | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/boards/arm/imxrt/imxrt1060-evk/configs/knsh/defconfig b/boards/arm/imxrt/imxrt1060-evk/configs/knsh/defconfig
index c92e9294ca..3b8988def6 100644
--- a/boards/arm/imxrt/imxrt1060-evk/configs/knsh/defconfig
+++ b/boards/arm/imxrt/imxrt1060-evk/configs/knsh/defconfig
@@ -6,12 +6,14 @@
 # modifications.
 #
 # CONFIG_ARCH_RAMFUNCS is not set
+# CONFIG_NSH_DISABLE_MW is not set
 CONFIG_ARCH="arm"
 CONFIG_ARCH_BOARD="imxrt1060-evk"
 CONFIG_ARCH_BOARD_IMXRT1060_EVK=y
 CONFIG_ARCH_CHIP="imxrt"
 CONFIG_ARCH_CHIP_IMXRT=y
 CONFIG_ARCH_CHIP_MIMXRT1062DVL6A=y
+CONFIG_ARCH_INTERRUPTSTACK=2048
 CONFIG_ARCH_STACKDUMP=y
 CONFIG_ARMV7M_DCACHE=y
 CONFIG_ARMV7M_DCACHE_WRITETHROUGH=y
@@ -22,6 +24,14 @@ CONFIG_ARMV7M_USEBASEPRI=y
 CONFIG_ARM_MPU=y
 CONFIG_BOARD_LOOPSPERMSEC=104926
 CONFIG_BUILD_PROTECTED=y
+CONFIG_BUILTIN=y
+CONFIG_DEBUG_BUSFAULT=y
+CONFIG_DEBUG_FULLOPT=y
+CONFIG_DEBUG_HARDFAULT_ALERT=y
+CONFIG_DEBUG_MEMFAULT=y
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_DEBUG_USAGEFAULT=y
+CONFIG_EXAMPLES_HELLO=y
 CONFIG_FS_PROCFS=y
 CONFIG_IDLETHREAD_STACKSIZE=2048
 CONFIG_IMXRT_LPUART1=y
@@ -29,6 +39,7 @@ CONFIG_INIT_ENTRYPOINT="nsh_main"
 CONFIG_INTELHEX_BINARY=y
 CONFIG_LPUART1_SERIAL_CONSOLE=y
 CONFIG_NSH_ARCHINIT=y
+CONFIG_NSH_BUILTIN_APPS=y
 CONFIG_NSH_DISABLE_MKRD=y
 CONFIG_NSH_FILEIOSIZE=512
 CONFIG_NSH_LINELEN=64
@@ -38,6 +49,12 @@ CONFIG_PASS1_BUILDIR="boards/arm/imxrt/imxrt1060-evk/kernel"
 CONFIG_RAM_SIZE=1048576
 CONFIG_RAM_START=0x20200000
 CONFIG_SCHED_WAITPID=y
+CONFIG_STACK_COLORATION=y
 CONFIG_START_DAY=8
 CONFIG_START_MONTH=6
 CONFIG_SYSTEM_NSH=y
+CONFIG_TESTING_GETPRIME=y
+CONFIG_TESTING_OSTEST=y
+CONFIG_TESTING_OSTEST_FPUTESTDISABLE=y
+CONFIG_TESTING_OSTEST_NBARRIER_THREADS=3
+CONFIG_TESTING_OSTEST_STACKSIZE=2048


[nuttx] 01/03: arch: imxrt: Fix imxrt for CONFIG_BUILD_PROTECTED=y

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

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

commit 777c6c4aadfe88ae22be216fe40d84190f709b4c
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Thu Feb 9 11:53:42 2023 +0900

    arch: imxrt: Fix imxrt for CONFIG_BUILD_PROTECTED=y
    
    Summary:
    - Fix imxrt_allocateheap.c for CONFIG_BUILD_PROTECTED=y
    - Call mpu_reset() in imxrt_mpuinit.c
    
    Impact:
    - CONFIG_BUILD_PROTECTED=y only
    
    Testing:
    - Tested with imxrt1060-evk:knsh (will be updated later)
    
    Signed-off-by: Masayuki Ishikawa <Ma...@jp.sony.com>
---
 arch/arm/src/imxrt/imxrt_allocateheap.c | 30 ++++++++++++++++++++++++++++++
 arch/arm/src/imxrt/imxrt_mpuinit.c      |  4 ++++
 2 files changed, 34 insertions(+)

diff --git a/arch/arm/src/imxrt/imxrt_allocateheap.c b/arch/arm/src/imxrt/imxrt_allocateheap.c
index b4fa3e6ad7..333804c863 100644
--- a/arch/arm/src/imxrt/imxrt_allocateheap.c
+++ b/arch/arm/src/imxrt/imxrt_allocateheap.c
@@ -36,6 +36,7 @@
 
 #include <arch/imxrt/chip.h>
 
+#include "mpu.h"
 #include "arm_internal.h"
 #include "hardware/imxrt_memorymap.h"
 #include "imxrt_mpuinit.h"
@@ -309,14 +310,30 @@ void up_allocate_heap(void **heap_start, size_t *heap_size)
   uintptr_t ubase = (uintptr_t)USERSPACE->us_bssend +
                      CONFIG_MM_KERNEL_HEAPSIZE;
   size_t    usize = PRIMARY_RAM_END - ubase;
+  int       log2;
 
   DEBUGASSERT(ubase < (uintptr_t)PRIMARY_RAM_END);
 
+  /* Adjust that size to account for MPU alignment requirements.
+   * NOTE that there is an implicit assumption that the PRIMARY_RAM_END
+   * is aligned to the MPU requirement.
+   */
+
+  log2  = (int)mpu_log2regionfloor(usize);
+  DEBUGASSERT((PRIMARY_RAM_END & ((1 << log2) - 1)) == 0);
+
+  usize = (1 << log2);
+  ubase = PRIMARY_RAM_END - usize;
+
   /* Return the user-space heap settings */
 
   board_autoled_on(LED_HEAPALLOCATE);
   *heap_start = (void *)ubase;
   *heap_size  = usize;
+
+  /* Allow user-mode access to the user heap memory */
+
+  imxrt_mpu_uheap((uintptr_t)ubase, usize);
 #else
 
   /* Return the heap settings */
@@ -348,8 +365,21 @@ void up_allocate_kheap(void **heap_start, size_t *heap_size)
 
   uintptr_t ubase = (uintptr_t)USERSPACE->us_bssend +
                     CONFIG_MM_KERNEL_HEAPSIZE;
+  size_t    usize = PRIMARY_RAM_END - ubase;
+  int       log2;
   DEBUGASSERT(ubase < (uintptr_t)PRIMARY_RAM_END);
 
+  /* Adjust that size to account for MPU alignment requirements.
+   * NOTE that there is an implicit assumption that the CONFIG_RAM_END
+   * is aligned to the MPU requirement.
+   */
+
+  log2  = (int)mpu_log2regionfloor(usize);
+  DEBUGASSERT((PRIMARY_RAM_END & ((1 << log2) - 1)) == 0);
+
+  usize = (1 << log2);
+  ubase = PRIMARY_RAM_END - usize;
+
   /* Return the kernel heap settings (i.e., the part of the heap region
    * that was not dedicated to the user heap).
    */
diff --git a/arch/arm/src/imxrt/imxrt_mpuinit.c b/arch/arm/src/imxrt/imxrt_mpuinit.c
index dc03caabe6..5f8db353ca 100644
--- a/arch/arm/src/imxrt/imxrt_mpuinit.c
+++ b/arch/arm/src/imxrt/imxrt_mpuinit.c
@@ -91,6 +91,10 @@ void imxrt_mpu_initialize(void)
 
   mpu_showtype();
 
+  /* Reset MPU if enabled */
+
+  mpu_reset();
+
 #ifdef CONFIG_ARMV7M_DCACHE
   /* Memory barrier */
 


[nuttx] 02/03: boards: imxrt1060-evk: Fix knsh and related linker script files

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

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

commit e95b032c7480bffdc2931d3e09e22f687c897764
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Thu Feb 9 11:58:57 2023 +0900

    boards: imxrt1060-evk: Fix knsh and related linker script files
    
    Summary:
    - Fix knsh/defconfig to work with pyOCD
    - Fix kernel-space.ld to boot
    - Fix memory.ld for CONFIG_BUILD_PROTECTED=y
    
    Impact:
    - CONFIB_BUILD_PROTECTED=y only
    
    Testing:
    - Tested with imxrt1060-evk
    
    Signed-off-by: Masayuki Ishikawa <Ma...@jp.sony.com>
---
 .../arm/imxrt/imxrt1060-evk/configs/knsh/defconfig  |  2 ++
 .../arm/imxrt/imxrt1060-evk/scripts/kernel-space.ld | 21 +++++++++++++++++++++
 boards/arm/imxrt/imxrt1060-evk/scripts/memory.ld    |  7 ++++---
 3 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/boards/arm/imxrt/imxrt1060-evk/configs/knsh/defconfig b/boards/arm/imxrt/imxrt1060-evk/configs/knsh/defconfig
index ba97882d44..c92e9294ca 100644
--- a/boards/arm/imxrt/imxrt1060-evk/configs/knsh/defconfig
+++ b/boards/arm/imxrt/imxrt1060-evk/configs/knsh/defconfig
@@ -15,7 +15,9 @@ CONFIG_ARCH_CHIP_MIMXRT1062DVL6A=y
 CONFIG_ARCH_STACKDUMP=y
 CONFIG_ARMV7M_DCACHE=y
 CONFIG_ARMV7M_DCACHE_WRITETHROUGH=y
+CONFIG_ARMV7M_DTCM=y
 CONFIG_ARMV7M_ICACHE=y
+CONFIG_ARMV7M_ITCM=y
 CONFIG_ARMV7M_USEBASEPRI=y
 CONFIG_ARM_MPU=y
 CONFIG_BOARD_LOOPSPERMSEC=104926
diff --git a/boards/arm/imxrt/imxrt1060-evk/scripts/kernel-space.ld b/boards/arm/imxrt/imxrt1060-evk/scripts/kernel-space.ld
index 172f194495..3aa0e1a15a 100644
--- a/boards/arm/imxrt/imxrt1060-evk/scripts/kernel-space.ld
+++ b/boards/arm/imxrt/imxrt1060-evk/scripts/kernel-space.ld
@@ -24,10 +24,31 @@
 
 OUTPUT_ARCH(arm)
 EXTERN(_vectors)
+EXTERN(g_flash_config)
+EXTERN(g_image_vector_table)
+EXTERN(g_boot_data)
+
 ENTRY(_stext)
 
 SECTIONS
 {
+    /* Image Vector Table and Boot Data for booting from external flash */
+
+    .boot_hdr : ALIGN(4)
+    {
+        FILL(0xff)
+        __boot_hdr_start__ = ABSOLUTE(.) ;
+        KEEP(*(.boot_hdr.conf))
+        . = 0x1000 ;
+        KEEP(*(.boot_hdr.ivt))
+        . = 0x1020 ;
+        KEEP(*(.boot_hdr.boot_data))
+        . = 0x1030 ;
+        KEEP(*(.boot_hdr.dcd_data))
+        __boot_hdr_end__ = ABSOLUTE(.) ;
+        . = 0x2000 ;
+    } > kflash
+
   .text :
   {
     _stext = ABSOLUTE(.);
diff --git a/boards/arm/imxrt/imxrt1060-evk/scripts/memory.ld b/boards/arm/imxrt/imxrt1060-evk/scripts/memory.ld
index 38982bc19c..48f8cc471c 100644
--- a/boards/arm/imxrt/imxrt1060-evk/scripts/memory.ld
+++ b/boards/arm/imxrt/imxrt1060-evk/scripts/memory.ld
@@ -61,7 +61,8 @@ MEMORY
 
   /* 1MiB of OCRAM */
 
-  dtcm   (rwx) : ORIGIN = 0x20000000, LENGTH = 512K
-  kocram (rwx) : ORIGIN = 0x20200000, LENGTH = 512K
-  uocram (rwx) : ORIGIN = 0x20240000, LENGTH = 512K
+  itcm   (rwx) : ORIGIN = 0x00000000, LENGTH = 128K
+  dtcm   (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
+  kocram (rwx) : ORIGIN = 0x20200000, LENGTH = 256K
+  uocram (rwx) : ORIGIN = 0x20240000, LENGTH = 256K
 }