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




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 ]    [ 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