当前位置:网站首页>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数据库 - 单表查询(二)
- The textarea cursor cannot be controlled by the keyboard due to antd dropdown + modal + textarea
- Garbage collector and memory allocation strategy
- Openharmony open source developer growth plan, looking for new open source forces that change the world!
- 山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(六)
- Steps to build a deep learning environment GPU
- PHP reference manual string (7.2000 words)
- IIS数据转换问题16bit转24bit
- Fundamentals of programming language (2)
- Openharmony open source developer growth plan, looking for new open source forces that change the world!
猜你喜欢
[numerical prediction case] (3) LSTM time series electricity quantity prediction, with tensorflow complete code attached
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(六)
【webrtc】Add x264 encoder for CEF/Chromium
Scrum Patterns之理解各种团队模式
@MapperScan与@Mapper
Distinction between pointer array and array pointer
MySQL syntax collation
Comment créer un pass BEP - 20 sur la chaîne BNB
Openharmony open source developer growth plan, looking for new open source forces that change the world!
Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (6)
随机推荐
Class loading mechanism
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(八)
【数值预测案例】(3) LSTM 时间序列电量预测,附Tensorflow完整代码
Openharmony open source developer growth plan, looking for new open source forces that change the world!
Kubernetes getting started to proficient - install openelb on kubernetes
ESP8266-入门第一篇
Database query - course selection system
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(七)
指针数组与数组指针的区分
Kubernetes introduction to mastery - ktconnect (full name: kubernetes toolkit connect) is a small tool based on kubernetes environment to improve the efficiency of local test joint debugging.
山大网安靶场实验平台项目-个人记录(五)
如何在BNB链上创建BEP-20通证
【2022】将3D目标检测看作序列预测-Point2Seq: Detecting 3D Objects as Sequences
Mysql database - single table query (I)
Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (6)
Why is the hexadecimal printf output of C language sometimes with 0xff and sometimes not
Decompile and get the source code of any wechat applet - just read this (latest)
Deep learning -- Summary of Feature Engineering
Understanding various team patterns in scrum patterns
NiO related Basics