rousea wrote on Tuesday, March 02, 2010:
I am developing a project on an STM32 ARM Cortex processor, using FreeRTOS. My main.c module includes the following:
const u8 PortNo = {1, 2, 3};
.
.
int main(void){
.
.
xTaskCreate(vUSARTtask, “USARTtask”, 1000, (void*)&PortNo, tskIDLE_PRIORITY + 4, NULL);
xTaskCreate(vUSARTtask, “USARTtask”, 1000, (void*)&PortNo, tskIDLE_PRIORITY + 4, NULL);
xTaskCreate(vUSARTtask, “USARTtask”, 1000, (void*)&PortNo, tskIDLE_PRIORITY + 4, NULL);
.
.
vTaskStartScheduler();
.
.
and function vUSARTtask contains:
void vUSARTtask(void* pvParameters){
u8 Port;
.
.
Port = *(u8*)pvParameters;
switch(Port){
.
.
I have inserted a break point at switch(Port) where I can examine the value of Port. The function should be called 3 times, with Port = 1, 2 & 3 respectively. However, it is only called twice, with Port = 1 & 2.
If I chage the order of the xTaskCreate() lines it is apparent that only the first two instances are invoked and the third is always ignored. I can even chage the sequence of other xTaskCreate() line before and after those in question, and always only the first two instances of vUSARTtask are invoked.
Does this mean there is a limit of 2 on the number of instances of a given tasks? Or am I missing something?
Alan Rouse