Skip to content

Commit bc9fc02

Browse files
committed
libcpu/bsp: fix the M33 assembly syntax errors and fix the compilation error of bsp
1 parent c3da935 commit bc9fc02

File tree

7 files changed

+56
-41
lines changed

7 files changed

+56
-41
lines changed

bsp/renesas/ra6e2-fpb/.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ CONFIG_RT_USING_HW_ATOMIC=y
192192
CONFIG_RT_USING_CPU_FFS=y
193193
CONFIG_ARCH_ARM=y
194194
CONFIG_ARCH_ARM_CORTEX_M=y
195+
CONFIG_ARCH_ARM_CORTEX_SECURE=y
195196
CONFIG_ARCH_ARM_CORTEX_M33=y
196197

197198
#

bsp/renesas/ra6e2-fpb/project.uvprojx

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,19 @@
6767
<nStopU2X>0</nStopU2X>
6868
</BeforeCompile>
6969
<BeforeMake>
70-
<RunUserProg1>1</RunUserProg1>
70+
<RunUserProg1>0</RunUserProg1>
7171
<RunUserProg2>0</RunUserProg2>
72-
<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>
72+
<UserProg1Name />
7373
<UserProg2Name />
7474
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
7575
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
76-
<nStopB1X>2</nStopB1X>
76+
<nStopB1X>0</nStopB1X>
7777
<nStopB2X>0</nStopB2X>
7878
</BeforeMake>
7979
<AfterMake>
80-
<RunUserProg1>1</RunUserProg1>
80+
<RunUserProg1>0</RunUserProg1>
8181
<RunUserProg2>0</RunUserProg2>
82-
<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>
82+
<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>
8383
<UserProg2Name />
8484
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
8585
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
@@ -335,9 +335,9 @@
335335
<v6Rtti>0</v6Rtti>
336336
<VariousControls>
337337
<MiscControls>-Wno-license-management -Wuninitialized -Wall -Wmissing-declarations -Wpointer-arith -Waggregate-return -Wfloat-equal</MiscControls>
338-
<Define>__STDC_LIMIT_MACROS, RT_USING_ARMLIBC, RT_USING_LIBC, __RTTHREAD__, __CLK_TCK=RT_TICK_PER_SECOND</Define>
338+
<Define>__STDC_LIMIT_MACROS, RT_USING_ARMLIBC, __CLK_TCK=RT_TICK_PER_SECOND, __RTTHREAD__, RT_USING_LIBC</Define>
339339
<Undefine />
340-
<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>
340+
<IncludePath>..\..\..\components\drivers\include;..\libraries\HAL_Drivers;..\..\..\components\libc\posix\io\eventfd;..\..\..\components\drivers\include;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\libcpu\arm\cortex-m33;..\..\..\components\libc\compilers\common\extension;..\..\..\components\libc\posix\io\epoll;..\..\..\components\drivers\include;..\..\..\components\libc\posix\ipc;..\..\..\components\drivers\include;..\..\..\components\finsh;..\..\..\components\drivers\phy;board\ports;..\..\..\components\drivers\include;..\..\..\libcpu\arm\common;..\libraries\HAL_Drivers\config;board;..\..\..\components\drivers\smp_call;.;..\..\..\components\libc\posix\io\poll;..\..\..\components\libc\compilers\common\include;..\..\..\include</IncludePath>
341341
</VariousControls>
342342
</Cads>
343343
<Aads>
@@ -352,7 +352,6 @@
352352
<useXO>0</useXO>
353353
<ClangAsOpt>4</ClangAsOpt>
354354
<VariousControls>
355-
<MiscControls>--via=via/rasc_armasm.via</MiscControls>
356355
<Define />
357356
<Undefine />
358357
<IncludePath />
@@ -732,9 +731,9 @@
732731
<GroupName>Finsh</GroupName>
733732
<Files>
734733
<File>
735-
<FileName>msh_parse.c</FileName>
734+
<FileName>shell.c</FileName>
736735
<FileType>1</FileType>
737-
<FilePath>..\..\..\components\finsh\msh_parse.c</FilePath>
736+
<FilePath>..\..\..\components\finsh\shell.c</FilePath>
738737
</File>
739738
</Files>
740739
<Files>
@@ -746,16 +745,16 @@
746745
</Files>
747746
<Files>
748747
<File>
749-
<FileName>shell.c</FileName>
748+
<FileName>cmd.c</FileName>
750749
<FileType>1</FileType>
751-
<FilePath>..\..\..\components\finsh\shell.c</FilePath>
750+
<FilePath>..\..\..\components\finsh\cmd.c</FilePath>
752751
</File>
753752
</Files>
754753
<Files>
755754
<File>
756-
<FileName>cmd.c</FileName>
755+
<FileName>msh_parse.c</FileName>
757756
<FileType>1</FileType>
758-
<FilePath>..\..\..\components\finsh\cmd.c</FilePath>
757+
<FilePath>..\..\..\components\finsh\msh_parse.c</FilePath>
759758
</File>
760759
</Files>
761760
</Group>
@@ -1032,37 +1031,37 @@
10321031
<GroupName>klibc</GroupName>
10331032
<Files>
10341033
<File>
1035-
<FileName>kstring.c</FileName>
1034+
<FileName>rt_vsscanf.c</FileName>
10361035
<FileType>1</FileType>
1037-
<FilePath>..\..\..\src\klibc\kstring.c</FilePath>
1036+
<FilePath>..\..\..\src\klibc\rt_vsscanf.c</FilePath>
10381037
</File>
10391038
</Files>
10401039
<Files>
10411040
<File>
1042-
<FileName>rt_vsnprintf_tiny.c</FileName>
1041+
<FileName>kerrno.c</FileName>
10431042
<FileType>1</FileType>
1044-
<FilePath>..\..\..\src\klibc\rt_vsnprintf_tiny.c</FilePath>
1043+
<FilePath>..\..\..\src\klibc\kerrno.c</FilePath>
10451044
</File>
10461045
</Files>
10471046
<Files>
10481047
<File>
1049-
<FileName>kstdio.c</FileName>
1048+
<FileName>rt_vsnprintf_tiny.c</FileName>
10501049
<FileType>1</FileType>
1051-
<FilePath>..\..\..\src\klibc\kstdio.c</FilePath>
1050+
<FilePath>..\..\..\src\klibc\rt_vsnprintf_tiny.c</FilePath>
10521051
</File>
10531052
</Files>
10541053
<Files>
10551054
<File>
1056-
<FileName>kerrno.c</FileName>
1055+
<FileName>kstdio.c</FileName>
10571056
<FileType>1</FileType>
1058-
<FilePath>..\..\..\src\klibc\kerrno.c</FilePath>
1057+
<FilePath>..\..\..\src\klibc\kstdio.c</FilePath>
10591058
</File>
10601059
</Files>
10611060
<Files>
10621061
<File>
1063-
<FileName>rt_vsscanf.c</FileName>
1062+
<FileName>kstring.c</FileName>
10641063
<FileType>1</FileType>
1065-
<FilePath>..\..\..\src\klibc\rt_vsscanf.c</FilePath>
1064+
<FilePath>..\..\..\src\klibc\kstring.c</FilePath>
10661065
</File>
10671066
</Files>
10681067
</Group>
@@ -1093,14 +1092,28 @@
10931092
<File>
10941093
<FileName>context_rvds.S</FileName>
10951094
<FileType>2</FileType>
1096-
<FilePath>..\..\..\libcpu\arm\cortex-m4\context_rvds.S</FilePath>
1095+
<FilePath>..\..\..\libcpu\arm\cortex-m33\context_rvds.S</FilePath>
10971096
</File>
10981097
</Files>
10991098
<Files>
11001099
<File>
11011100
<FileName>cpuport.c</FileName>
11021101
<FileType>1</FileType>
1103-
<FilePath>..\..\..\libcpu\arm\cortex-m4\cpuport.c</FilePath>
1102+
<FilePath>..\..\..\libcpu\arm\cortex-m33\cpuport.c</FilePath>
1103+
</File>
1104+
</Files>
1105+
<Files>
1106+
<File>
1107+
<FileName>syscall_rvds.S</FileName>
1108+
<FileType>2</FileType>
1109+
<FilePath>..\..\..\libcpu\arm\cortex-m33\syscall_rvds.S</FilePath>
1110+
</File>
1111+
</Files>
1112+
<Files>
1113+
<File>
1114+
<FileName>trustzone.c</FileName>
1115+
<FileType>1</FileType>
1116+
<FilePath>..\..\..\libcpu\arm\cortex-m33\trustzone.c</FilePath>
11041117
</File>
11051118
</Files>
11061119
</Group>

