当前位置:网站首页>RT thread learning notes (I) -- configure RT thread development environment
RT thread learning notes (I) -- configure RT thread development environment
2022-07-26 10:42:00 【aping_ cs_ dn】
Preface
I came into contact with a strange name by chance ---RT-Tread, Think about it , From its manual, I found that this strange embedded operating system has many excellent performances , So I made up my mind to study . It's recorded below RT-Thread Learning process , Please correct any mistakes .
Software environment :Win7,Keil MDK 4.72a, IAR EWARM 7.2, GCC 4.2
Hardware environment :Armfly STM32F103ZE-EK REV 3.0 Development board
Reference article :
【1】RT-Thread with Set up open Hair Ring habitat hand book
【2】RT-Thread Tutorial series Click to open the link
【3】STM32 + RT Thread OS Learning notes
1,RT-Thread Development environment configuration
1.1 install python as well as SCons Building tools
RT-Thread Use SCons As the default build tool .SCons be based on Python Development , So we need to install python, Install again SCons.
(1), install python, The version number is 2.7 Click to open the link , Download and install , Here's the picture . But it's not necessary , You can use 2.6 Or other versions .python3.2 Version cannot run scons

Click next all the way (next) that will do . By default , This program will be installed in C:\Python27 Under the table of contents , We will add this directory to the system
PATH variable . The method is as follows :
In the computer (windows 7) Right click on , choice 【 attribute 】, Then click... In the pop-up dialog box 【 Advanced system setup 】, The system properties dialog box pops up -> senior -> environment variable , Here's the picture . Note that the fifth step is “; C:\Python27 ”, The semicolon is the symbol in the English input state .

then , Click OK to close the dialog box .
(2), install SCons
Scons Download address : http://sourceforge.net/projects/scons/files/scons/2.3.2/, The software version is 2.3.2 Choose Microsoft here window edition , After downloading, click Install ,SCons Will be automatically installed to python The installation directory is C:\Python27\Scripts Catalog , Here's the picture .

Refer to the previous section , Add the above path to the system as well PATH variable . use echo %path% Command can see the result of adding system variables , Here's the picture .

1.2, Install build toolchain
RT-Thread Can support GCC,Keil MDK perhaps IAR Of EWARM One or all of the compilation tools .
(1), About GCC, Recommend an article sourcery g++ lite Establish a cross compilation loop , It's related GCC Introduction to , Download address is codesourcery, Need to register , The version installed here arm-2012.09-63-arm-none-eabi.exe, Here's the picture , You can change the installation location .


Install by default , After the end ,gcc The installation path of will be automatically added to the system environment variable .
(2),KeilMDK and IAR EWARM install , Because it is commercial software , No introduction here .
2, Compile testing
2.1, Source directory structure
adopt SVN Download to local SVN The source code structure of the directory is shown in the figure below .

2.2, To configure SCons Script
Enter into RT-Thread Board level engineering catalogue bsp below , You can see many development board project directories , The existing development board here is armlay( Anfulai ) Of STM32F103ZE-EK REV3.0, So just put stm32f10x Copy the directory together with the file and rename it stm32f103ze-ek(armfly), As shown in the bottom left . Then enter the directory and find readme.txt and rtconfig.py, As shown in the bottom right .


In the above file :
rtconfig.py This file must be modified .
rtconfig.h This file is used for cropping rt-thread( Modify according to your needs )
open readme.txt, You can see the following :
-- cn --
Generate project files as needed :
1. modify rtconfig.py :
CROSS_TOOL='keil' # Tool chain used
STM32_TYPE = 'STM32F10X_HD' #STM32 Corresponding model .
2. modify rtconfig.h Configure the required functions .
2. perform scons --target=mdk Generate MDK Engineering documents .
note: Need to install python,scons.
-- en --
The above content tells us that we need to specify the compiler and the chip type on the development board .
RT-Thread Through SCons Three compilers are supported , The choice of compiler is rtconfig.py It is specified in , If you follow the above steps to install python and SCons, So it can be rtconfig.py Right click Edit with IDLE Editor open , Some of the contents are as follows ( The red bold part is the result of modification according to your actual environment and needs ):

