FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [December 2011 Threads]
“Any suggestions?”
Yes - tell us which chip and compiler you are using.
Omg ... bad job from my side to forget it.
I use MCF52259 (on MCF52259EVB) from Freescale. IDE CW 10.1, I use the included Coldfire-Compiler there.
The code I use is the following:
#define Queue_Active 0
unsigned int counter;
unsigned int counter_T2;
xQueueHandle xQueue1;
static portTASK_FUNCTION(vMainTask, pvParameters) {
const portTickType xDelay = 2/portTICK_RATE_MS;
portTickType xActual = 0;
#if Queue_Active
counter = 0;
xQueue1 = xQueueCreate(4, sizeof(unsigned int));
if(xQueueSend(xQueue1,&counter,10) != pdPASS ){
portNOP();
}
#endif
for(;;){
xActual = xTaskGetTickCount();
vTaskDelayUntil(&xActual,xDelay);
#if Queue_Active
portENTER_CRITICAL();
#endif
Bit1_NegVal();
#if Queue_Active
xQueueReceive(xQueue1,&counter,1);
counter++;
xQueueSend(xQueue1,&counter,1);
counter = 0;
portEXIT_CRITICAL();
#endif
}
}
static portTASK_FUNCTION(vMainTask2, pvParameters) {
const portTickType xDelay = 2/portTICK_RATE_MS;
for(;;){
vTaskDelay(xDelay);
#if Queue_Active
portENTER_CRITICAL();
#endif
Bit2_NegVal();
#if Queue_Active
xQueueReceive(xQueue1,&counter_T2,1);
counter_T2++;
xQueueSend(xQueue1,&counter_T2,1);
counter_T2 = 0;
portEXIT_CRITICAL();
#endif
}
}
static portTASK_FUNCTION(vMainTask3, pvParameters) {
const portTickType xDelay = 10/portTICK_RATE_MS;
for(;;){
vTaskDelay(xDelay);
Bit3_NegVal();
}
}
I already tried to increase stack ov all and of certain tasks (from standard 600 to 2.4k) but without success.
Thx!
Best regards
Patrick
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.