Problem with SWI
Posted by Kristian Dilov
on May 9, 2009
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:
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*/
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.
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.