Quality RTOS & Embedded Software

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


Loading

compiler error in queue.c at taskYIELD

Posted by mkrug on January 3, 2010
Hello,

I get the compiler error:
Error: missing expression -- `swi' in queue.c at the line(s) taskYIELD. I am using RTOS 6.0.1 for the ARM7 in the GCC version. However I tried a 5.x queue.c file with the same result. Additionally I generated a list file of queue. c that has the following appearence:
485:C:/ARM7Programme/workspace/RTOS/rtos/source\queue.c **** taskYIELD

308 .loc 1 486 0

309 @ 486 "C:/ARM7Programme/workspace/RTOS/rtos/source/queue.c" 1

310 SWI

311 @ 0 "" 2

So in principle the replacement of taskYIELD() to SWI seems OK. So my guess is more of an assembler syntax problem. I also tried the different portmacro.h versions for the ARM7 that are available without any success.
I am using the gcc version 4.4.2 and assembler 2.2.

Does anybody has a hint ?

Best Regards
Markus

RE: compiler error in queue.c at taskYIELD

Posted by Adam Turowski on January 3, 2010
Latest GCC & binutils requires that every SWI instruction should be followed by number which is passed to called software exception. Before tools assumed that the lack of this number means 0. So add 0 to SWI and it should compile/work.

You may fing example how to change that in http://freeecu.svn.sourceforge.net/trunk/

Regards,
Adam

RE: compiler error in queue.c at taskYIELD

Posted by Adam Turowski on January 3, 2010
Exactly in http://freeecu.svn.sourceforge.net/viewvc/freeecu/trunk/FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7X/portmacro.h?revision=79&view=markup line 231

Hope that helps,
Adam

RE: compiler error in queue.c at taskYIELD

Posted by bejkarna on January 5, 2010
Hi

to previous reply its actulay line 213

as I changed the line to

#define portYIELD()                    __asm volatile ( "SWI 0" )

the SWI errors disappeared but others came out:

../../../Source/queue.c: In function 'xQueueGenericSend':

../../../Source/queue.c:480: error: stray '\240' in program

eclipse shows that this error is caused everywhere the portYIELD_WITHIN_API(); function is called in queue.c



RE: compiler error in queue.c at taskYIELD

Posted by Richard on January 5, 2010
In all but the ports that support memory protection it is defined as

#define portYIELD_WITHIN_API portYIELD

I would guess that the problem is in your edit of portYIELD.

240 is not an ascii character (only an extended ascii character).

Regards.

RE: compiler error in queue.c at taskYIELD

Posted by bejkarna on January 5, 2010
Sorry, you are right I found this somewhere else, now I changed it to

 #define portYIELD()              asm volatile  ( "SWI 0" ) 


and everything works fine.

Thanks all of you.

RE: compiler error in queue.c at taskYIELD

Posted by mkrug on January 5, 2010
Hello,

thanks everyone for their help. It was simply to change the SWI instruction to SWI 0

Best Regards
Markus


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


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

Xilinx Microblaze and Zynq partner