Quality RTOS & Embedded Software

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


Thumb compile error

Posted by Scott Thode on March 18, 2011
I'm trying to compile FreeRTOS for LPC1768 with GCC under Ubuntu. Tools are set up for arm-none-eabi. I get this error in port.c. Why might the compiler not recognise the svc instruction? I have these compiler flags: -mthumb -D__thumb2__=1 -mcpu=cortex-m3 -mtune=cortex-m3.
151:FreeRTOS/Source/portable/GCC/ARM_CM3/port.c **** void vPortStartFirstTask( void )
152:FreeRTOS/Source/portable/GCC/ARM_CM3/port.c **** {
150 .loc 1 152 0
151 .cfi_startproc
152 @ Naked Function: prologue and epilogue provided by programmer.
153 @ args = 0, pretend = 0, frame = 0
154 @ frame_needed = 1, uses_anonymous_args = 0
153:FreeRTOS/Source/portable/GCC/ARM_CM3/port.c **** __asm volatile(
155 .loc 1 153 0
156 @ 153 "FreeRTOS/Source/portable/GCC/ARM_CM3/port.c" 1
157 ldr r0, =0xE000ED08
158 ldr r0, [r0]
159 ldr r0, [r0]
160 ???? 80F30888 msr msp, r0
161 ???? 62B6 cpsie i
162 ???? 00DF svc 0
**** Error:SVC is not permitted on this architecture
163 ???? 00BF nop
165 @ 0 "" 2
154:FreeRTOS/Source/portable/GCC/ARM_CM3/port.c **** " ldr r0, =0xE000ED08 \n" /* Use the NVIC offset register to locate the stack. */
155:FreeRTOS/Source/portable/GCC/ARM_CM3/port.c **** " ldr r0, [r0] \n"
156:FreeRTOS/Source/portable/GCC/ARM_CM3/port.c **** " ldr r0, [r0] \n"
157:FreeRTOS/Source/portable/GCC/ARM_CM3/port.c **** " msr msp, r0\n" /* Set the msp back to the start of the stack. */
158:FreeRTOS/Source/portable/GCC/ARM_CM3/port.c **** " cpsie i\n" /* Globally enable interrupts. */
159:FreeRTOS/Source/portable/GCC/ARM_CM3/port.c **** " svc 0\n" /* System call to start first task. */
160:FreeRTOS/Source/portable/GCC/ARM_CM3/port.c **** " nop\n"
161:FreeRTOS/Source/portable/GCC/ARM_CM3/port.c **** );
162:FreeRTOS/Source/portable/GCC/ARM_CM3/port.c **** }
166 .loc 1 162 0
167 .thumb
168 .cfi_endproc

RE: Thumb compile error

Posted by Richard on March 18, 2011
[on the assumption your build options are correct, which on first glance they appear to be, and on the assumption your compiler version supports the CM3]

Check which version of binutils you are using. There is a catastrophic bug in version 2.21 which strangely, being an ARM compiler, does not recognise this ARM instruction as being an ARM instruction. If possible, use Binutils version 2.20.1 instead.


RE: Thumb compile error

Posted by Scott Thode on March 19, 2011
Thanks for that Richard. I am using binutils 2.21 so I'll try going back to 2.20.1.

I have GCC 4.5.2, newlib 1.19.2 and gdb 7.1. I did try gdb 7.2 but it fails to compile (some error compiling libiberty)


RE: Thumb compile error

Posted by Scott Thode on March 20, 2011
Ok, my FreeRTOS test code compiles now. Just need to get it working which hopefully means debugging my errors, not tool errors.

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

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists