首页 > 编程知识 正文

stm32 freertos怎么用,stm32cubemx freertos使用教程

时间:2023-05-05 02:34:18 阅读:285990 作者:1899

在STM32CubeIDE中配置FreeRTOS中间层时需要选择interface,其中有三个选项:Disable、CMSIS_V1和CMSIS_V2,在之前的学习过程中我只移植过FreeRTOS的源码,并没用使用过CMSIS-RTOS接口,因此我在网上搜集了资料,凭借自己的理解再次记录。

CubeIDE FreeRTOS配置界面

CMSIS

ARM官方定义:

English:
The CMSIS is a vendor-independent hardware abstraction layer for microcontrollers that are based on Arm® Cortex® processors. The CMSIS defines generic tool interfaces and enables consistent device support. It provides simple software interfaces to the processor and the peripherals, simplifying software re-use, reducing the learning curve for microcontroller developers, and reducing the time to market for new devices.
The CMSIS is defined in close cooperation with various silicon and software vendors and provides a common approach to interface to peripherals, real-time operating systems, and middleware components. The CMSIS is intended to enable the combination of software components from multiple middleware vendors.
中文:
Cortex微控制器软件接口标准(CMSIS)是独立于供应商的硬件抽象层,用于基于Arm Cortex处理器的微控制器。 CMSIS定义了通用工具接口,并提供一致的设备支持。 CMSIS软件接口简化了软件重用,减少了微控制器开发人员的学习时间,并缩短了新设备的上市时间。
CMSIS提供了到处理器和外围设备,实时操作系统以及中间件组件的接赛车每天赚1000的方法p> CMSIS

ARM官方定义:

English:
The CMSIS is a vendor-independent hardware abstraction layer for microcontrollers that are based on Arm® Cortex® processors. The CMSIS defines generic tool interfaces and enables consistent device support. It provides simple software interfaces to the processor and the peripherals, simplifying software re-use, reducing the learning curve for microcontroller developers, and reducing the time to market for new devices.
The CMSIS is defined in close cooperation with various silicon and software vendors and provides a common approach to interface to peripherals, real-time operating systems, and middleware components. The CMSIS is intended to enable the combination of software components from multiple middleware vendors.
中文:
Cortex微控制器软件接口标准(CMSIS)是独立于供应商的硬件抽象层,用于基于Arm Cortex处理器的微控制器。 CMSIS定义了通用工具接口,并提供一致的设备支持。 CMSIS软件接口简化了软件重用,减少了微控制器开发人员的学习时间,并缩短了新设备的上市时间。
CMSIS提供了到处理器和外围设备,实时操作系统以及中间件组件的接口。 CMSIS包括用于设备,板卡和软件的交付机制,并允许来自多个供应商的软件组件的组合。

从ARM官方提供的说明可以看出,CMSIS是一种接口标准,目的是屏蔽软硬件差异以提高软件的兼容性。

在ARM提供的部件列表中我们可以看到RTOS v1以及RTOS v2两个有关RTOS的部件。

RTOS v1:
Common API for real-time operating systems along with a reference implementation based on RTX. It enables software components that can work across multiple RTOS systems.
RTOS v2
Extends CMSIS-RTOS v1 with Armv8-M support, dynamic object creation, provisions for multi-core systems, binary compatible interface.

其描述已经很清楚:RTOS v1使得软件能够在不同的实时操作系统下运行(屏蔽不同RTOS提供的API的差别),而RTOS v2则是拓展了RTOS v1,兼容更多的CPU架构和实时操作系统。

因此我们在使用时可以根据实际情况选择,如果学习过程中使用STM32F1、F4等单片机时没必要选择RTOS v2,更高的兼容性背后时更加冗余的代码,理解起来比较困难;如果选择Disable则使用RTOS厂商提供的API,CubeIDE将不会提供图形化配置服务。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。