Quality RTOS & Embedded Software

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


Loading

vtaskDelayUntil + ride GCC + str710

Posted by Nobody/Anonymous on February 27, 2006
we created a GCC STR71X port from combining the STR71X IAR port and the LPC2000 GCC port.
optimization : -o1 + debug -g

I just notice after several executions that :
- the tasksuspend & taskresume is working well
- fifo is working well
- semaphore is working well
- vTaskDelayUntil is not working well
and I'm wondering that what is working is when there is taskYield : switch context with software interrupt and vTaskDelayUntil is working good when we are stopping the task because it's switching context with taskYield and when we are reputting the task when the tick is good (in wdg interrupt) something wrong is happening. So I have pb with switching context with the wdg timer which is in IRQ mode.
- TaskYield OK : it's in supervisor mode
- WDG timer not OK : it's in IRQ mode
I just found an idea to see if it is from this:
the taskyield is calling SWI interrupt which is in supervisor mode and in this case everything is working well and the timerWDG is in IRQ mode and not in supervisor mode so in vPortPreemptiveTick (function called in WDG), I'm doing a SWI interrupt and I added in vPortYiledProcessor the vTAskIncrement just to try if it will work and in this case the vTaskDelayUntil is working and the tasks are switching normally.

So I don't understand for the port for IAR/STR710 : is it good or no for the WDG Timer because we are not in supervisor mode in this case?
Which changes must I do for the WDG timer to be in supervisor mode.

Thanks

RE: vtaskDelayUntil + ride GCC + str710

Posted by Nobody/Anonymous on February 27, 2006
Don't fully understand what you are saying but IRQ mode is fine for an context switch. You do not need to be in supervisor mode.

Are you sure you have declared your swi handler correctly - using the naked attribute as well as the swi attribute. Have you remembered to add 4 to the return address in thw swi handler?

asm volatile ( "ADDLR, LR, #4" );

RE: vtaskDelayUntil + ride GCC + str710

Posted by Nobody/Anonymous on February 27, 2006
In the SWI handler everything is working well :
it's a __attribute__((interrupt("SWI"),naked)); + there is asm volatile ( "ADD LR, LR, #4" );

code :
void vPortYieldProcessor( void ) __attribute__((interrupt("SWI"), naked));
void vPortYieldProcessor( void )
{
asm volatile ( "ADDLR, LR, #4" );
portSAVE_CONTEXT();
vTaskSwitchContext();
portRESTORE_CONTEXT();
}


The pb is in WDG interrupt : this interrupt is not working well for the context switch and when in vPortPreemptiveTick I'm doing asm volatile ("SWI 1"); instead of everything else, the vTaskDelayUntil is working well that's why I was asking if in IRQ mode the context switch is working.


code not working:
void vPortPreemptiveTick( void ) __attribute__((naked));
void vPortPreemptiveTick( void )
{
portSAVE_CONTEXT();
vTaskIncrementTick();
vTaskSwitchContext();
WDG->SR = 0x0000;
portCLEAR_EIC();
portRESTORE_CONTEXT();
}

code working:
void vPortPreemptiveTick( void ) __attribute__((naked));
void vPortPreemptiveTick( void )
{
asm volatile ( "SWI 1" );
}

I don't understand why the WDG irq is not good switchng context?

RE: vtaskDelayUntil + ride GCC + str710

Posted by Nobody/Anonymous on February 27, 2006
Interesting, it looks ok. You have configUSE_PREEMPTION set to true?

RE: vtaskDelayUntil + ride GCC + str710

Posted by Nobody/Anonymous on February 27, 2006
configUSE_PREEMPTION 1

RE: vtaskDelayUntil + ride GCC + str710

Posted by Nobody/Anonymous on March 21, 2006
configUSE_PREEMPTION 1


[ 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