Quality RTOS & Embedded Software

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


Loading

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!
janiex.

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.

Regards.


[ 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