FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [October 2010 Threads] Assembler error for Cortex M3 GCC portPosted by Esorol on October 23, 2010 Hi
I am trying to compile a project for the ARM Cortex M3 core using GCC. The tool I am using is YAGARTO, and the GCC 4.5.1 build inside.
When the compiler gets to the port.c file in the ARM_CM3 directory, it exits with the return message:
: Assembler messages: :307: Error: 'CPSR' or 'SPSR' expected -- 'mrs r0,psp'
The port.c file in question contains such an inline assembler command, which is in the xPortPendSVHandler function. Could this be the cause of the problem?
Is there anyone around who knows their way around the ARM assembler, and can determine why this error is returned?
Thanks for answers,
// Esorol
RE: Assembler error for Cortex M3 GCC portPosted by MEdwards on October 23, 2010 Which project are you trying to build. I think the standard demo projects use arm-none-eabi-gcc, rather than arm-elf-gcc. Have you tried using the CodeSourcery arm-none-eabi-gcc build?
RE: Assembler error for Cortex M3 GCC portPosted by Esorol on October 25, 2010 Hi
I am not building one of the demo projects, but some own code. I am already using the arm-none-eabi-gcc EXE for compiling. I also tried the CodeSourcery build but with the same error message.
Regards,
// Esorol
RE: Assembler error for Cortex M3 GCC portPosted by Richard on October 25, 2010 It might be that the latest GCC/AS version has changed the semantics required for the asm instructions - this has happened several times in the past. I will download the latest CodeSourcery build and try it.
However, PSP is the Process Stack Pointer so you would not think you could go wrong with that, and CPSR and SPSR do not seem to correspond with the Cortex M3 but are in fact ARM7 registers. I suspect there is an issue with your GCC command line. Do you have -mcpu=cortex-m3 set?
Regards.
RE: Assembler error for Cortex M3 GCC portPosted by Richard on October 25, 2010 I just downloaded the latest CodeSourcery G++ (which uses gcc V4.4.1) and build the demo from the FreeRTOS directory Demo\CORTEX_LM3S811_GCC directory with no problems.
Regards.
RE: Assembler error for Cortex M3 GCC portPosted by Esorol on October 25, 2010 Hey,
Thanks for the info. I'm really not a hardcore ARM-er so bear with my mistakes. =)
I did not have the -mcpu=cortex-m3 definition in the compiler command line. After adding it, I got another compiler error stating that the target does not support ARM mode. So I added also the -mthumb definition and now the mentioned port.c file compiles just fine, regardless of whether I use the CodeSourcery or the YAGARTO build, i.e 4.4.1 or 4.5.1 versions respectively of GCC.
Thanks for the help. Case closed I believe. =)
// Esorol
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|