2014-01-05 09:32 PM
Guys,
How can I add a new task on FreeRTOS on STM32 ? I have created : [CODE] #define LCD_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE ) #define LCD_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) #define LCD_RTC_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE ) #define LCD_RTC_TASK_PRIORITY ( tskIDLE_PRIORITY +0 ) xTaskCreate( vLCDTask , ( signed char * ) NULL , LCD_TASK_STACK_SIZE , NULL , LCD_TASK_PRIORITY , NULL ); xTaskCreate( vRTC_LCDTask , ( signed char * ) NULL , LCD_RTC_TASK_STACK_SIZE , NULL , LCD_RTC_TASK_PRIORITY , NULL ); [/CODE]but it's stopping on vRTC_LCDTask....any ideas, is it because of the priority ? Thanks2014-01-06 01:02 AM
Hi
Idle has the lowest priority. You should not have another task at that same priority. Saying that, that should not be the reason it has stopped. It is probably something in that task/code.2014-01-06 02:03 AM
what should I do then if I have two tasks ? how can I set the task priority ?
any examples ? I wrote : #define LCD_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) #define LCD_RTC_TASK_PRIORITY ( tskIDLE_PRIORITY +0 )2014-01-06 02:30 AM
Hi
Read the documentation! Read the FreeRTOS code! In actual fact - you can use integers for the task priority - upto the max task priority which is set in the FreeRTOSConfig.h (or some filename like that) Also, check in the same file whether task model is co-operative or pre-emptive. Co-operative might be your problem if your tasks are not yeilding. I suggest you try the simple example which increments in 1 task and displays count in another task and play with the options in the config file.