本帖最后由 bobo-347318 于 2018-5-18 10:04 编辑 请教大佬,我在使用CubeMX软件,使能了GPIO,UART,FreeRTOS。创建了两个任务,一个串口中断,一个队列。程序功能是:串口中断调用接收回调函数接收数据,接收完成后,向队列发送数据指针,在其中一个任务中读取队列内容并打印。因为在自动生成的UART.C文件中创建了串口接收回调函数,并使用到队列,所以要在UART.C文件中包含进相关头文件,现在只要包含进CMSIS_OS.H或FreeRTOS.H和QUEUE.H头文件,在UART.C文件还没有调用队列发送函数,在编译时都会产生错误。错误如下: compiling freertos.c... ../Middlewares/Third_Party/FreeRTOS/Source/include/list.h(184): error: #20: identifier "TickType_t" is undefined configLIST_VOLATILE TickType_t xItemValue; /*< The value being listed. In most cases this is used to sort the list in descending order. */ ../Middlewares/Third_Party/FreeRTOS/Source/include/list.h(196): error: #20: identifier "TickType_t" is undefined configLIST_VOLATILE TickType_t xItemValue; ../Middlewares/Third_Party/FreeRTOS/Source/include/list.h(208): error: #20: identifier "UBaseType_t" is undefined configLIST_VOLATILE UBaseType_t uxNumberOfItems; ../Middlewares/Third_Party/FreeRTOS/Source/include/list.h(386): error: #77-D: this declaration has no storage class or type specifier PRIVILEGED_FUNCTION void vListInitialise( List_t * const pxList ); ../Middlewares/Third_Party/FreeRTOS/Source/include/list.h(386): error: #65: expected a ";" PRIVILEGED_FUNCTION void vListInitialise( List_t * const pxList ); ../Middlewares/Third_Party/FreeRTOS/Source/include/list.h(397): error: #77-D: this declaration has no storage class or type specifier PRIVILEGED_FUNCTION void vListInitialiseItem( ListItem_t * const pxItem ); ../Middlewares/Third_Party/FreeRTOS/Source/include/list.h(397): error: #65: expected a ";" PRIVILEGED_FUNCTION void vListInitialiseItem( ListItem_t * const pxItem ); ../Middlewares/Third_Party/FreeRTOS/Source/include/list.h(410): error: #77-D: this declaration has no storage class or type specifier PRIVILEGED_FUNCTION void vListInsert( List_t * const pxList, ListItem_t * const pxNewListItem ); ../Middlewares/Third_Party/FreeRTOS/Source/include/list.h(410): error: #65: expected a ";" PRIVILEGED_FUNCTION void vListInsert( List_t * const pxList, ListItem_t * const pxNewListItem ); ../Middlewares/Third_Party/FreeRTOS/Source/include/list.h(431): error: #77-D: this declaration has no storage class or type specifier PRIVILEGED_FUNCTION void vListInsertEnd( List_t * const pxList, ListItem_t * const pxNewListItem ); ../Middlewares/Third_Party/FreeRTOS/Source/include/list.h(431): error: #65: expected a ";" PRIVILEGED_FUNCTION void vListInsertEnd( List_t * const pxList, ListItem_t * const pxNewListItem ); ../Middlewares/Third_Party/FreeRTOS/Source/include/list.h(446): error: #757: variable "PRIVILEGED_FUNCTION" is not a type name PRIVILEGED_FUNCTION UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ); ../Middlewares/Third_Party/FreeRTOS/Source/include/list.h(446): error: #65: expected a ";" PRIVILEGED_FUNCTION UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ); ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(109): error: #79: expected a type specifier typedef BaseType_t (*TaskHookFunction_t)( void * ); ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(109): error: #90: function returning function is not allowed typedef BaseType_t (*TaskHookFunction_t)( void * ); ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(137): error: #168: a function type is not allowed here BaseType_t xOverflowCount; ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(138): error: #20: identifier "TickType_t" is undefined TickType_t xTimeOnEntering; ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(156): error: #20: identifier "TaskFunction_t" is undefined TaskFunction_t pvTaskCode; ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(160): error: #757: variable "UBaseType_t" is not a type name UBaseType_t uxPriority; ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(161): error: #20: identifier "StackType_t" is undefined StackType_t *puxStackBuffer; ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(162): error: #20: identifier "portNUM_CONFIGURABLE_REGIONS" is undefined MemoryRegion_t xRegions[ portNUM_CONFIGURABLE_REGIONS ]; ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(171): error: #757: variable "UBaseType_t" is not a type name UBaseType_t xTaskNumber; /* A number unique to the task. */ ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(173): error: #757: variable "UBaseType_t" is not a type name UBaseType_t uxCurrentPriority; /* The priority at which the task was running (may be inherited) when the structure was populated. */ ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(174): error: #757: variable "UBaseType_t" is not a type name UBaseType_t uxBasePriority; /* The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */ ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(176): error: #20: identifier "StackType_t" is undefined StackType_t *pxStackBase; /* Points to the lowest address of the task's stack area. */ ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(602): error: #77-D: this declaration has no storage class or type specifier PRIVILEGED_FUNCTION void vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions ); ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(602): error: #65: expected a ";" PRIVILEGED_FUNCTION void vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions ); ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(643): error: #77-D: this declaration has no storage class or type specifier PRIVILEGED_FUNCTION void vTaskDelete( TaskHandle_t xTaskToDelete ); ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(643): error: #65: expected a ";" PRIVILEGED_FUNCTION void vTaskDelete( TaskHandle_t xTaskToDelete ); ../Middlewares/Third_Party/FreeRTOS/Source/include/task.h(695): error: #77-D: this declaration has no storage class or type specifier PRIVILEGED_FUNCTION void vTaskDelay( const TickType_t xTicksToDelay ); ../Src/freertos.c: 0 warnings, 30 errors |
HMI_QUEUE_UART.zip
下载1012.77 KB, 下载次数: 35, 下载积分: ST金币 -1
STM32CubeMX重新生成代码后对上次工程配置的影响?
STM32CubeMX MCU执行到SystemClock_Config时钟初始化死锁
关于STM32CubeMX配置的USB例程电脑无法识别问题
STM32CubeMX 5.4 TouchGFX
STM32CubeMX与STM32CubeIDE的区别
STM32CubeMX 在哪有下载的??
如何在STM32CubeMX配置中更改LwIP的版本?
STM32CubeMX 如何卸载
关于STM32ETH ETH 使用STM32CubeMX配置不成功
STM32CubeMX无法获取(如图),什么情况
看上去是少头文件包含 和符号缺少 的问题
评分
查看全部评分
这里提示错的,都是queue.h,list.h,task.h等里面的,我只是含了头文件。
评分
查看全部评分