当前位置:网站首页>RT thread learning notes (III) -- building a compilation environment with scons
RT thread learning notes (III) -- building a compilation environment with scons
2022-07-26 10:43:00 【aping_ cs_ dn】
Software environment :Win7,Keil MDK 4.72a, IAR EWARM 7.2, GCC 4.2,Python 2.7 ,SCons 2.3.2
Hardware environment :Armfly STM32F103ZE-EK v3.0 Development board
Reference article
【1】RT-Thread User's Manual
1 About SCons Building tools
Manual No 10 This is how the chapter describes it :SCons It's a set of Python Open source building system written in language , Be similar to GNU Make. It uses different from the usual Makefile Of documents SConstruct and SConscript file . These documents are also Python Script , Be able to use standard Python Grammar to write . So in SConstruct、SConscript Can be called in the file Python The standard library carries out all kinds of complex processing , Not limited to Makefile Set the rules . stay SCons You can find detailed SCons User's Manual .
2 Download and install NotePad++ Text editing tools
- Built in support for up to 27 Syntax high brightness display ( Including a variety of common source code 、 Script , Be able to support .nfo The file to view ), It also supports custom languages ;
- Automatic detection of file types , Display nodes according to keywords , Nodes can be folded freely / open , You can also display indented Guides , The code is hierarchical ;
- Can open double windows , In the sub window, multiple sub windows can be opened , Display scale ;
- Provides some useful tools , Such as Adjacent banks swap positions 、 Macro functions , etc. ……
- The number of bytes of the selected text can be displayed ( Instead of the number of words displayed in the general editor , This in some cases , For example, software localization is very convenient );
- Regular matching string and batch replacement ;
- Powerful plug-in mechanism , Expanded editing capabilities , Such as Zen Coding.
3 establish RT-Thread/bsp Application branch under

ARCH='arm'
CPU='cortex-m3'
CROSS_TOOL=' Keil'
CROSS_TOOL = os.getenv('RTT_CC')
# STM32_TYPE =
# 'STM32F10X_LD','STM32F10X_LD_VL',
# 'STM32F10X_MD','STM32F10X_MD_VL',
# 'STM32F10X_HD','STM32F10X_HD_VL',
# 'STM32F10X_XL','STM32F10X_CL'
STM32_TYPE = 'STM32F10X_HD'
# 'FMT0371','ILI932X', 'SSD1289'
RT_USING_LCD_TYPE = 'SSD1289'
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR
PLATFORM = 'gcc'
EXEC_PATH = r'C:\Program Files\CodeSourcery\Sourcery_CodeBench_Lite_for_ARM_EABI\bin'
elif CROSS_TOOL == 'keil':
PLATFORM = 'armcc'
EXEC_PATH = 'C:/Keil'
elif CROSS_TOOL == 'iar':
PLATFORM = 'iar'
IAR_PATH = r'C:\Program Files\IAR Systems\Embedded Workbench 7.0'
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
【3】 Save and compile
Compilation tips : Each time you open the command terminal and enter the command into the working directory, it is time-consuming for people who type slowly , Creating a new batch file can save some time , Copy the following content into a notepad and rename it as xxx.bat Just file it .
echo RTT bat
E:
cd \RTT\apingrtt\rt-thread-1.2.2\bsp\stm32f103ze-ek
::pause
cmd.exe
Then you can compile .
There is an error , Here's the picture :

And on again keil MDK Of options, Here's the picture .

Compare the system variables , It is found that there is no RT_CC, therefore rtconfig.py The judgment condition in is false , and RT_ROOT=E:\RT_Thread It needs to be revised , Because here RTT_ROOT The variable value of is RTT Source root , This variable is at the top SConstruct It is used in the document , The modification result is shown in the figure below .

And then it's running scons --target=mdk4 -s, Here's the picture .

Use... Again keil Open the project file in this directory , Then open the options, have a look , Here's the picture .

The root directory has worked .
Enter at the command terminal stim32f103zet_v5(baiwei) Under the table of contents , function scons -c, Clear previous compilation results . And then run scons recompile , give the result as follows :

