Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bsp/renesas/ra6e2-fpb/.config
Original file line number Diff line number Diff line change
Expand Up @@ -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

#
Expand Down
1 change: 1 addition & 0 deletions bsp/renesas/ra6e2-fpb/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
61 changes: 37 additions & 24 deletions bsp/renesas/ra6e2-fpb/project.uvprojx
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@
<nStopU2X>0</nStopU2X>
</BeforeCompile>
<BeforeMake>
<RunUserProg1>1</RunUserProg1>
<RunUserProg1>0</RunUserProg1>
<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 />
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopB1X>2</nStopB1X>
<nStopB1X>0</nStopB1X>
<nStopB2X>0</nStopB2X>
</BeforeMake>
<AfterMake>
<RunUserProg1>1</RunUserProg1>
<RunUserProg1>0</RunUserProg1>
<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 />
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
Expand Down Expand Up @@ -335,9 +335,9 @@
<v6Rtti>0</v6Rtti>
<VariousControls>
<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 />
<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>
</Cads>
<Aads>
Expand All @@ -352,7 +352,6 @@
<useXO>0</useXO>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls>--via=via/rasc_armasm.via</MiscControls>
<Define />
<Undefine />
<IncludePath />
Expand Down Expand Up @@ -732,16 +731,16 @@
<GroupName>Finsh</GroupName>
<Files>
<File>
<FileName>msh_parse.c</FileName>
<FileName>msh.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\finsh\msh_parse.c</FilePath>
<FilePath>..\..\..\components\finsh\msh.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>msh.c</FileName>
<FileName>msh_parse.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\finsh\msh.c</FilePath>
<FilePath>..\..\..\components\finsh\msh_parse.c</FilePath>
</File>
</Files>
<Files>
Expand Down Expand Up @@ -1032,37 +1031,37 @@
<GroupName>klibc</GroupName>
<Files>
<File>
<FileName>kstring.c</FileName>
<FileName>rt_vsscanf.c</FileName>
<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>
<FileName>kstdio.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\klibc\rt_vsnprintf_tiny.c</FilePath>
<FilePath>..\..\..\src\klibc\kstdio.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>kstdio.c</FileName>
<FileName>kerrno.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\klibc\kstdio.c</FilePath>
<FilePath>..\..\..\src\klibc\kerrno.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>kerrno.c</FileName>
<FileName>rt_vsnprintf_tiny.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\klibc\kerrno.c</FilePath>
<FilePath>..\..\..\src\klibc\rt_vsnprintf_tiny.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>rt_vsscanf.c</FileName>
<FileName>kstring.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\klibc\rt_vsscanf.c</FilePath>
<FilePath>..\..\..\src\klibc\kstring.c</FilePath>
</File>
</Files>
</Group>
Expand Down Expand Up @@ -1093,14 +1092,28 @@
<File>
<FileName>context_rvds.S</FileName>
<FileType>2</FileType>
<FilePath>..\..\..\libcpu\arm\cortex-m4\context_rvds.S</FilePath>
<FilePath>..\..\..\libcpu\arm\cortex-m33\context_rvds.S</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>cpuport.c</FileName>
<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>
</Files>
</Group>
Expand Down
1 change: 1 addition & 0 deletions bsp/renesas/ra6e2-fpb/rtconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion bsp/renesas/ra6e2-fpb/rtconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# toolchains options
ARCH='arm'
CPU='cortex-m4'
CPU='cortex-m33'
CROSS_TOOL='gcc'

if os.getenv('RTT_CC'):
Expand Down
15 changes: 7 additions & 8 deletions bsp/renesas/ra6e2-fpb/template.uvprojx
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,20 @@
<nStopU2X>0</nStopU2X>
</BeforeCompile>
<BeforeMake>
<RunUserProg1>1</RunUserProg1>
<RunUserProg1>0</RunUserProg1>
<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>
<UserProg2Name></UserProg2Name>
<UserProg1Name />
<UserProg2Name />
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopB1X>2</nStopB1X>
<nStopB1X>0</nStopB1X>
<nStopB2X>0</nStopB2X>
</BeforeMake>
<AfterMake>
<RunUserProg1>1</RunUserProg1>
<RunUserProg1>0</RunUserProg1>
<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>
<UserProg2Name></UserProg2Name>
<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 />
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopA1X>2</nStopA1X>
Expand Down Expand Up @@ -355,7 +355,6 @@
<useXO>0</useXO>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls>--via=via/rasc_armasm.via</MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
Expand Down
12 changes: 6 additions & 6 deletions libcpu/arm/cortex-m33/context_rvds.S
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down