cancel
Showing results for 
Search instead for 
Did you mean: 

How can I add a new task on FreeRTOS on STM32 ?

antonius
Senior
Posted on January 06, 2014 at 06:32

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 ?

Thanks
3 REPLIES 3
chen
Associate II
Posted on January 06, 2014 at 10:02

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.

antonius
Senior
Posted on January 06, 2014 at 11:03

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 )

chen
Associate II
Posted on January 06, 2014 at 11:30

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.