Part Number: TMS320F28377S
Tool/software: Code Composer Studio
Hello,
I am relatively new to the LAUNCHXL-F28377S and CCS IDE. I have been running across the issue of an undefined symbol error in code I have found online for writing to a SD card with UART and SPI:
undefined first referenced
symbol in file
--------- ----------------
_xQueueCreateMutexStatic ./uart.obj
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "adc_soc_epwm_cpu01.out" not
I have attached the code in my project. I am confused on how the undefined symbol is here as I get no undefined symbol error with xQueueGenericCreateStatic
//------------------------------------------------------------------------------------------------- // Simplified UART driver. // //------------------------------------------------------------------------------------------------- #include "FreeRTOS.h" #include "uart.h" #include "semphr.h" //------------------------------------------------------------------------------------------------- static SemaphoreHandle_t xTxMutex = NULL; static StaticSemaphore_t xTxMutexBuffer; static SemaphoreHandle_t xRxSemaphore = NULL; static StaticSemaphore_t xRxSemaphoreBuffer; //------------------------------------------------------------------------------------------------- void UART_open(void) { // Init OS primitives. xRxSemaphore = xSemaphoreCreateBinaryStatic(&xRxSemaphoreBuffer); xTxMutex = xSemaphoreCreateMutexStatic(&xTxMutexBuffer); ...
The declarations are as followed in semaphr.h:
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
#define xSemaphoreCreateBinaryStatic( pxStaticSemaphore ) xQueueGenericCreateStatic( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, NULL, pxStaticSemaphore, queueQUEUE_TYPE_BINARY_SEMAPHORE )
#endif
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
#define xSemaphoreCreateMutexStatic( pxMutexBuffer ) xQueueCreateMutexStatic( queueQUEUE_TYPE_MUTEX, ( pxMutexBuffer ) )
#endif
Finally, queue.h is included within semphr.h where both functions are defined:
QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType, StaticQueue_t *pxStaticQueue ) PRIVILEGED_FUNCTION;
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
QueueHandle_t xQueueGenericCreateStatic( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, uint8_t *pucQueueStorage, StaticQueue_t *pxStaticQueue, const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
#endif
If anyone could point out where I am going wrong, I would greatly appreciate it.