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


Problem with SWI

Posted by Kristian Dilov on May 9, 2009
Hello everybody,
I'm trying to change the FREERTOS to have pre-emtive and nonpre-emtive tasks simultaneously. So the idea is when the task has completed its job to yield explicitelly:

void vPortYieldProcessor( void ) __attribute__((interrupt("SWI"), naked));
#define portYIELD() asm volatile ( "SWI\n\t" )

static portTASK_FUNCTION( vTask2, pvParameters )
/* Just to stop compiler warnings. */
( void ) pvParameters;

SendString(EmaName); /* Print something */
portYIELD(); /* trigger a task switch*/

Actually trhough my debugger (yagarto tools + eclipse) I see that the program hengs always at the program abort trap:
.section .startup,"ax"
.code 32
.align 0

b _start/* reset - _start*/
ldr pc, _undf/* undefined - _undf*/
ldr pc, _swi/* SWI - _swi*/
ldr pc, _pabt/* program abort - _pabt*/
ldr pc, _dabt/* data abort - _dabt*/
nop/* reserved*/
ldr pc, [pc,#-0xFF0]/* IRQ - read the VIC*/
ldr pc, _fiq/* FIQ - _fiq*/

_undf: .word __undf /* undefined*/
_swi: .word vPortYieldProcessor /* SWI*/
_pabt: .word __pabt /* program abort*/
_dabt: .word __dabt /* data abort*/
_fiq: .word __fiq /* FIQ*/

__undf: b . /* undefined*/
__pabt: b . /* program abort*/<-HERE
__dabt: b . /* data abort*/
__fiq: b . /* FIQ*/
Does anybady know what is going wrong ?
Thanks in advance!

RE: Problem with SWI

Posted by Richard on May 9, 2009
You must not allow a task to return from its implementing function. Either the task must be in an infinite loop, or it must be deleted before it reaches the end of the function. A task can delete itself before reaching the end of the function.


[ 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