Skip to content
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

Support portable for ARM CA7 #110

Open
SteMMo33 opened this issue Jul 29, 2024 · 7 comments
Open

Support portable for ARM CA7 #110

SteMMo33 opened this issue Jul 29, 2024 · 7 comments
Assignees
Labels

Comments

@SteMMo33
Copy link

Hi all,
what about a portable branch toward ARM CA7 - i'm working with a STM32MP135.

Thanks!

@VladimirUmek
Copy link
Collaborator

Hi,
FreeRTOS currently does not have a portable for Arm Cortex-A7 core - see the FreeRTOS-Kernel repository. You could probably use and adopt the port for Cortex-A9 which exists.
If you want to trigger the request please check the FreeRTOS-Kernel repository and open an issue there. Thanks!

@SteMMo33
Copy link
Author

I added the Cortex-A9 files, but I have the following errors with the assembler:

Building file: ../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S
Invoking: GNU Arm Cross Assembler
arm-none-eabi-gcc -mcpu=cortex-a7 -mthumb -O2 -g -x assembler -MMD -MP -MF"src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.d" -MT"src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.o" -c -o "src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.o" "../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S"
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S: Assembler messages:
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:77: Error: selected processor does not support `fmrxne R1,FPSCR' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:147:  Info: macro invoked from here
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:79: Error: selected processor does not support `vpushne {D0-D15}' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:147:  Info: macro invoked from here
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:80: Error: selected processor does not support `vpushne {D16-D31}' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:147:  Info: macro invoked from here
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:109: Error: selected processor does not support `vpopne {D16-D31}' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:157:  Info: macro invoked from here
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:110: Error: selected processor does not support `vpopne {D0-D15}' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:157:  Info: macro invoked from here
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:112: Error: selected processor does not support `vmsrne FPSCR,R0' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:157:  Info: macro invoked from here
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:109: Error: selected processor does not support `vpopne {D16-D31}' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:167:  Info: macro invoked from here
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:110: Error: selected processor does not support `vpopne {D0-D15}' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:167:  Info: macro invoked from here
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:112: Error: selected processor does not support `vmsrne FPSCR,R0' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:167:  Info: macro invoked from here
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:77: Error: selected processor does not support `fmrxne R1,FPSCR' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:261:  Info: macro invoked from here
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:79: Error: selected processor does not support `vpushne {D0-D15}' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:261:  Info: macro invoked from here
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:80: Error: selected processor does not support `vpushne {D16-D31}' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:261:  Info: macro invoked from here
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:109: Error: selected processor does not support `vpopne {D16-D31}' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:278:  Info: macro invoked from here
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:110: Error: selected processor does not support `vpopne {D0-D15}' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:278:  Info: macro invoked from here
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:112: Error: selected processor does not support `vmsrne FPSCR,R0' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:278:  Info: macro invoked from here
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:304: Error: selected processor does not support `fmrx R1,FPSCR' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:305: Error: selected processor does not support `vpush {D0-D15}' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:306: Error: selected processor does not support `vpush {D16-D31}' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:313: Error: selected processor does not support `vpop {D16-D31}' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:314: Error: selected processor does not support `vpop {D0-D15}' in ARM mode
../src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.S:315: Error: selected processor does not support `vmsr FPSCR,R0' in ARM mode
make: *** [src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/subdir.mk:34: src/CMSIS-FreeRTOS/Source/portable/Gcc/ARM_CA7/portASM.o] Error 1

I tested both arm and thumb mode but same errors.
I'm wondering if they are strictly CA9 core commands ..

@SteMMo33 SteMMo33 reopened this Jul 31, 2024
@JonatanAntoni
Copy link
Member

Hi @SteMMo33,

The instructions are related to FPU on Cortex-A. Looks like some settings don't match in your case. Try to add -mfpu=neon-vfpv4 flag to enable NEON instructions via VFPv4 FPU.

@SteMMo33
Copy link
Author

@JonatanAntoni thanks!
I added -mfloat-abi=hard -mfpu=neon-vfpv4 options.

Now my problem is the error:

Building file: ../src/CMSIS-FreeRTOS/CMSIS/RTOS2/FreeRTOS/Source/clib_os.c
Invoking: GNU Arm Cross C Compiler
arm-none-eabi-gcc -mcpu=cortex-a7 -mthumb -mfloat-abi=hard -mfpu=neon-vfpv4 -O2 -g -DconfigUSE_TASK_FPU_SUPPORT=2 -I"C:\Progetti\dbTechnologies\testSTM32\testSTM32_CMSIS_RTOS2\Drivers\CMSIS\RTOS2\Include" -isystem"C:\Progetti\dbTechnologies\testSTM32\testSTM32_CMSIS_RTOS_FreeRTOS\src\CMSIS-FreeRTOS\Source\include" -isystem"C:\Progetti\dbTechnologies\testSTM32\testSTM32_CMSIS_RTOS_FreeRTOS\src\CMSIS-FreeRTOS\CMSIS\RTOS2\Include" -isystem"C:\Progetti\dbTechnologies\testSTM32\testSTM32_CMSIS_RTOS_FreeRTOS\src\CMSIS-FreeRTOS\Source\portable\Gcc\ARM_CA7" -isystem"C:\Progetti\dbTechnologies\testSTM32\testSTM32_CMSIS_RTOS_FreeRTOS\src\CMSIS-FreeRTOS\CMSIS\Device\ST\STM32MP13xx\Include" -isystem"C:\Progetti\dbTechnologies\testSTM32\testSTM32_CMSIS_RTOS_FreeRTOS\src\CMSIS-FreeRTOS" -isystem"C:\Progetti\dbTechnologies\testSTM32\testSTM32_CMSIS_RTOS_FreeRTOS\src\CMSIS-FreeRTOS\CMSIS\RTOS2\FreeRTOS\Config" -std=gnu11 -MMD -MP -MF"src/CMSIS-FreeRTOS/CMSIS/RTOS2/FreeRTOS/Source/clib_os.d" -MT"src/CMSIS-FreeRTOS/CMSIS/RTOS2/FreeRTOS/Source/clib_os.o" -c -o "src/CMSIS-FreeRTOS/CMSIS/RTOS2/FreeRTOS/Source/clib_os.o" "../src/CMSIS-FreeRTOS/CMSIS/RTOS2/FreeRTOS/Source/clib_os.c"
../src/CMSIS-FreeRTOS/CMSIS/RTOS2/FreeRTOS/Source/clib_os.c:41:7: error: expected ';' before 'void'
   41 | __WEAK void software_init_hook (void) {
      |       ^~~~~
      |       ;
make: *** [src/CMSIS-FreeRTOS/CMSIS/RTOS2/FreeRTOS/Source/subdir.mk:29: src/CMSIS-FreeRTOS/CMSIS/RTOS2/FreeRTOS/Source/clib_os.o] Error 1
"make all" terminated with exit code 2. Build might be incomplete.

Maybe the _WEAK symbol is wrong?

@JonatanAntoni
Copy link
Member

@VladimirUmek may comment on where __WEAK is expected to be defined.

@VladimirUmek
Copy link
Collaborator

WEAK symbol comes from CMSIS device header included by FreeRTOSConfig.h. CMSIS_device_header is defined in RTE_Components.h (generated by CMSIS build tool).

@JonatanAntoni
Copy link
Member

JonatanAntoni commented Aug 1, 2024

The compiler command line dumped above does not contain the usual _RTE_ defines. Hence, I suspect the device header is not included at all.

@SteMMo33, how do you compile the project above? The Makefile seems not ready for CMSIS-Pack based "RTE" projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants