当前位置:网站首页>STM32 Basics
STM32 Basics
2022-04-23 20:04:00 【Flowers bloom in half ོ】
First of all, you must be familiar with stm32(stm32g431rbt6) The layout of the board
In fact, you can probably remember what is in which position .
Then there is the schematic diagram , Be familiar with the functions of each pin
above DAP Link and The goal is MCU These two things on the board , By that LCD For blocking the
Let's look at the naming rules of chips
Actually sum 51 Or is it 15 Almost .15、51 All are 8 Bit MCU , Each address is composed of 8 Bit composition , The address can be expressed as :0x_ _, and 32 yes 32 Bit , The address can be expressed as :0x_ _ _ _ _ _ _ _, therefore 51、15 Up to 255 The address of , and 32 You can visit 4G The address of .
Let's see below. stm32 internal structure
The red circle is equivalent to the inside CPU, Then connect various resources through the bus , There are two buses AHB1 and AHB2, Hanging all kinds of resources , It's going to look down , You should be able to understand its internal distribution .( In that case , It's like a map , Which one are you looking for , Follow the line , Or like a human body system )
To write stm32 The program must first use STM32CubeMX Automatically generate some underlying code , The first step is to configure the clock , When I first saw the clock configuration interface, I was actually afraid , Because I can't understand ( In distress situation )...
Take a look at the picture below
However, you can still understand it by following the vine and feeling the melon , Ellipses of the same color indicate that they are the same . It's a green oval , It can be seen that , We use a high-speed external clock , that stm32 The system clock passes through the high-speed external clock and the high-speed internal clock PPL Give the configuration to the main frequency
therefore , When we configure the clock mode .
The clock configuration is also clear at a glance
stm Internal resource address ( Storage address )
SRAM Initial address :0X2000 0000
Peripheral start address :0X4000 0000
flash Initial address :0X0800 0000
I don't know much about anything lower ..
HAL Kuhe LL library :
HAL library (Hardware Abstraction Layer) yes ST The new programming library highly praised by the government ,HAL Kuo is ST by STM32 The latest abstract layer embedded software , It can better ensure cross STM32 Maximum portability of the product .HAL Used a relatively large Flash and SRAM.
LL library (Low Layer) yes ST Recently added Library , And HAL Bundled release , Documents are also and HAL Documents together LL The library is closer to the hardware layer , Not applicable to peripherals requiring complex upper layer protocol stack , Direct operation register . It supports all peripherals . Usage method : Independent use , The library is completely independent , Can completely put aside HAL library , Only LL Library programming is complete . Making STM32CubeMX Project generation , Choose... Directly LL Library is enough . If complex peripherals are used , for example USB, It will call HAL Library mixed use , and HAL Libraries are used in combination . After compiling LL The library only has HAL Library 33% Volume .
版权声明
本文为[Flowers bloom in half ོ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231947187677.html
边栏推荐
- Mysql database - connection query
- 山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(五)
- Garbage collector and memory allocation strategy
- C学习完结
- Comment créer un pass BEP - 20 sur la chaîne BNB
- Mysql database - basic operation of database and table (II)
- Building googlenet neural network based on pytorch for flower recognition
- Openharmony open source developer growth plan, looking for new open source forces that change the world!
- 深度学习——特征工程小总结
- [H264] hevc H264 parsing and frame rate setting of the old version of libvlc
猜你喜欢
Class loading mechanism
MySQL lock
Build intelligent garbage classification applet based on Zero
ESP8266-入门第一篇
如何在BNB鏈上創建BEP-20通證
[webrtc] add x264 encoder for CEF / Chromium
【webrtc】Add x264 encoder for CEF/Chromium
Openharmony open source developer growth plan, looking for new open source forces that change the world!
【webrtc】Add x264 encoder for CEF/Chromium
Class loading process of JVM
随机推荐
MySQL数据库 - 单表查询(三)
The usage of slice and the difference between slice and array
数据库查询 - 选课系统
音频编辑生成软件
【数值预测案例】(3) LSTM 时间序列电量预测,附Tensorflow完整代码
IIS data conversion problem: 16bit to 24bit
Shanda Wangan shooting range experimental platform project - personal record (V)
Scrum Patterns之理解各种团队模式
MySQL数据库 - 连接查询
kibana 报错 server is not ready yet 可能的原因
MFC obtains local IP (used more in network communication)
How about Bohai futures. Is it safe to open futures accounts?
FFT物理意义: 1024点FFT就是1024个实数,实际进入fft的输入是1024个复数(虚部为0),输出也是1024个复数,有效的数据是前512个复数
Virtual machine performance monitoring and fault handling tools
【webrtc】Add x264 encoder for CEF/Chromium
Is meituan, a profit-making company with zero foundation, hungry? Coupon CPS applet (with source code)
Comment créer un pass BEP - 20 sur la chaîne BNB
PHP reference manual string (7.2000 words)
Unity创建超写实三维场景的一般步骤
【文本分类案例】(4) RNN、LSTM 电影评价倾向分类,附TensorFlow完整代码