用ctrl f搜索xsemaphorecreatemutex
搜到(semphr.h)
if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configUSE_MUTEXES == 1 ) )
#define xSemaphoreCreateMutex() xQueueCreateMutex( queueQUEUE_TYPE_MUTEX )
#endif
这里需要两个1
在(FreeRTOS.h)置1就可以了
#ifndef configSUPPORT_DYNAMIC_ALLOCATION
/* Defaults to 1 for backward compatibility. */
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#endif
#ifndef configUSE_MUTEXES
#define configUSE_MUTEXES 1
#endif