你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

STM32CubeMX+FreeRTOS+UART中断

[复制链接]
bobo-347318 提问时间:2018-5-18 08:17 /
本帖最后由 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

收藏 评论3 发布时间:2018-5-18 08:17

举报

3个回答
GKoSon 回答时间:2018-5-18 09:14:33
把工程传上来看看
看上去是少头文件包含 和符号缺少 的问题

评分

参与人数 1蝴蝶豆 +2 收起 理由
zero99 + 2

查看全部评分

bobo-347318 回答时间:2018-5-18 09:57:44
与龙共舞 发表于 2018-5-18 09:14
把工程传上来看看
看上去是少头文件包含 和符号缺少 的问题

这里提示错的,都是queue.h,list.h,task.h等里面的,我只是含了头文件。
feixiang20 回答时间:2018-5-19 02:04:49
看看是不是声明没有标明存储类型说明

评分

参与人数 1蝴蝶豆 +2 收起 理由
zero99 + 2

查看全部评分

所属标签

相似问题

官网相关资源

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32Cube扩展软件包
意法半导体边缘AI套件
ST - 理想汽车豪华SUV案例
ST意法半导体智能家居案例
STM32 ARM Cortex 32位微控制器
关注我们
st-img 微信公众号
st-img 手机版