bsp/renesas/ra6e2-fpb/rtconfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
#define RT_USING_CPU_FFS
112112
#define ARCH_ARM
113113
#define ARCH_ARM_CORTEX_M
114+
#define ARCH_ARM_CORTEX_SECURE
114115
#define ARCH_ARM_CORTEX_M33
115116

116117
/* RT-Thread Components */

bsp/renesas/ra6e2-fpb/rtconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# toolchains options
55
ARCH='arm'
6-
CPU='cortex-m4'
6+
CPU='cortex-m33'
77
CROSS_TOOL='gcc'
88

99
if os.getenv('RTT_CC'):

bsp/renesas/ra6e2-fpb/template.uvprojx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,20 @@
7070
<nStopU2X>0</nStopU2X>
7171
</BeforeCompile>
7272
<BeforeMake>
73-
<RunUserProg1>1</RunUserProg1>
73+
<RunUserProg1>0</RunUserProg1>
7474
<RunUserProg2>0</RunUserProg2>
75-
<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>
76-
<UserProg2Name></UserProg2Name>
75+
<UserProg1Name />
76+
<UserProg2Name />
7777
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
7878
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
79-
<nStopB1X>2</nStopB1X>
79+
<nStopB1X>0</nStopB1X>
8080
<nStopB2X>0</nStopB2X>
8181
</BeforeMake>
8282
<AfterMake>
83-
<RunUserProg1>1</RunUserProg1>
83+
<RunUserProg1>0</RunUserProg1>
8484
<RunUserProg2>0</RunUserProg2>
85-
<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>
86-
<UserProg2Name></UserProg2Name>
85+
<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>
86+
<UserProg2Name />
8787
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
8888
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
8989
<nStopA1X>2</nStopA1X>
@@ -355,7 +355,6 @@
355355
<useXO>0</useXO>
356356
<ClangAsOpt>4</ClangAsOpt>
357357
<VariousControls>
358-
<MiscControls>--via=via/rasc_armasm.via</MiscControls>
359358
<Define></Define>
360359
<Undefine></Undefine>
361360
<IncludePath></IncludePath>

