当前位置:网站首页>Flash memory usage and stm32subemx installation tutorial [day 3]
Flash memory usage and stm32subemx installation tutorial [day 3]
2022-07-27 09:42:00 【Red guest white hat】
flash Flash memory usage and STM32CUBEMX Installation tutorial
【1】STM32 FLASH
Flash Internal memory , A kind of memory device , It's a kind of nonvolatile ( Non-Volatile ) Memory .
flash Flash memory is nonvolatile memory , It can be rewritten and reprogrammed for the memory cell block of the block . whatever flash The write operation of the device can only be carried out in the empty or erased cell , So most of the time , Erase must be performed before writing .

` Development board STM32F407ZET6 Of flash size :512KB The program solidified to FLASH, Need to be right BOOT0 And BOOT1 Set it up `


【2】 The embedded Flash Interface
The main features ● Flash Read operations
● Flash Programming / Erase operation
● read / Write protect
● I-Code Prefetch operation on
● I-Code Upper 64 Cache ( 128 A wide )
● D-Code Upper 8 Cache ( 128 A wide )
【3】 The embedded Flash
Flash It has the following main characteristics :
● about STM32F40x and STM32F41x, Capacity as high as 1 MB; about STM32F42x and STM32F43x,
Capacity as high as 2 MB
● 128 Bit width data reading
● byte 、 Half word ( Two bytes )、 word ( Four bytes ) And double word data writing
● Sector erase and full erase
● Memory organization structure
Flash The structure is as follows :
— , It is divided into 4 individual 16 KB A sector 、 1 individual 64 KB Sectors and 7 individual 128 KB A sector
— The system is stored in the main memory block storage , The device starts from the system memory in bootstrap mode
— 512 byte OTP( One time programmable ), For storing user data
OTP Area and 16 Two extra bytes , Used to lock the corresponding OTP Data blocks .
— Option bytes , Used to configure read / write protection 、 BOR Level 、 Software / The hardware watchdog and devices are in standby or
Reset in stop mode .

