Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

Assembler error for Cortex M3 GCC port

Posted 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 port

Posted 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 port

Posted 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 port

Posted 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 port

Posted 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 port

Posted 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


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS