当前位置:网站首页>Writing based on stm32
Writing based on stm32
2022-06-28 02:50:00 【m0_ sixty-one million eight hundred and eleven thousand three h】
One 、 stay Keil Create a new project in the environment
1. New projects
Click on project, choice New uVision Project Create project , Name project and save

![]()
Select chip :STM32F103VE, Click on OK

then CMSIS Choose from CORE, stay Device Choose Startup, Click after selection OK

2. Add source file
Right click the directory just now Source Group 1, choice Add New Item to Group 'Source Group 1'...
Select the type of file , Click on Asm Files(.s) Add assembly file , Enter the file name and click Add

Click on Source Group 1 see text.s
Two 、 Code writing , Compile and debug
1. Code writing
stay text.s Add code to
AREA MYDATA, DATA
AREA MYCODE, CODE
ENTRY
EXPORT __main
__main
MOV R0, #10
MOV R1, #11
MOV R2, #12
MOV R3, #13
;LDR R0, =func01
BL func01
;LDR R1, =func02
BL func02
BL func03
LDR LR, =func01
LDR PC, =func03
B .
func01
MOV R5, #05
BX LR
func02
MOV R6, #06
BX LR
func03
MOV R7, #07
MOV R8, #08
BX LR
Make initial settings , Click on Options for Target

stay Output Under the interface , Check Create HEX File, Can be created hex file

stay Debug Under the interface , Check Use Simulator

We need to change Dialog And the right side Parameter Here's the picture

Debugging operation , Results in line with expectations , The value of the register is consistent with the program setting , The details are shown in the following figure :

3、 ... and 、 Analysis generated HEX file
Open in Notepad hex file , Is a string of hexadecimal characters

1. Extended linear address record
Extended linear address record (hex The first row of the file is hexadecimal ) Also called 32 Bit address record or HEX386 Record
These records contain the high of the data address 16 position
Extended linear address records always have two data bytes , The appearance is as follows ( Here I use tags to easily correspond to the original data ):
:020000040800F2

When an extended linear address record is read , The extended linear address stored in the data field is saved , It is applied from Intel HEX Subsequent records read from the file . The linear address remains valid , Until it is changed by another extended address record . The absolute memory address of the data record is obtained by adding the address field in the record to the shifted address data from the extended linear address record .
2. Data section
Intel HEX It consists of any number of hexadecimal records . Each record contains 5 Domains , They are arranged in a certain format ::llaaaatt[dd...]cc. Each group of letters corresponds to a different field , Each letter corresponds to a hexadecimal coded number . Each field consists of at least two hexadecimal coded digits , They form a byte , As described below ::llaaaatt[dd…]cc

3. At the end of the file
In the last row of the file , Is the end sign of a file :
:00000001FF

边栏推荐
- [today in history] June 15: the first mobile phone virus; AI master simahe was born; Chromebook launch
- [today in history] June 8: the father of the world wide web was born; PHP public release; IPhone 4 comes out
- STM32F1与STM32CubeIDE编程实例-金属触摸传感器驱动
- Prometheus 2.27.0 新特性
- 【历史上的今天】6 月 11 日:蒙特卡罗方法的共同发明者出生;谷歌推出 Google 地球;谷歌收购 Waze
- 基于STM32的编写
- 【历史上的今天】6 月 19 日:iPhone 3GS 上市;帕斯卡诞生;《反恐精英》开始测试
- [elevator control system] design of elevator control system based on VHDL language and state machine, using state machine
- Shardingsphere-proxy-5.0.0 establish MySQL read / write separation connection (6)
- ByteDance Interviewer: how to calculate the memory size occupied by a picture
猜你喜欢

How technicians become experts in technical field

【历史上的今天】6 月 20 日:MP3 之父出生;富士通成立;谷歌收购 Dropcam

被通知裁员后拿到5个offer
![[today in history] June 2: Apple launched swift programming language; China Telecom acquires China Unicom C network; OS X Yosemite release](/img/24/58c4ee72e067f01a4c4aa57a1cf61a.jpg)
[today in history] June 2: Apple launched swift programming language; China Telecom acquires China Unicom C network; OS X Yosemite release
![[today in history] June 15: the first mobile phone virus; AI master simahe was born; Chromebook launch](/img/d4/413c84a75f16a09867cfaa3d7f8736.png)
[today in history] June 15: the first mobile phone virus; AI master simahe was born; Chromebook launch

Win11不能拖拽图片到任务栏软件上快速打开怎么办

Interpretation of the source code of scheduledthreadpoolexecutor (II)

Unity WebGL打包后怎么运行(火狐配置)
![[today in history] June 11: the co inventor of Monte Carlo method was born; Google launched Google Earth; Google acquires waze](/img/eb/147d4aac20639d50b204dcf424c9e2.png)
[today in history] June 11: the co inventor of Monte Carlo method was born; Google launched Google Earth; Google acquires waze

Exploration on the construction path of real-time digital warehouse integrating digital intelligence learning and streaming batch
随机推荐
云原生(三十) | Kubernetes篇之应用商店-Helm
How to systematically learn LabVIEW?
【历史上的今天】6 月 16 日:甲骨文成立;微软 MSX 诞生;快速傅里叶变换发明者出生
isEmpty 和 isBlank 的用法區別
第三批入围企业公示!年度TOP100智能网联供应商评选
Stm32f1 and stm32subeide programming example - metal touch sensor driver
Is it safe for qiniu to open an account? How do I open an account online?
11 timers for STM32F103
STM32的C语言与汇编语言混合编程
毕业季来临,2022届高校毕业生人数首次突破千万大关
Interpretation of bilstm-crf in NER forward_ algorithm
NER中BiLSTM-CRF解读Forward_algorithm
Flutter 使用 CustomPaint 绘制基本图形
Explanation of OSI layer 7 model (easy to understand in Chinese)
MFC common current path
【历史上的今天】6 月 13 日:分组交换网路的“亲子纠纷”;博弈论创始人出生;交互式电视初现雏形
Opencv——几何空间变换(仿射变换和投影变换)
Unity WebGL打包后怎么运行(火狐配置)
【历史上的今天】6 月 20 日:MP3 之父出生;富士通成立;谷歌收购 Dropcam
【历史上的今天】6 月 2 日:苹果推出了 Swift 编程语言;电信收购联通 C 网;OS X Yosemite 发布
