update readme
Signed-off-by: Cathy Li <liyan@rt-thread.com>
This commit is contained in:
parent
9d9432eb93
commit
632c86ca07
177
README.md
177
README.md
|
@ -1,84 +1,153 @@
|
||||||
# RT-Thread #
|
|
||||||
|
|
||||||
[中文页](README_zh.md) |
|
|
||||||
|
|
||||||
[![GitHub](https://img.shields.io/github/license/RT-Thread/rt-thread.svg)](https://github.com/RT-Thread/rt-thread/blob/master/LICENSE)
|
# Introduction
|
||||||
[![GitHub release](https://img.shields.io/github/release/RT-Thread/rt-thread.svg)](https://github.com/RT-Thread/rt-thread/releases)
|
|
||||||
[![Build Status](https://travis-ci.org/RT-Thread/rt-thread.svg)](https://travis-ci.org/RT-Thread/rt-thread)
|
|
||||||
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/RT-Thread/rt-thread?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
||||||
[![GitHub pull-requests](https://img.shields.io/github/issues-pr/RT-Thread/rt-thread.svg)](https://github.com/RT-Thread/rt-thread/pulls)
|
|
||||||
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](https://github.com/RT-Thread/rt-thread/pulls)
|
|
||||||
|
|
||||||
RT-Thread is an open source IoT operating system from China, which has strong scalability: from a tiny kernel running on a tiny core, for example ARM Cortex-M0, or Cortex-M3/4/7, to a rich feature system running on MIPS32, ARM Cortex-A8, ARM Cortex-A9 DualCore etc.
|
RT-Thread was born in 2006, it is an open source, neutral, and community-based real-time operating system (RTOS).
|
||||||
|
|
||||||
## Overview ##
|
RT-Thread is mainly written in C language, easy to understand and easy to port(can be quickly port to a wide range of mainstream MCUs and module chips). It applies object-oriented programming methods to real-time system design, making the code elegant, structured, modular, and very tailorable.
|
||||||
|
|
||||||
RT-Thread RTOS like a traditional real-time operating system. The kernel has real-time multi-task scheduling, semaphore, mutex, mail box, message queue, signal etc. However, it has three different things:
|
|
||||||
|
|
||||||
* Device Driver;
|
RT-Thread has Standard version and Nano version. For resource-constrained microcontroller (MCU) systems, the NANO kernel version that requires only 3KB Flash and 1.2KB RAM memory resources can be tailored with easy-to-use tools; And for resource-rich IoT devices, RT-Thread can use the on-line software package management tool, together with system configuration tools, to achieve intuitive and rapid modular cutting, seamlessly import rich software packages, thus achieving complex functions like Android's graphical interface and touch sliding effects, smart voice interaction effects, and so on.
|
||||||
* Component;
|
|
||||||
* Dynamic Module
|
|
||||||
|
|
||||||
The device driver is more like a driver framework, UART, IIC, SPI, SDIO, USB device/host, EMAC, MTD NAND etc. The developer can easily add low level driver and board configuration, then combined with the upper framework, he/she can use lots of features.
|
|
||||||
|
|
||||||
The Component is a software concept upon RT-Thread kernel, for example a shell (finsh/msh shell), virtual file system (FAT, YAFFS, UFFS, ROM/RAM file system etc), TCP/IP protocol stack (lwIP), POSIX (thread) interface etc. One component must be a directory under RT-Thread/Components and one component can be descripted by a SConscript file (then be compiled and linked into the system).
|
## RT-Thread Architecture
|
||||||
|
|
||||||
The Dynamic Module, formerly named as User Applicaion (UA) is a dynamic loaded module or library, it can be compiled standalone without Kernel. Each Dynamic Module has its own object list to manage thread/semaphore/kernel object which was created or initialized inside this UA. More information about UA, please visit another [git repo](https://github.com/RT-Thread/rtthread-apps).
|
RT-Thread has not only a real-time kernel, but also rich components. Its architecture is as follows:
|
||||||
|
|
||||||
## Board Support Package ##
|
|
||||||
|
|
||||||
RT-Thread RTOS can support many architectures:
|
![architecture](./documentation/figures/architecture.png)
|
||||||
|
|
||||||
* ARM Cortex-M0
|
|
||||||
* ARM Cortex-M3/M4/7
|
|
||||||
* ARM Cortex-R4
|
|
||||||
* ARM Cortex-A8/A9
|
|
||||||
* ARM920T/ARM926 etc
|
|
||||||
* MIPS32
|
|
||||||
* x86
|
|
||||||
* Andes
|
|
||||||
* C-Sky
|
|
||||||
* RISC-V
|
|
||||||
* PowerPC
|
|
||||||
|
|
||||||
## License ##
|
|
||||||
|
|
||||||
RT-Thread is Open Source software under the Apache License 2.0 since RT-Thread v3.1.1. License and copyright information can be found within the code.
|
It includes:
|
||||||
|
|
||||||
/*
|
- Kernel layer: RT-Thread kernel, the core part of RT-Thread, includes the implementation of objects in the kernel system, such as multi-threading and its scheduling, semaphore, mailbox, message queue, memory management, timer, etc.; libcpu/BSP (Chip Migration Related Files/Board Support Package) is closely related to hardware and consists of peripheral drivers and CPU porting.
|
||||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
Since 9th of September 2018, PRs submitted by the community may be merged into the main line only after signing the Contributor License Agreement(CLA).
|
- Components and Service Layer: Components are based on upper-level software on top of the RT-Thread kernel, such as virtual file systems, FinSH command-line interfaces, network frameworks, device frameworks, and more. Its modular design allows for high internal cohesion inside the components and low coupling between components.
|
||||||
|
|
||||||
## Usage ##
|
- RT-Thread software package: A general-purpose software component running on the RT-Thread IoT operating system platform for different application areas, consisting of description information, source code or library files. RT-Thread provides an open package platform with officially available or developer-supplied packages that provide developers with a choice of reusable packages that are an important part of the RT-Thread ecosystem. The package ecosystem is critical to the choice of an operating system because these packages are highly reusable and modular, making it easy for application developers to build the system they want in the shortest amount of time. RT-Thread supports more than 180 software packages.
|
||||||
|
|
||||||
RT-Thread RTOS uses [scons](http://www.scons.org) as building system. Therefore, please install scons and Python 2.7 firstly.
|
## RT-Thread Features
|
||||||
So far, the RT-Thread scons building system support the command line compile or generate some IDE's project. There are some option varaibles in the scons building script (rtconfig.py):
|
|
||||||
|
|
||||||
* ```CROSS_TOOL``` the compiler which you want to use, gcc/keil/iar.
|
- Designed for resource-constrained devices, the minimum kernel requires only 1.2KB of RAM and 3 KB of Flash.
|
||||||
* ```EXEC_PATH``` the path of compiler.
|
|
||||||
|
|
||||||
In SConstruct file:
|
- Has rich components and a prosperous and fast growing package ecosystem.
|
||||||
|
|
||||||
```RTT_ROOT``` This variable is the root directory of RT-Thread RTOS. If you build the porting in the bsp directory, you can use the default setting. Also, you can set the root directory in ```RTT_ROOT``` environment variable and not modify SConstruct files.
|
- Elegant code style, easy to use, read and master.
|
||||||
|
|
||||||
When you set these variables correctly, you can use command:
|
- High Scalability. RT-Thread has high-quality scalable software architecture, loose coupling, modularity, is easy to tailor and expand.
|
||||||
|
|
||||||
scons
|
- Supports high-performance applications.
|
||||||
|
|
||||||
under BSP directory to simplely compile RT-Thread RTOS.
|
- Supports cross-platform and a wide range of chips.
|
||||||
|
|
||||||
If you want to generate the IDE's project file, you can use command:
|
## Code Catalogue
|
||||||
|
|
||||||
scons --target=mdk/mdk4/mdk5/iar/cb -s
|
RT-Thread source code catalog is shown as follow:
|
||||||
|
|
||||||
to generate the project file.
|
| Name | Description |
|
||||||
|
| ------------- | ------------------------------------------------------- |
|
||||||
|
| BSP | Board Support Package based on the porting of various development boards |
|
||||||
|
| components | RT-Thread's individual component codes, such as finsh, gui, etc., |
|
||||||
|
| documentation | Related documents, like coding regulation, etc., |
|
||||||
|
| examples | Related sample code |
|
||||||
|
| include | Head file of RT-Thread kernel |
|
||||||
|
| libcpu | Porting code for all types of chips. |
|
||||||
|
| src | The source file for the RT-Thread kernel. |
|
||||||
|
| tools | The script file for the RT-Thread command build tool. |
|
||||||
|
|
||||||
|
RT-Thread has now been ported for nearly 90 development boards, most BSPs support MDK, IAR development environment and GCC compiler, and have provided default MDK and IAR project, which allows users to add their own application code directly based on the project. Each BSP has a similar directory structure, and most BSPs provide a README.md file, which is a markdown-format file that contains the basic introduction of BSP, and introduces how to simply start using BSP.
|
||||||
|
|
||||||
|
Env is a development tool developed by RT-Thread which provides a build environment, graphical system configuration, and package management capabilities for project based on the RT-Thread operating system. Its built-in `menuconfig` provides an easy-to-use configuration tailoring tool. It can tailor the kernels, components and software packages freely, so that the system can be constructed by building blocks.
|
||||||
|
|
||||||
|
|
||||||
|
- [Download Env Tool](https://www.rt-thread.io/download.html?download=Env)
|
||||||
|
- [User manual of Env](https://github.com/RT-Thread/rtthread-manual-doc/blob/master/env/env.md)
|
||||||
|
|
||||||
|
# Resources
|
||||||
|
|
||||||
|
## Supported Architectures
|
||||||
|
|
||||||
|
RT-Thread supports many architectures,and has covered the major architectures in current applications. Architecture and chip manufacturer involved:
|
||||||
|
|
||||||
|
- **ARM Cortex-M0/M0+**:manufacturers like ST
|
||||||
|
- **ARM Cortex-M3**:manufacturers like ST、Winner Micro、MindMotion, ect.
|
||||||
|
- **ARM Cortex-M4**:manufacturers like ST、Nuvton、NXP、GigaDevice、Realtek、Ambiq Micro, ect.
|
||||||
|
- **ARM Cortex-M7**:manufacturers like ST、NXP
|
||||||
|
- **ARM Cortex-M23**:manufacturers like GigaDevice
|
||||||
|
- **ARM Cortex-R4**
|
||||||
|
- **ARM Cortex-A8/A9**:manufacturers like NXP
|
||||||
|
- **ARM7**:manufacturers like Samsung
|
||||||
|
- **ARM9**:manufacturers like Allwinner、Xilinx 、GOKE
|
||||||
|
- **ARM11**:manufacturers like Fullhan
|
||||||
|
- **MIPS32**:manufacturers like loongson、Ingenic
|
||||||
|
- **RISC-V**:manufacturers like Hifive、Kendryte
|
||||||
|
- **ARC**:manufacturers like SYNOPSYS
|
||||||
|
- **DSP**:manufacturers like TI
|
||||||
|
- **C-Sky**
|
||||||
|
- **x86**
|
||||||
|
|
||||||
|
## Supported IDE and Compiler
|
||||||
|
|
||||||
|
The main IDE/compilers supported by RT-Thread are:
|
||||||
|
|
||||||
|
- MDK KEIL
|
||||||
|
- IAR
|
||||||
|
- GCC
|
||||||
|
- RT-Thread Studio
|
||||||
|
|
||||||
|
Use Python-based [scons](http://www.scons.org/) for command-line builds.
|
||||||
|
|
||||||
|
RT-Thread Studio Demonstration:
|
||||||
|
|
||||||
|
![studio](./documentation/figures/studio.gif)
|
||||||
|
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
RT-Thread BSP can be compiled directly and downloaded to the corresponding development board for use. In addition, RT-Thread also provides qemu-vexpress-a9 BSP, which can be used without hardware platform. See the getting started guide below for details.
|
||||||
|
|
||||||
|
- [Getting Started of QEMU (Windows)](https://github.com/RT-Thread/rtthread-manual-doc/blob/master/documentation/quick_start_qemu/quick_start_qemu.md)
|
||||||
|
|
||||||
|
- [Getting Started of QEMU (Ubuntu)](https://github.com/RT-Thread/rtthread-manual-doc/blob/master/documentation/quick_start_qemu/quick_start_qemu_linux.md)
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
[RT-Thread Programming Guide](https://github.com/RT-Thread/rtthread-manual-doc) | [RT-Thread Supported Chips & Boards](https://www.rt-thread.io/board.html) |
|
||||||
|
[RT-Thread Software Package](https://github.com/RT-Thread/packages) | [RT-Thread Studio](https://www.rt-thread.io/studio.html)
|
||||||
|
|
||||||
|
## Sample
|
||||||
|
|
||||||
|
[Kernel Sample](https://github.com/RT-Thread-packages/kernel-sample) | [Device Sample Code](https://github.com/RT-Thread-packages/peripheral-sample) | [File System Sample Code](https://github.com/RT-Thread-packages/filesystem-sample ) | [Network Sample Code](https://github.com/RT-Thread-packages/network-sample ) |
|
||||||
|
|
||||||
|
[Based on the STM32L475 IoT Board SDK](https://github.com/RT-Thread/IoT_Board) | [Based on the W601 IoT Board SDK](https://github.com/RT-Thread/W601_IoT_Board)
|
||||||
|
|
||||||
|
# License
|
||||||
|
|
||||||
|
RT-Thread is an open source software and has been licensed under Apache License Version 2.0 since v3.1.1. License information and copyright information can generally be seen at the beginning of the code:
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
`\* Copyright (c) 2006-2018, RT-Thread Development Team`
|
||||||
|
|
||||||
|
`*`
|
||||||
|
|
||||||
|
`\* SPDX-License-Identifier: Apache-2.0`
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
To avoid possible future license conflicts, developers need to sign a Contributor License Agreement (CLA) when submitting PR to RT-Thread.
|
||||||
|
|
||||||
|
# Community
|
||||||
|
|
||||||
|
|
||||||
|
RT-Thread is very grateful for the support from all community developers, and if you have any ideas, suggestions or questions in the process of using RT-Thread, RT-Thread can be reached by the following means, and we are also updating RT-Thread in real time on these channels. At the same time, Any questions can be asked in the [issue section of rtthread-manual-doc](https://github.com/RT-Thread/rtthread-manual-doc/issues). By creating a new issue to describe your questions, community members will answer them.
|
||||||
|
|
||||||
|
[Website](https://www.rt-thread.io) | [Twitter](https://twitter.com/rt_thread) | [Youtube]( https://www.youtube.com/channel/UCdDHtIfSYPq4002r27ffqPw?view_as=subscriber) | [Gitter]( https://gitter.im/RT-Thread) | [Facebook](https://www.facebook.com/RT-Thread-IoT-OS-110395723808463/?modal=admin_todo_tour) | [Medium](https://medium.com/@rt_thread)
|
||||||
|
|
||||||
|
# Contribution
|
||||||
|
|
||||||
|
If you are interested in RT-Thread and want to join in the development of RT-Thread and become a code contributor,please refer to the [Code Contribution Guide](https://github.com/RT-Thread/rtthread-manual-doc/blob/master/documentation/contribution_guide/contribution_guide.md).
|
||||||
|
|
||||||
NOTE: RT-Thread scons building system will tailor the system according to your rtconfig.h configuration header file. For example, if you disable the lwIP in the rtconfig.h by commenting the ```#define RT_USING_LWIP```, the generated project file should have no lwIP related files.
|
|
||||||
|
|
||||||
## Contribution ##
|
|
||||||
|
|
||||||
Please refer the contributors in the github. Thank all of RT-Thread Developers.
|
|
||||||
|
|
213
README_zh.md
213
README_zh.md
|
@ -1,97 +1,178 @@
|
||||||
# RT-Thread #
|
## 简介
|
||||||
|
|
||||||
[![GitHub release](https://img.shields.io/github/release/RT-Thread/rt-thread.svg)](https://github.com/RT-Thread/rt-thread/releases)
|
RT-Thread诞生于2006年,是一款以开源、中立、社区化发展起来的物联网操作系统。
|
||||||
[![Build Status](https://travis-ci.org/RT-Thread/rt-thread.svg)](https://travis-ci.org/RT-Thread/rt-thread)
|
RT-Thread主要采用 C 语言编写,浅显易懂,且具有方便移植的特性(可快速移植到多种主流 MCU 及模组芯片上)。RT-Thread把面向对象的设计方法应用到实时系统设计中,使得代码风格优雅、架构清晰、系统模块化并且可裁剪性非常好。
|
||||||
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/RT-Thread/rt-thread?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
||||||
[![GitHub pull-requests](https://img.shields.io/github/issues-pr/RT-Thread/rt-thread.svg)](https://github.com/RT-Thread/rt-thread/pulls)
|
|
||||||
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](https://github.com/RT-Thread/rt-thread/pulls)
|
|
||||||
|
|
||||||
RT-Thread是一个来自中国的开源物联网操作系统,它提供了非常强的可伸缩能力:从一个可以运行在ARM Cortex-M0芯片上的极小内核,到中等的ARM Cortex-M3/4/7系统,甚至是运行于MIPS32、ARM Cortex-A系列处理器上功能丰富系统。
|
RT-Thread有完整版和Nano版,对于资源受限的微控制器(MCU)系统,可通过简单易用的工具,裁剪出仅需要 3KB Flash、1.2KB RAM 内存资源的 NANO 内核版本;而相对资源丰富的物联网设备,可使用RT-Thread完整版,通过在线的软件包管理工具,配合系统配置工具实现直观快速的模块化裁剪,并且可以无缝地导入丰富的软件功能包,实现类似 Android 的图形界面及触摸滑动效果、智能语音交互效果等复杂功能。
|
||||||
|
|
||||||
## 简介 ##
|
## **RT-Thread架构**
|
||||||
|
|
||||||
RT-Thread包含了一个自有的、传统的硬实时内核:可抢占的多任务实时调度器,信号量,互斥量,邮箱,消息队列,信号等。当然,它和传统的实时操作系统还存在着三种不同:
|
RT-Thread是一个集实时操作系统(RTOS)内核、中间件组件的物联网操作系统,架构如下:
|
||||||
|
|
||||||
* 设备驱动框架;
|
![architecturezh](./documentation/figures/architecturezh.png)
|
||||||
* 软件组件;
|
|
||||||
* 应用模块
|
|
||||||
|
|
||||||
设备驱动框架更类似一套驱动框架,涉及到UART,IIC,SPI,SDIO,USB从设备/主设备,EMAC,NAND闪存设备等。它会把这些设备驱动中的共性抽象/抽取出来,而驱动工程师只需要按照固定的模式实现少量的底层硬件操作及板级配置。通过这样的方式,让一个硬件外设更容易地对接到RT-Thread系统中,并获得RT-Thread平台上的完整软件栈功能。
|
|
||||||
|
|
||||||
软件组件是位于RT-Thread内核上的软件单元,例如命令行(finsh/msh shell),虚拟文件系统(FAT,YAFFS,UFFS,ROM/RAM文件系统等),TCP/IP网络协议栈(lwIP),Libc/POSIX标准层等。一般的,一个软件组件放置于一个目录下,例如RT-Thread/components目录下的文件夹,并且每个软件组件通过一个 SConscript文件来描述并被添加到RT-Thread的构建系统中。当系统配置中开启了这一软件组件时,这个组件将被编译并链接到最终的RT-Thread固件中。
|
|
||||||
|
|
||||||
注:随着RT-Thread 3.0中的包管理器开启,越来越多的软件组件将以package方式出现在RT-Thread平台中。而RT-Thread平台更多的是指:
|
- 内核层:RT-Thread内核,是 RT-Thread的核心部分,包括了内核系统中对象的实现,例如多线程及其调度、信号量、邮箱、消息队列、内存管理、定时器等;libcpu/BSP(芯片移植相关文件 / 板级支持包)与硬件密切相关,由外设驱动和 CPU 移植构成。
|
||||||
|
|
||||||
* RT-Thread内核;
|
- 组件与服务层:组件是基于 RT-Thread内核之上的上层软件,例如虚拟文件系统、FinSH命令行界面、网络框架、设备框架等。采用模块化设计,做到组件内部高内聚,组件之间低耦合。
|
||||||
* shell命令行;
|
|
||||||
* 虚拟文件系统;
|
|
||||||
* TCP/IP网络协议栈;
|
|
||||||
* 设备驱动框架;
|
|
||||||
* Libc/POSIX标准层。
|
|
||||||
|
|
||||||
更多的IoT软件包则以package方式被添加到RT-Thread系统中。
|
|
||||||
|
|
||||||
应用模块,或者说用户应用(User Application,UA)是一个可动态加载的模块:它可以独立于RT-Thread固件而单独编译。一般的,每个UA都包含一个main函数入口;一个它自己的对象链表,用于管理这个应用的任务/信号量/消息队列等内核对象,创建、初始化、销毁等。更多关于UA的信息,请访问另外一个 [git 仓库](https://github.com/RT-Thread/rtthread-apps) 了解。
|
- RT-Thread软件包:运行于 RT-Thread物联网操作系统平台上,面向不同应用领域的通用软件组件,由描述信息、源代码或库文件组成。RT-Thread提供了开放的软件包平台,这里存放了官方提供或开发者提供的软件包,该平台为开发者提供了众多可重用软件包的选择,这也是 RT-Thread生态的重要组成部分。软件包生态对于一个操作系统的选择至关重要,因为这些软件包具有很强的可重用性,模块化程度很高,极大的方便应用开发者在最短时间内,打造出自己想要的系统。RT-Thread已经支持的软件包数量已经达到 180+。
|
||||||
|
|
||||||
## 支持的芯片架构 ##
|
|
||||||
|
|
||||||
RT-Thread支持数种芯片体系架构,已经覆盖当前应用中的主流体系架构:
|
|
||||||
|
|
||||||
* ARM Cortex-M0
|
## RT-Thread的特点
|
||||||
* ARM Cortex-M3/M4/7
|
|
||||||
* ARM Cortex-R4
|
|
||||||
* ARM Cortex-A8/A9
|
|
||||||
* ARM920T/ARM926 etc
|
|
||||||
* MIPS32
|
|
||||||
* x86
|
|
||||||
* Andes
|
|
||||||
* C-Sky
|
|
||||||
* RISC-V
|
|
||||||
* PowerPC
|
|
||||||
|
|
||||||
## 许可证 ##
|
- 资源占用极低,超低功耗设计,最小内核(Nano版本)仅需1.2KB RAM,3KB Flash。
|
||||||
|
|
||||||
RT-Thread从v3.1.1版本开始,是一个以Apache许可证2.0版本授权的开源软件,许可证信息以及版权信息一般的可以在代码首部看到:
|
- 组件丰富,繁荣发展的软件包生态 。
|
||||||
|
|
||||||
|
- 简单易用 ,优雅的代码风格,易于阅读、掌握。
|
||||||
|
|
||||||
|
- 高度可伸缩,优质的可伸缩的软件架构,松耦合,模块化,易于裁剪和扩展。
|
||||||
|
|
||||||
|
- 强大,支持高性能应用。
|
||||||
|
|
||||||
|
- 跨平台、芯片支持广泛。
|
||||||
|
|
||||||
|
|
||||||
|
## **代码目录**
|
||||||
|
|
||||||
|
RT-Thread源代码目录结构如下图所示:
|
||||||
|
|
||||||
|
| 名称 | 描述 |
|
||||||
|
| ------------- | ------------------------------------------------------- |
|
||||||
|
| BSP | Board Support Package(板级支持包)基于各种开发板的移植 |
|
||||||
|
| components | RT-Thread 的各个组件代码,例如 finsh,gui 等。 |
|
||||||
|
| documentation | 相关文档,如编码规范等 |
|
||||||
|
| examples | 相关示例代码 |
|
||||||
|
| include | RT-Thread 内核的头文件。 |
|
||||||
|
| libcpu | 各类芯片的移植代码。 |
|
||||||
|
| src | RT-Thread 内核的源文件。 |
|
||||||
|
| tools | RT-Thread 命令构建工具的脚本文件。 |
|
||||||
|
|
||||||
|
目前RT-Thread已经针对将近90种开发板做好了移植,大部分 BSP 都支持 MDK﹑IAR开发环境和GCC编译器,并且已经提供了默认的 MDK 和 IAR 工程,用户可以直接基于这个工程添加自己的应用代码。 每个 BSP 的目录结构高度统一,且都提供一个 README.md 文件,包含了对这个 BSP 的基本介绍,以及相应的说明,方便用户快速上手。
|
||||||
|
|
||||||
|
Env 是RT-Thread推出的开发辅助工具,针对基于RT-Thread操作系统的项目工程,提供编译构建环境、图形化系统配置及软件包管理功能。其内置的 menuconfig 提供了简单易用的配置剪裁工具,可对内核、组件和软件包进行自由裁剪,使系统以搭积木的方式进行构建。
|
||||||
|
|
||||||
|
[下载 Env 工具](https://www.rt-thread.org/page/download.html)
|
||||||
|
|
||||||
|
[Env 用户手册](https://github.com/RT-Thread/rtthread-manual-doc/blob/master/env/env.md)
|
||||||
|
|
||||||
|
|
||||||
|
# 资源文档
|
||||||
|
|
||||||
|
## **硬件支持**
|
||||||
|
|
||||||
|
RT-Thread RTOS 支持许多架构,并且已经涵盖了当前应用中的主要架构。涉及的架构和芯片制造商有:
|
||||||
|
|
||||||
|
- ARM Cortex-M0/M0+:如芯片制造商 ST
|
||||||
|
|
||||||
|
- ARM Cortex-M3:如芯片制造商 ST、全志、灵动等.
|
||||||
|
|
||||||
|
- ARM Cortex-M4:如芯片制造商 ST、Nuvton、NXP、GigaDevice、Realtek、Ambiq Micro等
|
||||||
|
|
||||||
|
- ARM Cortex-M7:如芯片制造商 ST、NXP
|
||||||
|
|
||||||
|
- ARM Cortex-M23:如芯片制造商 GigaDevice
|
||||||
|
|
||||||
|
- ARM Cortex-R4
|
||||||
|
|
||||||
|
- ARM Cortex-A8/A9:如芯片制造商 NXP
|
||||||
|
|
||||||
|
- ARM7:如芯片制造商Samsung
|
||||||
|
|
||||||
|
- ARM9:如芯片制造商Allwinner、Xilinx 、GOKE
|
||||||
|
|
||||||
|
- ARM11:如芯片制造商Fullhan
|
||||||
|
|
||||||
|
- MIPS32:如芯片制造商loongson、Ingenic
|
||||||
|
|
||||||
|
- RISC-V:如芯片制造商Hifive、Kendryte
|
||||||
|
|
||||||
|
- ARC:如芯片制造商SYNOPSYS
|
||||||
|
|
||||||
|
- DSP:如芯片制造商 TI
|
||||||
|
|
||||||
|
- C-Sky
|
||||||
|
|
||||||
|
- x86
|
||||||
|
|
||||||
|
|
||||||
|
## **支持的 IDE 和编译器**
|
||||||
|
|
||||||
|
RT-Thread主要支持的IDE/编译器包括:
|
||||||
|
|
||||||
|
- MDK KEIL
|
||||||
|
|
||||||
|
- IAR
|
||||||
|
|
||||||
|
- Gcc
|
||||||
|
|
||||||
|
- RT-Thread Studio
|
||||||
|
|
||||||
|
使用基于 Python 的 [scons](http://www.scons.org/) 进行命令行生成。
|
||||||
|
|
||||||
|
RT-Thread Studio演示:
|
||||||
|
|
||||||
|
|
||||||
|
![studiozh](./documentation/figures/studiozh.gif)
|
||||||
|
|
||||||
|
|
||||||
|
## **快速上手**
|
||||||
|
|
||||||
|
RT-Thread BSP可以直接编译并下载到相应的开发板使用。此外,RT-Thread还提供 qemu-vexpress-a9 BSP,无需硬件平台即可使用。有关详细信息,请参阅下面的入门指南。
|
||||||
|
|
||||||
|
[QEMU 入门指南(Windows)](https://github.com/RT-Thread/rtthread-manual-doc/blob/master/documentation/quick_start_qemu/quick_start_qemu.md)
|
||||||
|
|
||||||
|
[QEMU 入门指南(Ubuntu)](https://github.com/RT-Thread/rtthread-manual-doc/blob/master/documentation/quick_start_qemu/quick_start_qemu_linux.md)
|
||||||
|
|
||||||
|
|
||||||
|
## 文档
|
||||||
|
|
||||||
|
[文档中心](https://www.rt-thread.org/document/site/ ) | [编程指南](https://www.rt-thread.org/document/site/programming-manual/basic/basic/ )
|
||||||
|
|
||||||
|
[应用 RT-Thread 实现蜂鸣器播放器教程](https://www.rt-thread.org/document/site/tutorial/beep-player/) | [分布式温度监控系统教程](https://www.rt-thread.org/document/site/tutorial/temperature-system/ ) | [智能车连载教程](https://www.rt-thread.org/document/site/tutorial/smart-car/ )
|
||||||
|
|
||||||
|
## 例程
|
||||||
|
|
||||||
|
[内核示例](https://github.com/RT-Thread-packages/kernel-sample) | [设备示例代码](https://github.com/RT-Thread-packages/peripheral-sample ) | [文件系统示例代码](https://github.com/RT-Thread-packages/filesystem-sample ) | [网络示例代码](https://github.com/RT-Thread-packages/network-sample ) | [RT-Thread API参考手册](https://www.rt-thread.org/document/api/ )
|
||||||
|
|
||||||
|
[基于STM32L475 IoT Board 开发板SDK](https://github.com/RT-Thread/IoT_Board) | [基于W601 IoT Board 开发板SDK](https://github.com/RT-Thread/W601_IoT_Board)
|
||||||
|
|
||||||
|
## 视频
|
||||||
|
|
||||||
|
RT-Thread视频中心提供了一系列RT-Thread相关教程及分享内容。
|
||||||
|
|
||||||
|
如:内核入门系列 | Env系列 | 网络系列 | Nano移植系列 | RT-Thread Studio系列 | 柿饼UI系列 | 答疑直播系列 | 社区作品系列
|
||||||
|
|
||||||
|
更多详情,请前往 [视频中心](https://www.rt-thread.org/page/video.html)
|
||||||
|
|
||||||
|
# **许可协议**
|
||||||
|
|
||||||
|
RT-Thread系统完全开源,3.1.0 及以前的版本遵循 GPL V2 + 开源许可协议。从 3.1.0 以后的版本遵循Apache License 2.0开源许可协议,可以免费在商业产品中使用,并且不需要公开私有代码。
|
||||||
|
|
||||||
|
```
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
```
|
||||||
|
|
||||||
从2018/09/09开始,开发者提交PR需要签署贡献者许可协议(CLA)。
|
# 社区支持
|
||||||
|
|
||||||
注意:
|
RT-Thread非常感谢所有社区小伙伴的支持,在使用RT-Thread的过程中若您有任何的想法,建议或疑问都可通过以下方式联系到 RT-Thread,我们也实时在这些频道更新RT-Thread的最新讯息。同时,任何问题都可以在 [issue section](https://github.com/RT-Thread/rtthread-manual-doc/issues) 中提出。通过创建一个issue来描述您的问题,社区成员将回答这些问题。
|
||||||
|
|
||||||
以Apache许可协议v2.0版本授权仅在RT-Thread v3.1.1正式版发布之后才正式实施,当前依然在准备阶段(准备所有原有开发者签署CLA协议)。
|
[官网]( https://www.rt-thread.org) | [论坛]( https://www.rt-thread.org/qa/forum.php) | [哔哩哔哩官方账号](https://space.bilibili.com/423462075?spm_id_from=333.788.b_765f7570696e666f.2) | [微博官方账号](https://weibo.com/rtthread?is_hot=1) | [知乎官方账号](https://www.zhihu.com/topic/19964581/hot)
|
||||||
|
|
||||||
## 编译 ##
|
RT-Thread微信公众号:
|
||||||
|
|
||||||
RT-Thread使用了[scons](http://www.scons.org)做为自身的编译构建系统,并进行一定的定制以满足自身的需求(可以通过scons --help查看RT-Thread中额外添加的命令)。在编译RT-Thread前,请先安装Python 2.7.x及scons。
|
![qrcode](./documentation/figures/qrcode.png)
|
||||||
|
|
||||||
截至目前,RT-Thread scons构建系统可以使用命令行方式编译代码,或者使用scons来生成不同IDE的工程文件。在使用scons时,需要对构建配置文件(rtconfig.py)中如下的变量进行配置:
|
|
||||||
|
|
||||||
* ```CROSS_TOOL``` 指定希望使用的工具链,例如gcc/keil/iar.
|
# 贡献代码
|
||||||
* ```EXEC_PATH``` 工具链的路径.
|
|
||||||
|
|
||||||
注:在SConstruct文件中:
|
如果您对RT-Thread感兴趣,并希望参与RT-Thread的开发并成为代码贡献者,请参阅[代码贡献指南](https://github.com/RT-Thread/rtthread-manual-doc/blob/master/documentation/contribution_guide/contribution_guide.md)。
|
||||||
|
|
||||||
```RTT_ROOT``` 这个变量指向了RT-Thread的发布源代码根目录。如果你仅计划编译bsp目录下的target,这个`RTT_ROOT`可以使用默认配置。另外,你也可以设置同名的环境变量来指向不同的RT-Thread源代码根目录。
|
|
||||||
|
|
||||||
当你把相关的配置都配置正确后,你可以在具有目标目录下(这个目录应包括rtconfig.py、SContruct文件)执行以下命令:
|
|
||||||
|
|
||||||
scons
|
|
||||||
|
|
||||||
从而简单地就编译好RT-Thread。
|
|
||||||
|
|
||||||
如果你希望使用IDE来编译RT-Thread,你也可以使用命令行:
|
|
||||||
|
|
||||||
scons --target=mdk/mdk4/mdk5/iar/cb -s
|
|
||||||
|
|
||||||
来生成mdk/iar等的工程文件。而后在IDE中打开project前缀的工程文件来编译RT-Thread。
|
|
||||||
|
|
||||||
注意:RT-Thread的scons构建系统会根据配置头文件rtconfig.h来裁剪系统。例如,如果你关闭了rtconfig.h中的lwIP定义(通过注释掉```#define RT_USING_LWIP```的方式),则scons生成的IDE工程文件中将自动不包括lwIP相关的文件。而在RT-Thread 3.0版本中,可以通过menuconfig的方式来配置整个系统,而不需要再手工更改rtconfig.h配置头文件。
|
|
||||||
|
|
||||||
## 贡献者 ##
|
|
||||||
|
|
||||||
请访问github上RT-Thread项目上的contributors了解已经为RT-Thread提交过代码,PR的贡献者。感谢所有为RT-Thread付出的开发者们!
|
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
Binary file not shown.
After Width: | Height: | Size: 37 KiB |
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.4 MiB |
Binary file not shown.
After Width: | Height: | Size: 1.3 MiB |
Loading…
Reference in New Issue