OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 5887|回复: 2

STM32F429+CubeMX+FreeRTOS+UART中断

[复制链接]

1

主题

2

帖子

0

精华

初级会员

Rank: 2

积分
50
金钱
50
注册时间
2014-11-4
在线时间
6 小时
发表于 2018-5-18 08:35:50 | 显示全部楼层 |阅读模式
5金钱
本帖最后由 friendly 于 2018-5-18 11:11 编辑

请教大佬,我在使用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



正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165536
金钱
165536
注册时间
2010-12-1
在线时间
2117 小时
发表于 2018-5-19 02:07:11 | 显示全部楼层
这种问题要学会自己解决!!
无非就是头文件路径没添加,或者对应.c没加进来,或者就是输入了错误的标点符号,导致整个文件报错。
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复

使用道具 举报

1

主题

23

帖子

0

精华

初级会员

Rank: 2

积分
155
金钱
155
注册时间
2019-1-21
在线时间
45 小时
发表于 2019-4-1 17:21:46 | 显示全部楼层
请问楼主解决这个问题了吗
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-6-10 04:01

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表