cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 6 MCU

Contributor

Hi,

i try to setup a FreeRTOS based project at CYBLE-416045-02 module. Right now, I have enabled FreeRTOS support and I'am able to create and run some Tasks. My next step is to create a Mutex!

1. To get this project to work, I have to include the following header files:

     #include "FreeRTOS.h" 

     #include "task.h"

     #include "semphr.h"

     Cypress, PSoC 6 101: Lesson 1-4 PSoC Creator FreeRTOS - YouTube  [4:50]

     But why Alan Hawse says: "Notice that we didn't have to include any FreeRTOS header..."??? This statement is confusing for me. Mayby my issue is based in this point!

2. I try to create a semaphore:

     SemaphoreHandle_t xSemaphore;

     xSemaphore =  xSemaphoreCreateMutex();

     The PSoC Creator says, "Undefined reference to xQueueCreateMutex".

     But I can go to the definition of "xQueueCreateMutex" in "semphr.h":

     #if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )

          #define xSemaphoreCreateMutex() xQueueCreateMutex( queueQUEUE_TYPE_MUTEX )

     #endif

     So the "xQueueCreateMutex" function should be included, if configSUPPORT_DYNAMIC_ALLOCATION  = 1!

     When I go into the FreeRTOSConfig.h I can see:

     #define configSUPPORT_DYNAMIC_ALLOCATION        1

     So why isn't the "semphr.h" not combined to the FreeRTOSConfig.h? Refer to Point 1, maybe I have forgotten something....otherwise "xQueueCreateMutex" should be defined.

Cheers!

0 Likes
Reply
1 Solution
Contributor

I had to set

#define configUSE_MUTEXES                       1

in FreeRTOS.h file!

View solution in original post

0 Likes
Reply
1 Reply
Contributor

I had to set

#define configUSE_MUTEXES                       1

in FreeRTOS.h file!

View solution in original post

0 Likes
Reply
Top labels