explain : The above compilation tool defaults to IAR Compiler Links , With windows Platform as an example , therefore , The paths are all windows Path style , about linux, Just change the path to linux Style is fine . Add a small before the path r, Indicates that the following content does not need to be escaped , because windows The path style is to use '\' As a separator , Conflicts with escape characters .
SCons Common options for commands :
scons -c
This command will clear the compiled file
scons -j4
According to the parallel 4 Two tasks running at the same time , Applicable to multi-core and multi-threaded .
scons --target=mdk4 -s
Generate project.uvproj, But you need to check the current bsp Does the directory provide template.uvproj file , Because this command depends on template.uvproj or template.uv2.
scons --target=iar -s
Generate project.ewp and project.eww, But it also depends on the current bsp Is it provided in the directory? Is it provided template.ewp Engineering formwork .
Save the above file , open cmd Command line window , Then input directly E: Use cd Command switch to bsp\stm32f103ze-ek(armfly) Under the table of contents , Here's the picture .

Then input scons Back carriage return , The operation results are as follows :

And then put the rtconfig.py Script CROSS_TOOLS Revised as follows :
CROSS_TOOLS='iar'
After the save , Re execution scons command , give the result as follows :

Then change the variable above back , as follows :
CROSS_TOOLS='keil'
Save after modification , Re execution scons command

It is known from the above test ,iar and gcc This error will not occur . But with keil There is an alarm and a link error in the compilation result .
Be careful : At this point you may encounter an error , The alarm prompt is that the link is not found ARM library ,link error .
Search online and say yes scons Build engineering components cannot be automatically added , I didn't understand , Can only be put on hold , It needs to be studied in the future .
Only this and nothing more , We are stm32f103ze-ek The development board builds a RT-Thread development environment .
边栏推荐
- 在神州IV开发板上成功移植STemWin V5.22
- 文案秘籍七步曲至----文献团队协作管理
- A semicolon is missing
- 2021-08-12函数递归_和鹏哥学习C语言
- 【机器学习小记】【搭建循环神经网络及其应用】deeplearning.ai course5 1st week programming(keras)
- 13 managing resources by objects
- Issue 8: cloud native -- how should college students learn in the workplace
- [leetcode daily question 2021/2/14]765. Lovers hold hands
- 如何实现临时的图形要素现实
- [notes on machine learning] [building a cyclic neural network and its application] deeplearning ai course5 1st week programming(keras)
猜你喜欢
![[notes on machine learning] [building a cyclic neural network and its application] deeplearning ai course5 1st week programming(keras)](/img/02/f85da2a2f2524fb034b17ed8d06692.png)
[notes on machine learning] [building a cyclic neural network and its application] deeplearning ai course5 1st week programming(keras)

【论文下饭】Deep Mining External Imperfect Data for ChestX-ray Disease Screening

解决:无法加载文件 C:\Users\user\AppData\Roaming\npm\npx.ps1,因为在此系统上禁止运行脚本 。
![[dectectron2] follow the official demo](/img/aa/03e46897234c309415b336ac39b7d9.png)
[dectectron2] follow the official demo

SAP ABAP 守护进程的实现方式
![[leetcode每日一题2021/2/14]765. 情侣牵手](/img/be/8639a05c733638bf0b3fdeb11abccf.png)
[leetcode每日一题2021/2/14]765. 情侣牵手

Analysis of the transaction problem of chained method call

STM32 Alibaba cloud mqtt esp8266 at command
![[leetcode daily question 2021/4/23]368. Maximum divisible subset](/img/0b/32ca862963c842a93f79eaac94fb98.png)
[leetcode daily question 2021/4/23]368. Maximum divisible subset

Problems encountered in QRcode QR code (C language)
随机推荐
The problem of formatting IAR sprintf floating point to 0.0 in UCOS assembly
router.push(),router.repalce(),router.go()使用
鹏哥C语言20210811程序结构作业
.net operation redis list list
[leetcode daily question 2021/4/23]368. Maximum divisible subset
剑指Offer(十):矩形覆盖
第5期:大学生入职必备技能之二
Write to esp8266 burning brush firmware
Flutter集成极光推送
Zongzi battle - guess who can win
创建EOS账户 Action
13 以对象管理资源
el-table实现可编辑表格
Uninstall Meizu app store
点击el-dropdown-item/@click.native
13 managing resources by objects
构建ARM嵌入式开发环境
flutter 背景变灰效果,如何透明度,灰色蒙板遮罩
使用float实现左中右布局,中间内容自适应
Centos8 (liunx) deploying WTM (asp.net 5) using PgSQL