当前位置:网站首页>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

边栏推荐
- How to run unity webgl after packaging (Firefox configuration)
- 榜单首发——前装搭载率站上10%大关,数字钥匙方案供应商TOP10
- Design e-commerce seckill system
- 【 amélioration de la correction d'image de Code bidimensionnel】 simulation du traitement d'amélioration de la correction d'image de Code bidimensionnel basée sur MATLAB
- Publicity of the third batch of shortlisted enterprises! Annual Top100 smart network supplier selection
- Flutter 使用 CustomPaint 绘制基本图形
- 字节跳动面试官:一张图片占据的内存大小是如何计算
- 毕业季来临,2022届高校毕业生人数首次突破千万大关
- Stm32f1 interrupt introduction
- The first place on the list - the carrying rate of front-end equipment is up to 10%, and the top 10 suppliers of digital key solutions
猜你喜欢

Character interception triplets of data warehouse: substrb, substr, substring

Flask基础:模板渲染+模板过滤使用+控制语句

isEmpty 和 isBlank 的用法區別

JDBC与MySQL数据库

StaticLayout的使用详解

Moving Tencent to the cloud: half of the evolution history of cloud server CVM

【历史上的今天】6 月 7 日:Kubernetes 开源版本发布;《魔兽世界》登陆中国;分组交换网络发明者出生

Stm32f1 and stm32subeide programming example - metal touch sensor driver

【历史上的今天】5 月 31 日:Amiga 之父诞生;BASIC 语言的共同开发者出生;黑莓 BBM 停运
![[today in history] June 12: the United States entered the era of digital television; Mozilla's original developer was born; 3com merges with American Robotics](/img/91/d7d6137b95f6348f71692164614340.png)
[today in history] June 12: the United States entered the era of digital television; Mozilla's original developer was born; 3com merges with American Robotics
随机推荐
STM32F1与STM32CubeIDE编程实例-金属触摸传感器驱动
A low-cost method to increase private domain traffic with simple maintenance
isEmpty 和 isBlank 的用法区别
【历史上的今天】6 月 17 日:术语“超文本”的创造者出生;Novell 首席科学家诞生;探索频道开播
【历史上的今天】6 月 13 日:分组交换网路的“亲子纠纷”;博弈论创始人出生;交互式电视初现雏形
迪赛智慧数——柱状图(折柱混合图):2021年毕业季租房价格和房租收入比
4G-learn from great partners
Win11无法使用动态壁纸怎么办?Win11用不了动态壁纸的解决方法
【电梯控制系统】基于VHDL语言和状态机实现的电梯控制系统的设计,使用了状态机
在线文本按行批量反转工具
数据清洗工具flashtext,效率直接提升了几十倍数
Is it safe for qiniu to open an account? How do I open an account online?
[today in history] June 13: parent-child disputes in packet switched networks; The founder of game theory was born; The embryonic form of interactive television
Win11不能拖拽图片到任务栏软件上快速打开怎么办
【历史上的今天】5 月 29 日:共享软件先驱诞生;ChromeBox 推出;VoodooPC 创始人出生
Truth table of common anode digital tube
【倒立摆控制】基于UKF无迹卡尔曼滤波的倒立摆控制simulink仿真
Explanation of OSI layer 7 model (easy to understand in Chinese)
贪吃蛇 C语言
Mysql数据库基础:DML数据操作语言
