This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CCS/TMS320F28377S:s

Guru**** 2484615 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/610131/ccs-tms320f28377s-s

器件型号:TMS320F28377S

工具/软件:Code Composer Studio

您好!

我对 LAUNCHXL-F28377S 和 CCS IDE 比较陌生。我一直在运行代码中出现未定义符号错误的问题、我在使用 UART 和 SPI 在线写入 SD 卡时发现:

未定义的首次引用
符号
------ --------
_xQueueCreateMutexStatic ./UART.obj

错误#10234-D:未解析的符号仍然存在
错误#10010:链接期间遇到错误;"ADC_SoC_ePWM_cpu01.out"不存在

我已将代码附加到我的项目中。 我对未定义的符号在这里的方式感到困惑、因为 我在 xQueueGenericCreateStatic 中没有未定义的符号错误


///---------------------------------------------------------- //简化的 UART 驱动程序。 ///////----- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- #include "FreeRTOS.h" #include "UART.h" #include "semphr.h" //--------------- static SemaphoreHandle_t xTxMutex = NULL; static Semaphore_t xTxMutexBuffer; static SemaphoreHandle_t xRxSemaphore = NULL; static Staticaphore_t xRxSemaphoreBuffer; //----- void UART_open (void) { // Init OS 基元。 xRxSemaphore = xSemaphoreCreateBinaryStatic (&xRxSemaphoreBuffer); xTxMutex = xSemaphoreCreateMutexStatic (&xTxMutexBuffer); ...

声明在 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

最后、queue.h 包含在 semphr.h 中、其中定义了两个函数:

QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType、StaticQueue_t *pxStaticQueue ) privacy_function;

#if (configSUPPORT_static_allocation = 1)
ucueHandle_t xQueueGenericCreateStatic( const UBaseType_t uxQueueLength、const UBaseType_t uxItemSize、uint8_t * puQueueStorage、StaticQueue_t * pxStaticQueue、const uint8_t QueueType ) privated_function;
#endif

如果有人能指出我出错的地方、我会非常感激。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    请检查 API 是否是使用您启用的宏编译的条件。