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

vTaskDelay freezes Task

Posted by brisco82 on June 7, 2012
Hi!

I'm a newbie with FreeRTOS and I can't make it work properly. I'm just trying to make an LED toggle every 200ms, but the Task "Task1" is executed only once. When I set a breakpoint within the infinite while loop, it is never reached again after the first time.
I have read a few topics on vTaskDelay problems, and therefore checked the tick interrupt. xTickCount in vTaskIncrementTick is incremented properly.
I'm using an UC3L064 on the UC3L0_xPlained board.

Thanks for any help!

Cheers, Tom

===========================

Here's my code:


int main (void)
{
board_init();
sysclk_init();

// USART setup here ....

// create task
xTaskCreate(vTask1,/* Pointer to the function that implements the task. */
"Task 1",/* Text name for the task. This is to facilitate debugging only. */
240,/* Stack depth in words. */
NULL,/* We are not using the task parameter. */
1,/* This task will run at priority 1. */
NULL );/* We are not using the task handle. */

/*
* Register the USART interrupt handler to the interrupt controller.
* usart_int_handler is the interrupt handler to register.
* EXAMPLE_USART_IRQ is the IRQ of the interrupt handler to register.
* AVR32_INTC_INT0 is the interrupt priority level to assign to the
* group of this IRQ.
*/

// Disable all interrupts.
Disable_global_interrupt();

// Initialize interrupt vectors.
INTC_init_interrupts();

INTC_register_interrupt(&usart_int_handler, AVR32_USART2_IRQ,
AVR32_INTC_INT0);

// Enable USART Rx interrupt.
USART->ier = AVR32_USART_IER_RXRDY_MASK;


// Enable all interrupts.
Enable_global_interrupt();


/* Start the scheduler so our tasks start executing. */
vTaskStartScheduler();

while(1){
}
} // main


void vTask1( void *pvParameters )
{
int rxData;
//volatile portTickType task1Tick;
/* As per most tasks, this task is implemented in an infinite loop. */
while(1)
{
//usart_write_line(USART, "Task1 executed!");
gpio_tgl_gpio_pin(LED_RED_PWMA);
vTaskDelay((portTickType)200 / portTICK_RATE_MS);
}
}



RE: vTaskDelay freezes Task

Posted by MEdwards on June 7, 2012
Did you get your FreeRTOS AVR32 code from FreeRTOS or Atmel? If not from Atmel, then take the code from the atmel software framework, where the code is updated and has some exmples. Search for software framework or ASF on atmel.com.


[ 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