miklpolikov wrote on Monday, November 18, 2013:
Good day everybody !
I am starting to use FreeRTOS. My configuration : CPU STM32L151, compiler KEIL, using heap_2
I have meat the problem : 1 or 2 tasks are work well, but three and more are not. After execute vTaskStartScheduler(); program get in while(1){} in the wery end of main{}.
What am I do wrong ?
And the other question, where to find file errors.h with error codes that xTaskCreate( ) return ?
I have find some file error.h in folder freertos, but there is no erroe with code 1 or -1 that I see.
I’m sorry, but I do not know why some lines are in so large font.
Thanks in advance!
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 16000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 2 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 17*128) )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
void Task1 (void *pvParameters)
{
char x;
while(1)
{
x++;
}
}
void Task2 (void *pvParameters)
{
char x;
while(1)
{
x++;
}
}
void Task3 (void *pvParameters)
{
char x;
while(1)
{
x++;
}
}
void Task4 (void *pvParameters)
{
char x;
while(1)
{
x++;
}
}
void main()
{
xTaskCreate(Task1,(signed char*)“Task1”,configMINIMAL_STACK_SIZE,NULL,tskIDLE_PRIORITY + 1,NULL);
xTaskCreate(Task2,(signed char*)“Task2”,configMINIMAL_STACK_SIZE,NULL,tskIDLE_PRIORITY + 1,NULL);
xTaskCreate(Task3,(signed char*)“Task3”,configMINIMAL_STACK_SIZE,NULL,tskIDLE_PRIORITY + 1,NULL);
xTaskCreate(Task4,(signed char*)“Task4”, onfigMINIMAL_STACK_SIZE,NULL,tskIDLE_PRIORITY + 1,NULL);
vTaskStartScheduler();
while(1){}
}