cancel
Showing results for 
Search instead for 
Did you mean: 

FREERTOS: How to enable osThreadIsSuspended ?

ak52
Associate III

Hello Experts,

I see that in cmsis_oc.c that the function osThreadIsSuspended is disabled. The variable INCLUDE_eTaskGetState is responsible for it.

ak52_0-1747306935740.png

But how do we enable INCLUDE_eTaskGetState to 1 by default?

I see in FreeRTOS.h header than the macro is set to 0.

ak52_1-1747307040166.png

 

Can i just force it to 1 in FreeRTOS.h? or do we need to enable any particular config parameters in the .ioc file ?

Kindly Help!

 

 

4 REPLIES 4
Guillaume K
ST Employee

You should define INCLUDE_eTaskGetState in project file FreeRTOSConfig.h

 

Note that cmsis_os.c is CMSIS RTOS V1 and it would be better to use cmsis_os2.c for CMSIS RTOS V2.

 

Thanks for your reply, I used CMSIS RTOS v1 as i am following along some FreeRTOS tutorials which also use the same v1.

I defined the macro in FreeRTOSConfig.h like this:

ak52_1-1747369026086.png

But, i get a bunch of errors related to the osThreadGetState function:

ak52_0-1747368902308.png

Any suggestions ? 

 

Guillaume K
ST Employee

it works for me.

osThreadSuspended is defined in cmsis_os.h if INCLUDE_eTaskGetState is set to 1

check that INCLUDE_eTaskGetState is really defined to 1 in cmsis_os.h 

 

ak52
Associate III

In cmsis_os.h,  I still see INCLUDE_eTaskGetState "grayed out", even though i have it defined in FreeRTOSConfig.h  :( , I am not sure why!

ak52_0-1747402057664.png