Skip to main content
Graduate
May 15, 2025
Question

FREERTOS: How to enable osThreadIsSuspended ?

  • May 15, 2025
  • 3 replies
  • 468 views

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!

 

 

    This topic has been closed for replies.

    3 replies

    ST Employee
    May 15, 2025

    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.

     

    ak52Author
    Graduate
    May 16, 2025

    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 ? 

     

    ST Employee
    May 16, 2025

    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 

     

    ak52Author
    Graduate
    May 16, 2025

    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