Flash Memory Overview; Bit Banding - ST STM32F412 Reference Manual

Advanced arm-based 32-bit mcus
Table of Contents

Advertisement

(Section 7.2.1: SYSCFG memory remap register (SYSCFG_MEMRMP)
controller). To get the max performance on SRAM execution, physical remap should be
selected (boot or software selection).
2.4

Flash memory overview

The Flash memory interface manages CPU AHB I-Code and D-Code accesses to the Flash
memory. It implements the erase and program Flash memory operations and the read and
write protection mechanisms. It accelerates code execution with a system of instruction
prefetch and cache lines.
The Flash memory is organized as follows:
A main memory block divided into sectors.
System memory from which the device boots in System memory boot mode
512 OTP (one-time programmable) bytes for user data.
Option bytes to configure read and write protection, BOR level, watchdog
software/hardware and reset when the device is in Standby or Stop mode.
Refer to
2.5

Bit banding

The Cortex
each word in an alias region of memory to a bit in a bit-band region of memory. Writing to a
word in the alias region has the same effect as a read-modify-write operation on the
targeted bit in the bit-band region.
In the STM32F412xx devices both the peripheral registers and the SRAM1 are mapped to a
bit-band region, so that single bit-band write and read operations are allowed. The
operations are only available for Cortex
masters (e.g. DMA).
A mapping formula shows how to reference each word in the alias region to a corresponding
bit in the bit-band region. The mapping formula is:
bit_word_addr = bit_band_base + (byte_offset x 32) + (bit_number × 4)
where:
Example
The following example shows how to map bit 2 of the byte located at SRAM1 address
0x20000300 to the alias region:
0x22006008 = 0x22000000 + (0x300*32) + (2*4)
Writing to address 0x22006008 has the same effect as a read-modify-write operation on bit
2 of the byte at SRAM1 address 0x20000300.
54/1163
Section 3: Embedded Flash memory interface
®
-M4 with FPU memory map includes two bit-band regions. These regions map
bit_word_addr is the address of the word in the alias memory region that maps to
the targeted bit
bit_band_base is the starting address of the alias region
byte_offset is the number of the byte in the bit-band region that contains the
targeted bit
bit_number is the bit position (0-7) of the targeted bit
®
-M4 with FPU accesses, and not from other bus
RM0402 Rev 6
in the SYSCFG
for more details.
RM0402

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F412 and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF