RT thread entry project development process

    In fact, as of today, I'm about RT-Thread It's an introduction, ha ha ha! In fact, as a little white, I just began to contact RT-Thread I may feel very boring when I use it, especially when I use it at the beginning RTT Xiaobai, as the first embedded operating system, has only heard of it before FreeRTOS and UcosIIS,But in fact, embedded operating systems are similar. I want to say something about my RT-Thread A general impression of—— RT-Thread As the leader of domestic embedded operating system, it was founded in 2006 with the goal of open source, sharing and reliability. So far, the official maintenance of this operating system is relatively good, so RT-Thread The ecological chain of is better than other operating systems in China. But why is it not used by many people now? In fact, there are two main reasons, which are also aimed at two different groups of people. First of all, as the big guys in the early stage, they may learn from the beginning FreeRTOS And so on, and it has been used for many years, and the designed products have formed a complete context chain. The context chain here refers to the problems of the development process, such as those that have been used all the time FreeRTOS They can dig out all kinds of common mistakes, even very rare ones, and quickly eliminate them. Then there's Xiaobai who just got started. For example, I may need a long buffer period to change from bare metal development to operating system at the beginning, so I'm a little afraid. After all, what I learned before is only superficial, so RT-Thread It is an unattainable goal.
   As mentioned earlier: RT-Thread The ecological chain of has been relatively mature, and has its own college plans and regular training, which also reduces the fear of too many new developers to a certain extent. In addition, RT-Thread Officials are also trying to get more people to enter RTT,This is not just reflected in this operating system API The convenience of is more reflected in the meticulous consideration of the official. RTT It was provided a long time ago RT-Thread Studio Development tools, but in the early stage, due to the limitation of copyright and other reasons, the software is not very comprehensive and supported BSP(Board level support packages) are also relatively few (1.0.0 Version), but it is relatively perfect now. In addition, RTT Officials have developed ENV Tools, once again reducing the user's development time. most important of all RTT At the beginning, the goal was not only an operating system, but also the hot Internet of things and embedded system+AI. To this end, the official provides a large number of software packages and driver frameworks. But some people are more anxious because of this, because they don't know how to start with a lot of things RTT,Now let me talk about how I used these development tools and software packages in the beginning(Only for STM32 development). 
  First of all, list it here RTT All the official information so far STM32 Developed tools (excluding persimmon) UI,Smart Etc.):①RT-Thread4.0 Version package;②RT-Thread Studio;③RT-Thread ENV Tools;④RT-Thread Programming guide;⑤RT-Thread API Reference manual;⑥Pandora RTT Routine;⑦RT-Thread Q & a community;⑧RT-Thread Official GitHUb Library. Let me first talk about my project development process, which is actually the use process of the above tools:
  1, Use RT-Thread Studio Build the prototype of the project. As mentioned above, now RT-Thread Studio The ecological authorities of the development environment are also trying their best to maintain some common BSP Also supported. So I will use it first when developing projects Studio Software builds the prototype of a project, if you ENV If you are skilled in using tools, you can also choose to use them ENV+SCONS+Keil Directly generate your own project if RTT Not very skilled in use, and just started RTT If so, I suggest using this method. First you need to install RT-Thread Studio The software will not be introduced too much here (just a fool's operation). During the installation process, you must pay attention to networking, because you must log in with an account later. If you don't log in, the software will exit automatically. After installation, the following interface will appear:
  Select Create directly here RT-Thread Project, and then there are two development modes, one is based on BSP(Onboard support package), which is mainly aimed at MCU;One is for the development board. This development method has just come out recently, because I haven't encountered it before;![RT-Thread Studio Development interface of](https://img-blog.csdnimg.cn/20210522191414328.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQzODU4Nzgz,size_16,color_FFFFFF,t_70)

If it is based on the development board, a detailed description of the development board will pop up on the right, and there are relevant datasheets for reference:
After the relevant configuration is completed, you can directly click "finish", and a basic engineering framework is formed:

There is not much to explain the functions of each folder here. The official reference document of RT thread has a very detailed description, and the address is attached here:
Address 1 (Official Document Center): https://www.rt-thread.org/document/site/rtthread-studio/nav/
Address 2 (Studio official website): https://www.rt-thread.org/page/studio.html
Note: because of the convenience of Studio, it is strongly recommended that the basic functions of the whole project be improved in Studio, including the use of various software packages, SPI, I2C and other configurations. In addition, here are your own pit stepping records in I2C: https://club.rt-thread.org/ask/question/428711.html
The above pit stepping record is encountered in I2C. If it is solved, friends can ignore it;

2, Compile and generate MDK projects using scons. Projects built by RT thread studio are generally located in the workspace folder in the installation directory:

If you don't like the detailed development of the project, you can skip the step of developing the interface in MDK Studio. If you don't like it, you can continue to use it directly.
As shown in the above figure, all projects generated by Studio are located in the workspace folder. If you want to generate MDK projects, you need to enter the project directory, that is, the path in the following figure:

Then use the installed ENV tool to compile the whole project first:

After successful compilation, you can see the size of the whole project. Then generate different projects according to personal conditions. If there is IAR, you can generate IAR projects. If there are Keil4 and Keil5, you can also generate corresponding projects. The command to generate projects is:
scons --target=iar
scons --target=mdk4
scons --target=mdk5
Of course, you can also use the following commands to generate vs2012 projects or vs2005 projects under bsp/simulator:
scons --target=vs2012
Scons --target=vs2005

3, Continue to optimize the code in Keil, or add some content about the kernel, such as mutex, semaphore, message queue, etc., because the kernel is almost the same. Repeat: be sure to add the relevant code package to your own project in Studio, and generate Keil project after successful operation (output the mounted device through the fish console).


The above is the basic process of developing RT thread project. I feel that this development idea takes a short time and is relatively efficient. It is more friendly than developing in Keil alone.

Personal suggestion: when getting started, you should learn the Kernel first, and then learn other contents. Other contents here include: development tools officially released, such as ENV, Studio, etc; Use of software package; Code optimization;

Keywords: kernel

Added by ropic on Fri, 11 Feb 2022 22:00:05 +0200