
RM0351
84/1830
DocID024597 Rev 5
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:
–
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
Example
The following example shows how to map bit 2 of the byte located at SRAM1 address
0x20000300 to the alias region:
0x22006008 = 0x22 (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.
Reading address 0x22006008 returns the value (0x01 or 0x00) of bit 2 of the byte at SRAM1
address 0x20000300 (0x01: bit set; 0x00: bit reset).
For more information on bit-banding, refer to the
Cortex
®
-M4
programming manual
(see
2.4 Embedded
SRAM
The STM32L4x5/STM32L4x6 devices feature up to 320 Kbyte SRAM:
•
96 Kbyte SRAM1 and 32 Kbyte SRAM2 on STM32L475xx/476xx/486xx devices.
•
256 Kbyte SRAM1 and 64 Kbyte SRAM2 on STM32L496xx/4A6xx devices.
These SRAM can be accessed as bytes, half-words (16 bits) or full words (32 bits). These
memories can be addressed at maximum system clock frequency without wait state and
thus by both CPU and DMA.
The CPU can access the SRAM1 through the system bus or through the ICode/DCode
buses when boot from SRAM1 is selected or when physical remap is selected
(
Section 9.2.1: SYSCFG memory remap register (SYSCFG_MEMRMP)
in the SYSCFG
controller). To get the maximum performance on SRAM1 execution, physical remap should
be selected (boot or software selection).
Execution can be performed from SRAM2 with maximum performance without any remap
thanks to access through ICode bus.
On STM32L496xx/4A6xx devices, the SRAM2 is aliased at address 0x2004 0000, offering a
continuous address space with the SRAM1.
2.4.1
SRAM2 Parity check
The user can enable the SRAM2 parity check using the option bit SRAM2_PE in the user
option byte (refer to