STM32CubeMX+FreeRTOS+UART中断
本帖最后由 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
把工程传上来看看
看上去是少头文件包含 和符号缺少 的问题 与龙共舞 发表于 2018-5-18 09:14
把工程传上来看看
看上去是少头文件包含 和符号缺少 的问题
这里提示错的,都是queue.h,list.h,task.h等里面的,我只是含了头文件。 看看是不是声明没有标明存储类型说明
页:
[1]