【4】 The compiled output directory is set to not receive version monitoring .
Git Files in are ignored
1. Shared ignore new .gitignore file , It can be placed anywhere in the project directory ..gitignore Files can ignore themselves . Ignored files , Only valid for untracked files , Invalid for files that have been added to the version Library .
2. Exclusive ignore specific version libraries :.git/info/exclude For local and global : git config --global core.excludefile ~/.gitignore
Grammar rules ignored :
"#" Notation ;
With a slash “/” The beginning indicates the table of contents ;
With an asterisk “*” Match multiple characters , namely "*" Represents any number of characters ;
With question mark “?” Pass on a single character , namely "?" Represents a character ;
In square brackets “[]” Contains a list of matches for a single character ;
With exclamation marks “!” Don't ignore ( track ) The file or directory to which to match ;
([abc]) Represents the range of optional characters
Besides ,git about .ignore Configuration files are rule-matched from top to bottom on a line basis , That means if the previous rule matches over a larger range , Then the following rules will not take effect ;
If the name is preceded by the path separator “/”, Indicates that the file ignored is in this directory .
If the last side of the name is “/” , Indicates that the entire directory is ignored , But files with the same name are not ignored .
By prefixing the name “!”, On behalf of not ignoring .
Examples are as follows :
# This line is a comment
*.a # Ignore all .a Files with extensions
!lib.a # however lib.a Don't ignore , Even if the previous setting ignores all .a
/TODO # Only ignore this directory TODO file , Of subdirectories TODO Don't ignore
build/ # Ignore all build/ Files under directory , Be careful , Whether it's in the root directory /build/ Catalog , Or some subdirectory /child/build/ Catalog , Will be ignored ;
doc/*.txt # Ignore as doc/notes.txt, But don't ignore such as doc/server/arch.txt


边栏推荐
- Asynctask < T> decoration and await are not used in synchronous methods to obtain asynchronous return values (asynchronous methods are called in synchronous methods)
- Redis special data type usage scenarios
- 剑指Offer(五十二):正则化表达式
- Redis implementation of distributed lock solution
- kali 查看ip地址
- Uniapp uses the simple method signalr (only for web debugging, cannot package apps)
- oracle 启动不了 tnslistener服务启动不了
- 11 handle "self assignment" in operator=
- Oracle cannot start tnslistener service cannot start
- IAR sprintf 浮点 在UCOS 总格式化成0.0的问题
猜你喜欢
![[leetcode每日一题2021/8/31]1109. 航班预订统计【中等】差分数组](/img/9d/5ce5d4144a9edc3891147290e360d8.png)
[leetcode每日一题2021/8/31]1109. 航班预订统计【中等】差分数组

Issue 7: how do you choose between curling up and lying flat
![[leetcode每日一题2021/4/23]368. 最大整除子集](/img/0b/32ca862963c842a93f79eaac94fb98.png)
[leetcode每日一题2021/4/23]368. 最大整除子集

kali 查看ip地址

第4期:大学生提前职业技能准备之一

flutter 背景变灰效果,如何透明度,灰色蒙板遮罩

Centos8 (liunx) deploying WTM (asp.net 5) using PgSQL

SAP ABAP 守护进程的实现方式

Phase 4: one of College Students' vocational skills preparation in advance

Issue 5: the second essential skill for College Students
随机推荐
[leetcode每日一题2021/2/14]765. 情侣牵手
GIS方法类期刊和论文的综述(Introduction)怎么写?
$router和$route的区别
Common classes (understand)
A semicolon is missing
第7期:内卷和躺平,你怎么选
C language calculation date interval days
剑指Offer(八):跳台阶
解决:无法加载文件 C:\Users\user\AppData\Roaming\npm\npx.ps1,因为在此系统上禁止运行脚本 。
Uninstall Meizu app store
创建EOS账户 Action
Oracle cannot start tnslistener service cannot start
PLC与伺服电机连接
The problem of large fluctuation of hx711 data
Flutter TextField怎样去除下划线及有焦点时颜色
鹏哥C语言20210811程序结构作业
Anaconda is used on vscode (the environment has been configured)
.net operation redis list list
【机器学习小记】【人脸识别】deeplearning.ai course4 4th week programming
访问权限——private,public,protected