libcpu/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ config ARCH_ARM_CORTEX_M23
9292

9393
config ARCH_ARM_CORTEX_M33
9494
bool
95+
select ARCH_ARM_CORTEX_SECURE
9596
select ARCH_ARM_CORTEX_M
9697
select RT_USING_CPU_FFS
9798
select RT_USING_HW_ATOMIC

libcpu/arm/cortex-m33/context_rvds.S

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ contex_ns_store
146146

147147
MRS r1, psp ; get from thread stack pointer
148148

149-
#if defined (__VFP_FP__) && !defined(__SOFTFP__)
149+
IF {FPU} != "SoftVFP"
150150
TST lr, #0x10 ; if(!EXC_RETURN[4])
151151
VSTMFDEQ r1!, {d8 - d15} ; push FPU register s16~s31
152-
#endif
152+
ENDIF
153153

154154
STMFD r1!, {r4 - r11} ; push r4 - r11 register
155155

@@ -190,10 +190,10 @@ switch_to_thread
190190
contex_ns_load
191191
LDMFD r1!, {r4 - r11} ; pop r4 - r11 register
192192

193-
#if defined (__VFP_FP__) && !defined(__SOFTFP__)
193+
IF {FPU} != "SoftVFP"
194194
TST lr, #0x10 ; if(!EXC_RETURN[4])
195195
VLDMFDEQ r1!, {d8 - d15} ; pop FPU register s16~s31
196-
#endif
196+
ENDIF
197197

198198
pendsv_exit
199199
MSR psp, r1 ; update stack pointer
@@ -215,12 +215,12 @@ rt_hw_context_switch_to PROC
215215
LDR r1, =rt_interrupt_to_thread
216216
STR r0, [r1]
217217

218-
#if defined (__VFP_FP__) && !defined(__SOFTFP__)
218+
IF {FPU} != "SoftVFP"
219219
; CLEAR CONTROL.FPCA
220220
MRS r2, CONTROL ; read
221221
BIC r2, #0x04 ; modify
222222
MSR CONTROL, r2 ; write-back
223-
#endif
223+
ENDIF
224224

225225
; set from thread to 0
226226
LDR r1, =rt_interrupt_from_thread

0 commit comments

Comments
 (0)