diff --git a/bsp/renesas/ra6e2-fpb/.config b/bsp/renesas/ra6e2-fpb/.config index 8e157727118..ac70aae6c41 100644 --- a/bsp/renesas/ra6e2-fpb/.config +++ b/bsp/renesas/ra6e2-fpb/.config @@ -192,6 +192,7 @@ CONFIG_RT_USING_HW_ATOMIC=y CONFIG_RT_USING_CPU_FFS=y CONFIG_ARCH_ARM=y CONFIG_ARCH_ARM_CORTEX_M=y +CONFIG_ARCH_ARM_CORTEX_SECURE=y CONFIG_ARCH_ARM_CORTEX_M33=y # diff --git a/bsp/renesas/ra6e2-fpb/board/Kconfig b/bsp/renesas/ra6e2-fpb/board/Kconfig index afe2c0897ba..41ee4627fc3 100644 --- a/bsp/renesas/ra6e2-fpb/board/Kconfig +++ b/bsp/renesas/ra6e2-fpb/board/Kconfig @@ -3,6 +3,7 @@ menu "Hardware Drivers Config" config SOC_R7FA6E2BB bool select SOC_SERIES_R7FA6E2 + select ARCH_ARM_CORTEX_SECURE select RT_USING_COMPONENTS_INIT select RT_USING_USER_MAIN default y diff --git a/bsp/renesas/ra6e2-fpb/project.uvprojx b/bsp/renesas/ra6e2-fpb/project.uvprojx index 87beea45fca..82ac939f623 100644 --- a/bsp/renesas/ra6e2-fpb/project.uvprojx +++ b/bsp/renesas/ra6e2-fpb/project.uvprojx @@ -67,19 +67,19 @@ 0 - 1 + 0 0 - cmd /c "start "Renesas" /w cmd /c ""$Prasc_launcher.bat" "$Prasc_version.txt" -nosplash --launcher.suppressErrors --generate --compiler ARMv6 --devicefamily ra "$Pconfiguration.xml" 2> "%%TEMP%%\rasc_stderr.out""" + 0 0 - 2 + 0 0 - 1 + 0 0 - cmd /c "start "Renesas" /w cmd /c ""$Prasc_launcher.bat" "$Prasc_version.txt" -nosplash --launcher.suppressErrors --gensmartbundle --compiler ARMv6 --devicefamily ra "$Pconfiguration.xml" "$L%L" 2> "%%TEMP%%\rasc_stderr.out""" + cmd /c "start "Renesas" /w cmd /c ""$Slauncher\rasc_launcher.bat" "5.1.0" --gensecurebundle --compiler ARMv6 "$Pconfiguration.xml" "$L%L" 2> "%%TEMP%%\rasc_stderr.out""" 0 0 @@ -335,9 +335,9 @@ 0 -Wno-license-management -Wuninitialized -Wall -Wmissing-declarations -Wpointer-arith -Waggregate-return -Wfloat-equal - __STDC_LIMIT_MACROS, RT_USING_ARMLIBC, RT_USING_LIBC, __RTTHREAD__, __CLK_TCK=RT_TICK_PER_SECOND + RT_USING_LIBC, __STDC_LIMIT_MACROS, RT_USING_ARMLIBC, __CLK_TCK=RT_TICK_PER_SECOND, __RTTHREAD__ - ..\..\..\components\drivers\include;..\..\..\components\drivers\smp_call;..\libraries\HAL_Drivers\config;..\..\..\components\drivers\include;.;..\..\..\components\drivers\include;..\libraries\HAL_Drivers;..\..\..\components\libc\compilers\common\extension;board\ports;..\..\..\libcpu\arm\common;..\..\..\components\libc\compilers\common\include;..\..\..\components\finsh;..\..\..\components\drivers\include;..\..\..\components\libc\posix\io\poll;..\..\..\include;..\..\..\components\libc\posix\io\eventfd;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\drivers\include;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\components\drivers\phy;board;..\..\..\components\libc\posix\io\epoll;..\..\..\components\libc\posix\ipc + ..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\smp_call;.;..\..\..\components\drivers\include;..\libraries\HAL_Drivers;..\..\..\libcpu\arm\common;..\..\..\components\drivers\phy;..\..\..\components\drivers\include;..\..\..\components\libc\posix\ipc;..\libraries\HAL_Drivers\config;..\..\..\components\finsh;..\..\..\components\libc\posix\io\poll;board\ports;..\..\..\components\libc\posix\io\epoll;..\..\..\components\libc\compilers\common\extension;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\include;board;..\..\..\components\drivers\include;..\..\..\libcpu\arm\cortex-m33;..\..\..\components\libc\compilers\common\include @@ -352,7 +352,6 @@ 0 4 - --via=via/rasc_armasm.via @@ -732,16 +731,16 @@ Finsh - msh_parse.c + msh.c 1 - ..\..\..\components\finsh\msh_parse.c + ..\..\..\components\finsh\msh.c - msh.c + msh_parse.c 1 - ..\..\..\components\finsh\msh.c + ..\..\..\components\finsh\msh_parse.c @@ -1032,37 +1031,37 @@ klibc - kstring.c + rt_vsscanf.c 1 - ..\..\..\src\klibc\kstring.c + ..\..\..\src\klibc\rt_vsscanf.c - rt_vsnprintf_tiny.c + kstdio.c 1 - ..\..\..\src\klibc\rt_vsnprintf_tiny.c + ..\..\..\src\klibc\kstdio.c - kstdio.c + kerrno.c 1 - ..\..\..\src\klibc\kstdio.c + ..\..\..\src\klibc\kerrno.c - kerrno.c + rt_vsnprintf_tiny.c 1 - ..\..\..\src\klibc\kerrno.c + ..\..\..\src\klibc\rt_vsnprintf_tiny.c - rt_vsscanf.c + kstring.c 1 - ..\..\..\src\klibc\rt_vsscanf.c + ..\..\..\src\klibc\kstring.c @@ -1093,14 +1092,28 @@ context_rvds.S 2 - ..\..\..\libcpu\arm\cortex-m4\context_rvds.S + ..\..\..\libcpu\arm\cortex-m33\context_rvds.S cpuport.c 1 - ..\..\..\libcpu\arm\cortex-m4\cpuport.c + ..\..\..\libcpu\arm\cortex-m33\cpuport.c + + + + + syscall_rvds.S + 2 + ..\..\..\libcpu\arm\cortex-m33\syscall_rvds.S + + + + + trustzone.c + 1 + ..\..\..\libcpu\arm\cortex-m33\trustzone.c diff --git a/bsp/renesas/ra6e2-fpb/rtconfig.h b/bsp/renesas/ra6e2-fpb/rtconfig.h index d7910ee0e77..32a7edbb37c 100644 --- a/bsp/renesas/ra6e2-fpb/rtconfig.h +++ b/bsp/renesas/ra6e2-fpb/rtconfig.h @@ -111,6 +111,7 @@ #define RT_USING_CPU_FFS #define ARCH_ARM #define ARCH_ARM_CORTEX_M +#define ARCH_ARM_CORTEX_SECURE #define ARCH_ARM_CORTEX_M33 /* RT-Thread Components */ diff --git a/bsp/renesas/ra6e2-fpb/rtconfig.py b/bsp/renesas/ra6e2-fpb/rtconfig.py index f03ce7604dd..0e8515391b5 100644 --- a/bsp/renesas/ra6e2-fpb/rtconfig.py +++ b/bsp/renesas/ra6e2-fpb/rtconfig.py @@ -3,7 +3,7 @@ # toolchains options ARCH='arm' -CPU='cortex-m4' +CPU='cortex-m33' CROSS_TOOL='gcc' if os.getenv('RTT_CC'): diff --git a/bsp/renesas/ra6e2-fpb/template.uvprojx b/bsp/renesas/ra6e2-fpb/template.uvprojx index 214f7c1b313..a3e51e35dc1 100644 --- a/bsp/renesas/ra6e2-fpb/template.uvprojx +++ b/bsp/renesas/ra6e2-fpb/template.uvprojx @@ -70,20 +70,20 @@ 0 - 1 + 0 0 - cmd /c "start "Renesas" /w cmd /c ""$Prasc_launcher.bat" "$Prasc_version.txt" -nosplash --launcher.suppressErrors --generate --compiler ARMv6 --devicefamily ra "$Pconfiguration.xml" 2> "%%TEMP%%\rasc_stderr.out""" - + + 0 0 - 2 + 0 0 - 1 + 0 0 - cmd /c "start "Renesas" /w cmd /c ""$Prasc_launcher.bat" "$Prasc_version.txt" -nosplash --launcher.suppressErrors --gensmartbundle --compiler ARMv6 --devicefamily ra "$Pconfiguration.xml" "$L%L" 2> "%%TEMP%%\rasc_stderr.out""" - + cmd /c "start "Renesas" /w cmd /c ""$Slauncher\rasc_launcher.bat" "5.1.0" --gensecurebundle --compiler ARMv6 "$Pconfiguration.xml" "$L%L" 2> "%%TEMP%%\rasc_stderr.out""" + 0 0 2 @@ -355,7 +355,6 @@ 0 4 - --via=via/rasc_armasm.via diff --git a/libcpu/arm/cortex-m33/context_rvds.S b/libcpu/arm/cortex-m33/context_rvds.S index 41ff62c78cd..5b527b537c1 100644 --- a/libcpu/arm/cortex-m33/context_rvds.S +++ b/libcpu/arm/cortex-m33/context_rvds.S @@ -146,10 +146,10 @@ contex_ns_store MRS r1, psp ; get from thread stack pointer -#if defined (__VFP_FP__) && !defined(__SOFTFP__) + IF {FPU} != "SoftVFP" TST lr, #0x10 ; if(!EXC_RETURN[4]) VSTMFDEQ r1!, {d8 - d15} ; push FPU register s16~s31 -#endif + ENDIF STMFD r1!, {r4 - r11} ; push r4 - r11 register @@ -190,10 +190,10 @@ switch_to_thread contex_ns_load LDMFD r1!, {r4 - r11} ; pop r4 - r11 register -#if defined (__VFP_FP__) && !defined(__SOFTFP__) + IF {FPU} != "SoftVFP" TST lr, #0x10 ; if(!EXC_RETURN[4]) VLDMFDEQ r1!, {d8 - d15} ; pop FPU register s16~s31 -#endif + ENDIF pendsv_exit MSR psp, r1 ; update stack pointer @@ -215,12 +215,12 @@ rt_hw_context_switch_to PROC LDR r1, =rt_interrupt_to_thread STR r0, [r1] -#if defined (__VFP_FP__) && !defined(__SOFTFP__) + IF {FPU} != "SoftVFP" ; CLEAR CONTROL.FPCA MRS r2, CONTROL ; read BIC r2, #0x04 ; modify MSR CONTROL, r2 ; write-back -#endif + ENDIF ; set from thread to 0 LDR r1, =rt_interrupt_from_thread