【4】FLASH Write data function
// Write two words (8 Bytes )
FLASH_Status FLASH_ProgramDoubleWord(uint32_t Address, uint64_t Data);
// Write (4 Bytes )
FLASH_Status FLASH_ProgramWord(uint32_t Address, uint32_t Data);
// Write half a word (2 Bytes )
FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data);
// Write Bytes (1 Bytes )
FLASH_Status FLASH_ProgramByte(uint32_t Address, uint8_t Data);
【5】FLASH receive data
void Flash_Read(u32 addr, u8* read_buff, u32 len)
{
u32 FLASH_USER_START_ADDR, FLASH_USER_END_ADDR, uwAddress;
// Calculation start address
FLASH_USER_START_ADDR = addr;
// Calculation end address
FLASH_USER_END_ADDR = FLASH_USER_START_ADDR+len;
uwAddress = FLASH_USER_START_ADDR; //0x08020000
while (uwAddress < FLASH_USER_END_ADDR)
{
*read_buff = *(__IO uint8_t*)uwAddress; // Dereference read data from sector Read character by character
read_buff++;
uwAddress = uwAddress + 1;
}
【6】STM32CUBEMX
1、HAL library
【1】HAL yes Hardware Abstraction Layer Abbreviation , Chinese name : Hardware abstraction layer .HAL Kuo is ST by STM32 The latest abstract layer embedded software , It can better ensure cross STM32 Maximum portability of the product . The library provides a consistent set of middleware components , Such as RTOS,USB,TCP/ IP And graphics etc. .
【2】 HAL The library is based on a non limitingBSD license agreement(Berkeley Software
Distribution) And released open source code .
【3】 ST Made middleware stack (USB Host and device library ,STemWin) With license patterns that allow easy reuse , As long as it's in the ST The company's MCU Use on chip , Middleware in the library (USB host / Equipment library ,STemWin) The protocol stack is allowed to be modified at will , And can be used repeatedly . As for middleware based on other well-known open source solutions (FreeRTOS,FatFs,LwIP and PolarSSL) They also have friendly user license terms .【4】 so to speak HAL Library is used to replace the previous standard peripheral Library . Compared to the standard peripheral Library ,STM32Cube HAL The library shows a higher level of abstract integration ,HAL API Focus on the common functions of peripheral devices , In this way, it is convenient to define a general set of users API The function interface , So it can be easily realized from a STM32 The product was ported to a different STM32 Series of products .HAL Kuo is ST The library that will be promoted in the future , From the year before ST There is no new chip STD The library , such as F7 series . at present ,
HAL The library already supports STM32 All line products .
ST Provide library functions : Standard library 、LL library 、HAL
Graphic development methods :STM32CUBEMX+KEIL STM32CUBEIDE(STM32CUBEMX+KEIL)
【7】 Software installation steps
1、 install keil Software
2、 Double click installation HAL library
STM32 All series are up to date HAL Library Download
link :https://pan.baidu.com/s/127B1NmYHPLc Address cUjzjxCiG0w
Extraction code :abeg
【8】 install STM32CUBEMX
Download url :https://blog.csdn.net/wwwqqq2014/article/details/116292865
1、STM32CubeMX Software introduction
STM32CubeMX It is a graphical configuration tool launched by Italian French semiconductor , The relevant configuration can be realized through the operation of fool , Finally, it can generate C The language code , It supports a variety of tool chains. At present, it provides a completely free version , also , Plug in installation , Can be STM32CubeMX Integrated in one IDE, It's very convenient to use . Next, let's install it
Preparation stage :
link :https://pan.baidu.com/s/1CYGH2LevHiOj9O34L38Uzg
Extraction code :ujvv
Software installation steps
1、 Double chicken installation ( Or run the installation with administrator privileges )STM32CubeMX What software needs java Environmental Science .

Installing ...................
installation is complete , Click close to

2、 Double click installation
( Or run the installation with administrator privileges )STM32CubeMX Software .
Loading ...........
Installing ..................
3、 open STM32CubeMX
( The opening process may be a little long , Wait a minute no ), install STM32CubeMX Software development package

Downloading package , And install , Wait for .







Above is STM32CubeMX The whole process of installation . After installation , You can do your own STM32CubeMX The journey of development .
3、 Development steps
1、 From chip build engineering 

2、 Set the clock 

3、 Pin settings

4、 Code generation settings 

4、 The generated code

【END】 SA yo Na yo
边栏推荐
- 【云原生】我怎么会和这个数据库杠上了?
- July training (day 12) - linked list
- Meeting seating function of conference OA project & Implementation of meeting submission for approval
- 年底了,我教你怎么拿高绩效!
- 曝光一位出身寒门的技术大佬
- XML概述
- 吃透Chisel语言.25.Chisel进阶之输入信号处理(一)——异步输入与去抖动
- Expose a technology boss from a poor family
- Google Earth Engine APP——利用S2影像进行最大值影像合成分析
- 习题 --- 快排、归并、浮点数二分
猜你喜欢

Eureka 延迟注册的一个坑

吃透Chisel语言.22.Chisel时序电路(二)——Chisel计数器(Counter)详解:计数器、定时器和脉宽调制

Sentinel 万字教程 | 文末送书
![[wechat applet] lunar calendar and Gregorian calendar are mutually converted](/img/6e/ad01756f8da54901a64c5323e4b747.png)
[wechat applet] lunar calendar and Gregorian calendar are mutually converted

flash闪存使用和STM32CUBEMX安装教程【第三天】

It's great to write code for 32 inch curved screen display! Send another one!

电机控制器中的MOS驱动

ESP8266-Arduino编程实例-PWM

快应用JS自定义月相变化效果
![[Wuhan University of technology] information sharing for the preliminary and second examinations of postgraduate entrance examination](/img/15/298ea6f7367741e1e085007c498e51.jpg)
[Wuhan University of technology] information sharing for the preliminary and second examinations of postgraduate entrance examination
随机推荐
32寸曲面屏显示器写代码太爽了!再送一台!
Interviewer: what is scaffolding? Why do you need scaffolding? What are the commonly used scaffolds?
S switch stacking scheme configuration guide
吃透Chisel语言.22.Chisel时序电路(二)——Chisel计数器(Counter)详解:计数器、定时器和脉宽调制
1344. Included angle of clock pointer
Google Earth engine app - maximum image synthesis analysis using S2 image
Fundamentals of Materials Engineering - key points
WordPress prohibits login or registration of plug-ins with a specified user name [v1.0]
Voice live broadcast system - Principles to be followed in developing push notifications
七月集训(第04天) —— 贪心
At the end of the year, I'll teach you how to get high performance!
Esp8266 Arduino programming example ADC
吃透Chisel语言.27.Chisel进阶之有限状态机(一)——基本有限状态机(Moore机)
July training (day 15) - depth first search
[raspberry pie] box related manual-4 web agent
快应用JS自定义月相变化效果
如果mysql磁盘满了,会发生什么?还真被我遇到了!
材料工程基础-重点
[cloud native] how can I compete with this database?
Understand chisel language. 27. Chisel advanced finite state machine (I) -- basic finite state machine (Moore machine)




