STM32 on-Chip flash memory map, page size, register map

Source: Internet
Author: User

Transferred from: http://blog.chinaunix.net/uid-20617446-id-3847242.html

First, how to see the size of flash

1.1 By model

model will be printed on the MCU surface, can be obtained by observation, my is stm32f103rBT6 (The following analysis based on this model), the control of the STM32 product name, Stm32f103rbt6 Flash is 128KB.

()

Figure 1 Ordering Information scheme

1.2 via data sheet (memory map)

Flash size can also be obtained from the data sheet, first according to the model from the official website of the corresponding data sheet datasheet (click here, enter the MCU model for retrieval.) STM32F103RB related manuals are here: http://www.st.com/internet/mcu/product/164487.jsp), open to find the memory map of this picture, 2 red box shown (Figure 2 red box magnification is figure 3), Flash in memory mapping address 0x0800 0000 ~ 0x0801 FFFF, that is, the size of 128KB. This method can also be used to understand the memory mapping on-chip flash.

Figure 2 Memory Map

Figure 3 SRAM and Flash in Memory map

Second, block size

for systems, Flash is divided into flash on-chip (Embedded Flash) and external flash. Generally speaking, flash first divided into pieces of pages, erase is done by block, so the argument should be just external flash, for on-chip flash can be erased by the page can also erase the whole block, the English original is as follows [2]:

    1. The flash memory erase operation can be performed at page level or in the whole Flash area (mass-erase). The mass-erase does not affect the information blocks.

Three, page size

According to the 1.2 method of the MCU reference Manual, stm32f103rBT6 corresponding reference manual for RM0008 Reference manual, positioning to Embedded Flash memory chapter ( You can also locate by searching 0x0800 0000来). STM32 has 4 kinds of Flash module organization, namely: low-density devices (32kb,1kb/page), medium-density devices (128kb,1kb/page), High-density devices (512kb,2kb/page), Connectivity Line devices (256kb,2kb/page), xl-density (Devices (1m,2kb/page). From the above analysis, the stm32f103rBT6 Flash is 128KB, visible is medium-density devices, as shown:

Figure 4 Flash Module Organization (medium-density devices)

Iv. Flash Related Registers

The flash registers are mapped in memory as follows [1]:

Figure 5 Flash Interface in Memory map

Flash registers the specific address is as follows [2]:

Figure 6 Flash Memory Interface Registers of medium-density devices

Specific to each register function, the bit meaning, the reference [3],flash register mapping is as follows:

Figure 7 Flash Register Map

Five, information block

The memory map of information block in Flash is as follows [1]:

Figure 8 System memory in memory map

The specific flash information block address is as follows:

Figure 9 Information block of medium-density devices

system memory contains a section of the boot program (when the systems from the flash on-chip will be used), Flash factory can not be modified, do not know I understand right, posted the original text as follows [3]:

    1. System memory is used-boot the device in System memory boot mode. The area was reserved for use by STMicroelectronics and contains the boot loader which are used to reprogram the Flash Memor Y using the USART1 serial interface. It is programmed by ST when the device is manufactured, and protected against spurious write/erase operations. For further details, refer to AN2606.

THe option bytes is managed by an embedded Flash program/erase Controller (FPEC), see [3] for details.

Resources:

[1] ds5319:medium-density performance line arm-based 32-bit MCU with 7 KB Flash, USB, CAN, timers, 2 ADCs, 9 Co Mmunication Interfaces (data sheet) ds5319.pdf

[2] rm0008:stm32f101xx, stm32f102xx, stm32f103xx, stm32f105xx and stm32f107xx advanced arm-based 32-bit MCUs (Reference manual) Note: file ruler "Too big to upload:-(

[3] pm0075:stm32f10xxx flash memory microcontrollers (Flash programming Manual) Pm0075.pdf

STM32 on-Chip flash memory map, page size, register map

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.