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

边栏推荐
- 【历史上的今天】6 月 8 日:万维网之父诞生;PHP 公开发布;iPhone 4 问世
- 设计电商秒杀系统
- Skills in schematic merging
- Prometheus 2.27.0 new features
- [today in history] June 8: the father of the world wide web was born; PHP public release; IPhone 4 comes out
- Usage differences between isempty and isblank
- I forgot my cell phone today
- math_ (function & sequence) meaning of limit & misunderstanding and symbol sorting / neighborhood & de centring neighborhood & neighborhood radius
- 【历史上的今天】6 月 18 日:京东诞生;网店平台 Etsy 成立;Facebook 发布 Libra 白皮书
- ROS+Gazebo中红绿黄交通灯如何实现?
猜你喜欢
![[block coding] simulation of image block coding based on MATLAB](/img/d9/a9c45faf40663865893cd58e7e7431.png)
[block coding] simulation of image block coding based on MATLAB

字节跳动面试官:一张图片占据的内存大小是如何计算
![[today in history] June 17: the creator of the term](/img/00/30ccc2f54415a6aca000c42e277dc3.png)
[today in history] June 17: the creator of the term "hypertext" was born; The birth of Novell's chief scientist; Discovery channel on

在线JSON转PlainText工具

The graduation season is coming, and the number of college graduates in 2022 has exceeded 10 million for the first time

Arduino Esp8266 Web LED控制

【历史上的今天】6 月 6 日:世界 IPv6 启动纪念日;《俄罗斯方块》发布;小红书成立

win11如何添加打印机和扫描仪?win11添加打印机和扫描仪的设置

【历史上的今天】6 月 19 日:iPhone 3GS 上市;帕斯卡诞生;《反恐精英》开始测试

math_(函数&数列)极限的含义&误区和符号梳理/邻域&去心邻域&邻域半径
随机推荐
Writing C program with GCC and makefile for the first time
Opencv——霍夫变换以及遇到的一些问题
math_(函数&数列)极限的含义&误区和符号梳理/邻域&去心邻域&邻域半径
Online text batch inversion by line tool
Shuttle uses custompaint to paint basic shapes
Interpretation of bilstm-crf in NER forward_ algorithm
「大道智创」获千万级preA+轮融资,推出科技消费机器人
Arduino Esp8266 Web LED控制
榜单首发——前装搭载率站上10%大关,数字钥匙方案供应商TOP10
【历史上的今天】6 月 7 日:Kubernetes 开源版本发布;《魔兽世界》登陆中国;分组交换网络发明者出生
Explanation of OSI layer 7 model (easy to understand in Chinese)
Graduation summary
Data governance and data standards
What if win11 can't drag an image to the taskbar software to open it quickly
转载文章:数字经济催生强劲算力需求 英特尔发布多项创新技术挖掘算力潜能
【 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
[today in history] June 10: Apple II came out; Microsoft acquires gecad; The scientific and technological pioneer who invented the word "software engineering" was born
第三批入围企业公示!年度TOP100智能网联供应商评选
[today in history] June 1: Napster was founded; MS-DOS original author was born; Google sells Google SketchUp
Livedata interview question bank and answers -- 7 consecutive questions for livedata interview~
