libcpu/bsp: fix the M33 assembly syntax errors and fix the compilation error of bsp

This commit is contained in:
kurisaw
2025-06-23 09:44:41 +08:00
committed by Rbb666
parent 593ac8dbd6
commit 4f903298a2
7 changed files with 55 additions and 40 deletions
+1
View File
@@ -192,6 +192,7 @@ CONFIG_RT_USING_HW_ATOMIC=y
CONFIG_RT_USING_CPU_FFS=y CONFIG_RT_USING_CPU_FFS=y
CONFIG_ARCH_ARM=y CONFIG_ARCH_ARM=y
CONFIG_ARCH_ARM_CORTEX_M=y CONFIG_ARCH_ARM_CORTEX_M=y
CONFIG_ARCH_ARM_CORTEX_SECURE=y
CONFIG_ARCH_ARM_CORTEX_M33=y CONFIG_ARCH_ARM_CORTEX_M33=y
# #
+1
View File
@@ -3,6 +3,7 @@ menu "Hardware Drivers Config"
config SOC_R7FA6E2BB config SOC_R7FA6E2BB
bool bool
select SOC_SERIES_R7FA6E2 select SOC_SERIES_R7FA6E2
select ARCH_ARM_CORTEX_SECURE
select RT_USING_COMPONENTS_INIT select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN select RT_USING_USER_MAIN
default y default y
+38 -25
View File
@@ -67,19 +67,19 @@
<nStopU2X>0</nStopU2X> <nStopU2X>0</nStopU2X>
</BeforeCompile> </BeforeCompile>
<BeforeMake> <BeforeMake>
<RunUserProg1>1</RunUserProg1> <RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2> <RunUserProg2>0</RunUserProg2>
<UserProg1Name>cmd /c "start "Renesas" /w cmd /c ""$Prasc_launcher.bat" "$Prasc_version.txt" -nosplash --launcher.suppressErrors --generate --compiler ARMv6 --devicefamily ra "$Pconfiguration.xml" 2&gt; "%%TEMP%%\rasc_stderr.out"""</UserProg1Name> <UserProg1Name />
<UserProg2Name /> <UserProg2Name />
<UserProg1Dos16Mode>0</UserProg1Dos16Mode> <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode> <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopB1X>2</nStopB1X> <nStopB1X>0</nStopB1X>
<nStopB2X>0</nStopB2X> <nStopB2X>0</nStopB2X>
</BeforeMake> </BeforeMake>
<AfterMake> <AfterMake>
<RunUserProg1>1</RunUserProg1> <RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2> <RunUserProg2>0</RunUserProg2>
<UserProg1Name>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&gt; "%%TEMP%%\rasc_stderr.out"""</UserProg1Name> <UserProg1Name>cmd /c "start "Renesas" /w cmd /c ""$Slauncher\rasc_launcher.bat" "5.1.0" --gensecurebundle --compiler ARMv6 "$Pconfiguration.xml" "$L%L" 2&gt; "%%TEMP%%\rasc_stderr.out"""</UserProg1Name>
<UserProg2Name /> <UserProg2Name />
<UserProg1Dos16Mode>0</UserProg1Dos16Mode> <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode> <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
@@ -335,9 +335,9 @@
<v6Rtti>0</v6Rtti> <v6Rtti>0</v6Rtti>
<VariousControls> <VariousControls>
<MiscControls>-Wno-license-management -Wuninitialized -Wall -Wmissing-declarations -Wpointer-arith -Waggregate-return -Wfloat-equal</MiscControls> <MiscControls>-Wno-license-management -Wuninitialized -Wall -Wmissing-declarations -Wpointer-arith -Waggregate-return -Wfloat-equal</MiscControls>
<Define>__STDC_LIMIT_MACROS, RT_USING_ARMLIBC, RT_USING_LIBC, __RTTHREAD__, __CLK_TCK=RT_TICK_PER_SECOND</Define> <Define>RT_USING_LIBC, __STDC_LIMIT_MACROS, RT_USING_ARMLIBC, __CLK_TCK=RT_TICK_PER_SECOND, __RTTHREAD__</Define>
<Undefine /> <Undefine />
<IncludePath>..\..\..\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</IncludePath> <IncludePath>..\..\..\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</IncludePath>
</VariousControls> </VariousControls>
</Cads> </Cads>
<Aads> <Aads>
@@ -352,7 +352,6 @@
<useXO>0</useXO> <useXO>0</useXO>
<ClangAsOpt>4</ClangAsOpt> <ClangAsOpt>4</ClangAsOpt>
<VariousControls> <VariousControls>
<MiscControls>--via=via/rasc_armasm.via</MiscControls>
<Define /> <Define />
<Undefine /> <Undefine />
<IncludePath /> <IncludePath />
@@ -732,16 +731,16 @@
<GroupName>Finsh</GroupName> <GroupName>Finsh</GroupName>
<Files> <Files>
<File> <File>
<FileName>msh_parse.c</FileName> <FileName>msh.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\..\..\components\finsh\msh_parse.c</FilePath> <FilePath>..\..\..\components\finsh\msh.c</FilePath>
</File> </File>
</Files> </Files>
<Files> <Files>
<File> <File>
<FileName>msh.c</FileName> <FileName>msh_parse.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\..\..\components\finsh\msh.c</FilePath> <FilePath>..\..\..\components\finsh\msh_parse.c</FilePath>
</File> </File>
</Files> </Files>
<Files> <Files>
@@ -1032,16 +1031,9 @@
<GroupName>klibc</GroupName> <GroupName>klibc</GroupName>
<Files> <Files>
<File> <File>
<FileName>kstring.c</FileName> <FileName>rt_vsscanf.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\..\..\src\klibc\kstring.c</FilePath> <FilePath>..\..\..\src\klibc\rt_vsscanf.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>rt_vsnprintf_tiny.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\klibc\rt_vsnprintf_tiny.c</FilePath>
</File> </File>
</Files> </Files>
<Files> <Files>
@@ -1060,9 +1052,16 @@
</Files> </Files>
<Files> <Files>
<File> <File>
<FileName>rt_vsscanf.c</FileName> <FileName>rt_vsnprintf_tiny.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\..\..\src\klibc\rt_vsscanf.c</FilePath> <FilePath>..\..\..\src\klibc\rt_vsnprintf_tiny.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>kstring.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\klibc\kstring.c</FilePath>
</File> </File>
</Files> </Files>
</Group> </Group>
@@ -1093,14 +1092,28 @@
<File> <File>
<FileName>context_rvds.S</FileName> <FileName>context_rvds.S</FileName>
<FileType>2</FileType> <FileType>2</FileType>
<FilePath>..\..\..\libcpu\arm\cortex-m4\context_rvds.S</FilePath> <FilePath>..\..\..\libcpu\arm\cortex-m33\context_rvds.S</FilePath>
</File> </File>
</Files> </Files>
<Files> <Files>
<File> <File>
<FileName>cpuport.c</FileName> <FileName>cpuport.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\..\..\libcpu\arm\cortex-m4\cpuport.c</FilePath> <FilePath>..\..\..\libcpu\arm\cortex-m33\cpuport.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>syscall_rvds.S</FileName>
<FileType>2</FileType>
<FilePath>..\..\..\libcpu\arm\cortex-m33\syscall_rvds.S</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>trustzone.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\libcpu\arm\cortex-m33\trustzone.c</FilePath>
</File> </File>
</Files> </Files>
</Group> </Group>
+1
View File
@@ -111,6 +111,7 @@
#define RT_USING_CPU_FFS #define RT_USING_CPU_FFS
#define ARCH_ARM #define ARCH_ARM
#define ARCH_ARM_CORTEX_M #define ARCH_ARM_CORTEX_M
#define ARCH_ARM_CORTEX_SECURE
#define ARCH_ARM_CORTEX_M33 #define ARCH_ARM_CORTEX_M33
/* RT-Thread Components */ /* RT-Thread Components */
+1 -1
View File
@@ -3,7 +3,7 @@ import sys
# toolchains options # toolchains options
ARCH='arm' ARCH='arm'
CPU='cortex-m4' CPU='cortex-m33'
CROSS_TOOL='gcc' CROSS_TOOL='gcc'
if os.getenv('RTT_CC'): if os.getenv('RTT_CC'):
+7 -8
View File
@@ -70,20 +70,20 @@
<nStopU2X>0</nStopU2X> <nStopU2X>0</nStopU2X>
</BeforeCompile> </BeforeCompile>
<BeforeMake> <BeforeMake>
<RunUserProg1>1</RunUserProg1> <RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2> <RunUserProg2>0</RunUserProg2>
<UserProg1Name>cmd /c "start "Renesas" /w cmd /c ""$Prasc_launcher.bat" "$Prasc_version.txt" -nosplash --launcher.suppressErrors --generate --compiler ARMv6 --devicefamily ra "$Pconfiguration.xml" 2&gt; "%%TEMP%%\rasc_stderr.out"""</UserProg1Name> <UserProg1Name />
<UserProg2Name></UserProg2Name> <UserProg2Name />
<UserProg1Dos16Mode>0</UserProg1Dos16Mode> <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode> <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopB1X>2</nStopB1X> <nStopB1X>0</nStopB1X>
<nStopB2X>0</nStopB2X> <nStopB2X>0</nStopB2X>
</BeforeMake> </BeforeMake>
<AfterMake> <AfterMake>
<RunUserProg1>1</RunUserProg1> <RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2> <RunUserProg2>0</RunUserProg2>
<UserProg1Name>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&gt; "%%TEMP%%\rasc_stderr.out"""</UserProg1Name> <UserProg1Name>cmd /c "start "Renesas" /w cmd /c ""$Slauncher\rasc_launcher.bat" "5.1.0" --gensecurebundle --compiler ARMv6 "$Pconfiguration.xml" "$L%L" 2&gt; "%%TEMP%%\rasc_stderr.out"""</UserProg1Name>
<UserProg2Name></UserProg2Name> <UserProg2Name />
<UserProg1Dos16Mode>0</UserProg1Dos16Mode> <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode> <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopA1X>2</nStopA1X> <nStopA1X>2</nStopA1X>
@@ -355,7 +355,6 @@
<useXO>0</useXO> <useXO>0</useXO>
<ClangAsOpt>4</ClangAsOpt> <ClangAsOpt>4</ClangAsOpt>
<VariousControls> <VariousControls>
<MiscControls>--via=via/rasc_armasm.via</MiscControls>
<Define></Define> <Define></Define>
<Undefine></Undefine> <Undefine></Undefine>
<IncludePath></IncludePath> <IncludePath></IncludePath>
+6 -6
View File
@@ -146,10 +146,10 @@ contex_ns_store
MRS r1, psp ; get from thread stack pointer MRS r1, psp ; get from thread stack pointer
#if defined (__VFP_FP__) && !defined(__SOFTFP__) IF {FPU} != "SoftVFP"
TST lr, #0x10 ; if(!EXC_RETURN[4]) TST lr, #0x10 ; if(!EXC_RETURN[4])
VSTMFDEQ r1!, {d8 - d15} ; push FPU register s16~s31 VSTMFDEQ r1!, {d8 - d15} ; push FPU register s16~s31
#endif ENDIF
STMFD r1!, {r4 - r11} ; push r4 - r11 register STMFD r1!, {r4 - r11} ; push r4 - r11 register
@@ -190,10 +190,10 @@ switch_to_thread
contex_ns_load contex_ns_load
LDMFD r1!, {r4 - r11} ; pop r4 - r11 register LDMFD r1!, {r4 - r11} ; pop r4 - r11 register
#if defined (__VFP_FP__) && !defined(__SOFTFP__) IF {FPU} != "SoftVFP"
TST lr, #0x10 ; if(!EXC_RETURN[4]) TST lr, #0x10 ; if(!EXC_RETURN[4])
VLDMFDEQ r1!, {d8 - d15} ; pop FPU register s16~s31 VLDMFDEQ r1!, {d8 - d15} ; pop FPU register s16~s31
#endif ENDIF
pendsv_exit pendsv_exit
MSR psp, r1 ; update stack pointer MSR psp, r1 ; update stack pointer
@@ -215,12 +215,12 @@ rt_hw_context_switch_to PROC
LDR r1, =rt_interrupt_to_thread LDR r1, =rt_interrupt_to_thread
STR r0, [r1] STR r0, [r1]
#if defined (__VFP_FP__) && !defined(__SOFTFP__) IF {FPU} != "SoftVFP"
; CLEAR CONTROL.FPCA ; CLEAR CONTROL.FPCA
MRS r2, CONTROL ; read MRS r2, CONTROL ; read
BIC r2, #0x04 ; modify BIC r2, #0x04 ; modify
MSR CONTROL, r2 ; write-back MSR CONTROL, r2 ; write-back
#endif ENDIF
; set from thread to 0 ; set from thread to 0
LDR r1, =rt_interrupt_from_thread LDR r1, =rt_interrupt_from_thread