当前位置:网站首页>STM32基础知识
STM32基础知识
2022-04-23 19:47:00 【花开半朵ོ】
首先肯定是要熟悉一下stm32(stm32g431rbt6)板子的布局了
其实过一遍就可以大概记住什么东西在哪个位置了。
然后就是原理图,熟悉各个引脚的功能
上面的DAP Link和 目标MCU也就是板子上的这两个东西,被那个LCD给挡住了
再看看芯片的命名规则
其实和51或者是15的差不多。15、51都是8位单片机,每个地址都是由8位组成的,地址可以表示为:0x_ _,而32是32位的,地址可以表示为:0x_ _ _ _ _ _ _ _,所以51、15最多可访问255的地址,而32可以访问4G的地址。
下面看看stm32内部结构
红色圈起来的相当于内部的CPU,然后通过总线连接各个资源,有两个总线AHB1和AHB2,挂着各种资源,这要顺着看下去,应该就可以了解其内部的分布了。(这么看的话,就好像相当于一张地图,你想找哪个,顺着线路找下去,或者像人的身体系统)
要编写stm32程序首先要用STM32CubeMX自动生成一些底层代码,第一步就是要配置时钟了,一开始看到时钟配置界面的时候其实很害怕,因为看不懂(哭笑不得)。。。
看一看下面这张图
不过这样顺藤摸瓜下来还是可以看懂一点的,相同颜色椭圆圈起来的的说明他们是同一个。绿色椭圆圈出来的,可以看出, 我们使用的是高速外部时钟,那stm32系统时钟是通过高速外部时钟和高速内部时钟通过PPL的配置再给主频
所以,我们配置时钟模式的时候。
时钟配置也是一目了然了
stm的内部资源地址(存储地址)
SRAM起始地址:0X2000 0000
外设起始地址:0X4000 0000
flash起始地址:0X0800 0000
再低层一点的东西我也不太了解了。。
HAL库和LL库:
HAL库 (Hardware Abstraction Layer)是ST官方推崇的新编程库,HAL库是ST为STM32最新推出的抽象层嵌入式软件,可以更好的确保跨STM32产品的最大可移植性。HAL使用了比较大的Flash和SRAM。
LL库(Low Layer) 是ST最近新增的库,与HAL捆绑发布,文档也是和HAL文档在一起的LL库更接近硬件层,对需要复杂上层协议栈的外设不适用,直接操作寄存器。其支持所有外设。使用方法:独立使用,该库完全独立实现,可以完全抛开HAL库,只用LL库编程完成。在使STM32CubeMX生成项目时,直接选LL库即可。如果使用了复杂的外设,例如USB,则会调用HAL库混合使用,和HAL库结合使用。编译后LL库只有HAL库的33%体积。
版权声明
本文为[花开半朵ོ]所创,转载请带上原文链接,感谢
https://blog.csdn.net/m0_54929728/article/details/124360968
边栏推荐
- Mysql database - basic operation of database and table (II)
- Data analysis learning directory
- Openharmony open source developer growth plan, looking for new open source forces that change the world!
- MFCC: Mel频率倒谱系数计算感知频率和实际频率转换
- Golang timer
- 5 minutes to achieve wechat cloud applet payment function (including source code)
- Go recursively loops through folders
- Scrum Patterns之理解各种团队模式
- 基于pytorch搭建GoogleNet神经网络用于花类识别
- 程序设计语言基础(2)
猜你喜欢
MySQL lock
[text classification cases] (4) RNN and LSTM film evaluation Tendency Classification, with tensorflow complete code attached
C6748 软件仿真和硬件测试 ---附详细FFT硬件测量时间
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
[report] Microsoft: application of deep learning methods in speech enhancement
Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(八)
Building googlenet neural network based on pytorch for flower recognition
Lottery applet, mother no longer have to worry about who does the dishes (assign tasks), so easy
Physical meaning of FFT: 1024 point FFT is 1024 real numbers. The actual input to FFT is 1024 complex numbers (imaginary part is 0), and the output is also 1024 complex numbers. The effective data is
随机推荐
Inject Autowired fields into ordinary beans
Fundamentals of programming language (2)
MySQL syntax collation (4)
【数值预测案例】(3) LSTM 时间序列电量预测,附Tensorflow完整代码
基于pytorch搭建GoogleNet神经网络用于花类识别
Class loading mechanism
C语言的十六进制printf为何输出有时候输出带0xFF有时没有
uIP1.0 主动发送的问题理解
Kubernetes入门到精通-KtConnect(全称Kubernetes Toolkit Connect)是一款基于Kubernetes环境用于提高本地测试联调效率的小工具。
The usage of slice and the difference between slice and array
MySQL syntax collation
SRS deployment
The textarea cursor cannot be controlled by the keyboard due to antd dropdown + modal + textarea
MFC获取本机IP(网络通讯时用得多)
Prefer composition to inheritance
Kubernetes入门到精通-在 Kubernetes 上安装 OpenELB
Design of warehouse management database system
山大网安靶场实验平台项目-个人记录(五)
Mysql database - single table query (I)
[2022] regard 3D target detection as sequence prediction - point2seq: detecting 3D objects as sequences