- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had to set
#define configUSE_MUTEXES 1
in FreeRTOS.h file!