Registered User mNo edit summary |
Registered User mNo edit summary Tag: 2017 source edit |
||
(49 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
<noinclude>{{ApplicableFor | |||
{{ | |MPUs list=STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x | ||
|MPUs checklist=STM32MP13x, STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x | |||
}} | }}</noinclude> | ||
</noinclude> | |||
==Article purpose== | |||
The purpose of this article is to: | |||
* briefly introduce the '''RETRAM''' internal memory peripheral and its main features, | |||
* indicate the peripheral instances assignment at boot time and their assignment at runtime (including whether instances can be allocated to secure contexts), | |||
* list the software frameworks and drivers managing the peripheral, | |||
* explain how to configure the peripheral. | |||
==Peripheral overview== | ==Peripheral overview== | ||
The '''RETRAM''' internal memory is 64 Kbytes wide and is physically near to the Arm<sup>®</sup> Cortex<sup>®</sup>-M4 for optimized performance from the core. | The '''RETRAM''' internal memory is located in the VSW power domain, allowing it to be supplied during Standby [[Power overview|low power mode]], and to retain retention firmware or data in Standby mode. | ||
=== | |||
Refer to [[ | ==={{MicroprocessorDevice | device=15}}=== | ||
On {{MicroprocessorDevice | device=15}}, the '''RETRAM''' internal memory is 64 Kbytes wide and is physically near to the [[Arm Cortex-M4 | Arm<sup>®</sup> Cortex<sup>®</sup>-M4]] for optimized performance from the core and to execute very quickly by the Cortex-M4 on wake up from Standby mode. | |||
<br><br> | |||
The [[Arm Cortex-M4 | Cortex-M4]] firmware has to be loaded to the '''RETRAM''' , starting at address 0x00000000. At least, it must load the part of the firmware containing the vector table, since the Arm<sup>®</sup> Cortex<sup>®</sup>-M4 reset entry point is address 0x00000004. The rest of the firmware code is loaded into the [[STM32MP15 MCU SRAM internal memory|MCU SRAM]]. The overall memory mapping is shown in the platform [[STM32MP15_RAM_mapping#Zoom_in_the_Cortex-A7-2FCortex-M4_shared_memory|memory mapping]] section. | |||
<br><br> | |||
While going to Standby [[Power overview|low power mode]], the '''RETRAM''' can remain supplied, so it can preserve a (small) Arm<sup>®</sup> Cortex<sup>®</sup>-M4 piece of retention firmware that is executed on wake up when the [[STM32 MPU ROM code overview|ROM code]] (running on Arm<sup>®</sup> Cortex<sup>®</sup>-A7) restarts the Arm<sup>®</sup> Cortex<sup>®</sup>-M4. | |||
==={{MicroprocessorDevice | device=2}}=== | |||
On {{MicroprocessorDevice | device=2}}, the '''RETRAM''' internal memory is 128 Kbytes wide and mainly dedicated to the [[Arm Cortex-M33 | Arm<sup>®</sup> Cortex<sup>®</sup>-M33]] for autonomous wakeup from low power Standby mode.</br> | |||
The [[Arm Cortex-M33 | Cortex-M33]] firmware with low power functions has to be loaded to the "RETRAM" with associated reference CRC by the main processor (TDCID) following the procedure described in the SRAM configuration controller (RAMCFG) chapter of [[STM32MP25 resources#Reference manuals|STM32MP25 reference manuals]].</br> | |||
On Standby exit, in case of wake up event assigned to Arm<sup>®</sup> Cortex<sup>®</sup>-M33, the SoC will verify the RETRAM integrity thanks to associated HW ECC and then the [[Arm Cortex-M33 | Cortex-M33]] firmware integrity by checking CRC. In case of success, the SoC will start [[Arm Cortex-M33 | Cortex-M33]] at start address of the RETRAM. Else an error will be generated and sent to main processor or a system reset generated according to system configuration.</br> | |||
Moreover RETRAM is protected by a [[RISAB internal peripheral|RISAB]] memory firewall which allows to define some memory regions with different access rights with a 4kB granularity. Each region can be assigned to the different execution contexts of the plateform. | |||
</br></br> | |||
Refer to the [[STM32 MPU resources#Reference manuals|STM32 MPU reference manuals]] for the complete list of features, and to the software frameworks and drivers, introduced below, to see which features are implemented. | |||
==Peripheral usage== | |||
This chapter is applicable in the scope of the '''OpenSTLinux BSP''' running on the Arm<sup>®</sup> Cortex<sup>®</sup>-A processor(s), and the STM32CubeMPU Package running on the Arm<sup>®</sup> Cortex<sup>®</sup>-M processor. | |||
=== | ===Boot time assignment=== | ||
The | ====On {{MicroprocessorDevice | device=15}}==== | ||
At boot time, The '''RETRAM''' internal memory can contain the Arm<sup>®</sup> Cortex<sup>®</sup>-M4 firmware, but could also be dedicated to some other usages. | |||
== | {{#lst:STM32MP1_internal_peripherals_assignment_table_template|stm32mp1_boottime}} | ||
= | <section begin=stm32mp15_boottime /> | ||
[[ | | rowspan="1" | Core/RAM | ||
| rowspan="1" | [[RETRAM internal memory|RETRAM]] | |||
| RETRAM | |||
| | |||
| | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
<section end=stm32mp15_boottime /> | |||
|} | |||
=== | ====On {{MicroprocessorDevice | device=2}}==== | ||
The RETRAM is assigned thanks to [[RISAB internal peripheral|RISAB]] configuration that allows sharing and splitting the memory into different regions. It must be done accordingly to the ecosystem usage, as define for: | |||
The | * {{MicroprocessorDevice | device=21}} [[STM32MP21_memory_mapping#RETRAM| RETRAM]] OSTL usage. | ||
* {{MicroprocessorDevice | device=23}} and {{MicroprocessorDevice | device=25}} [[STM32MP23-25_memory_mapping#RETRAM| RETRAM]] OSTL usage. | |||
RETRAM can be allocated to: | ===Runtime assignment=== | ||
* the Cortex- | ====On {{MicroprocessorDevice | device=15}}==== | ||
At runtime the '''RETRAM''' can be allocated to: | |||
* the Arm<sup>®</sup> Cortex<sup>®</sup>-M4 (default) for use with the [[STM32CubeMP15 Package architecture|STM32Cube MPU Package]], either for '''runtime firmware''' that can be mapped in both '''RETRAM''' and [[STM32MP15 MCU SRAM internal memory|MCU SRAM]], or for '''retention firmware''' that only fits into the '''RETRAM''' , | |||
or | or | ||
* the Cortex-A7 | * the Arm<sup>®</sup> Cortex<sup>®</sup>-A7 secure to be used under [[STM32 MPU OP-TEE overview|OP-TEE]], | ||
or | or | ||
* the Cortex- | * the Arm<sup>®</sup> Cortex<sup>®</sup>-A7 non-secure to be used under Linux as [[Reserved memory|reserved memory]]. | ||
{{#lst:STM32MP1_internal_peripherals_assignment_table_template|stm32mp15_runtime}} | |||
{{: | <section begin=stm32mp15_runtime /> | ||
| rowspan="1" | Core/RAM | |||
| rowspan="1" | [[RETRAM internal memory|RETRAM]] | |||
| RETRAM | |||
| <span title="assignable peripheral" style="font-size:21px">⬚</span> | |||
| <span title="assignable peripheral" style="font-size:21px">⬚</span> | |||
| <span title="system peripheral" style="font-size:21px">☑</span> | |||
| Assignment to the Arm<sup>®</sup> Cortex<sup>®</sup>-M4 if used | |||
|- | |||
<section end=stm32mp15_runtime /> | |||
|} | |||
==== | ====On {{MicroprocessorDevice | device=2}}==== | ||
{{ | The RETRAM is assigned thanks to [[RISAB internal peripheral|RISAB]] configuration that allows sharing and splitting the memory into different regions. It must be done accordingly to the ecosystem usage, as define for: | ||
* {{MicroprocessorDevice | device=21}} [[STM32MP21_memory_mapping#RETRAM| RETRAM]] OSTL usage. | |||
* {{MicroprocessorDevice | device=23}} and {{MicroprocessorDevice | device=25}} [[STM32MP23-25_memory_mapping#RETRAM| RETRAM]] OSTL usage. | |||
==Software frameworks and drivers== | |||
The '''RETRAM''' is the minimum (and default) memory for the Arm<sup>®</sup> Cortex<sup>®</sup>-M4 firmware.The software frameworks and component managing the '''RETRAM''' device to host the Arm<sup>®</sup> Cortex<sup>®</sup>-M4 firmware are listed below. | |||
* '''Linux<sup>®</sup>''': [[Reserved memory|Linux reserved memory]] and [[Linux remoteproc framework overview|Linux remoteproc framework]] | |||
* '''OP-TEE''': [[How to protect the Cortex-M coprocessor firmware#Code_source | OP-TEE remoteproc source code]] | |||
* '''STM32Cube''': [[STM32CubeMP15 Package architecture|STM32CubeMP15 Package]] and [[STM32CubeMP2 Package architecture|STM32CubeMP2 Package]] | |||
</ | * '''TF-M''':[[TF-M overview]] | ||
==How to assign and configure the peripheral== | |||
The peripheral assignment can be done via the [[STM32CubeMX]] graphical tool (and manually completed if needed).<br /> | |||
This tool also helps to configure the peripheral: | |||
* partial device trees (pin control and clock tree) generation for the OpenSTLinux software components, | |||
* HAL initialization code generation for the STM32CubeMPU Package. | |||
The configuration is applied by the firmware running in the context in which the peripheral is assigned. | |||
<noinclude> | |||
[[Category:RAM interfaces]] | |||
{{ArticleBasedOnModel | Internal peripheral article model}} | |||
{{PublicationRequestId | 8334 | 2018-08-29 | PhilipS}} | |||
</noinclude> |
Latest revision as of 17:00, 10 June 2025
1. Article purpose[edit | edit source]
The purpose of this article is to:
- briefly introduce the RETRAM internal memory peripheral and its main features,
- indicate the peripheral instances assignment at boot time and their assignment at runtime (including whether instances can be allocated to secure contexts),
- list the software frameworks and drivers managing the peripheral,
- explain how to configure the peripheral.
2. Peripheral overview[edit | edit source]
The RETRAM internal memory is located in the VSW power domain, allowing it to be supplied during Standby low power mode, and to retain retention firmware or data in Standby mode.
2.1. STM32MP15x lines
[edit | edit source]
On STM32MP15x lines , the RETRAM internal memory is 64 Kbytes wide and is physically near to the Arm® Cortex®-M4 for optimized performance from the core and to execute very quickly by the Cortex-M4 on wake up from Standby mode.
The Cortex-M4 firmware has to be loaded to the RETRAM , starting at address 0x00000000. At least, it must load the part of the firmware containing the vector table, since the Arm® Cortex®-M4 reset entry point is address 0x00000004. The rest of the firmware code is loaded into the MCU SRAM. The overall memory mapping is shown in the platform memory mapping section.
While going to Standby low power mode, the RETRAM can remain supplied, so it can preserve a (small) Arm® Cortex®-M4 piece of retention firmware that is executed on wake up when the ROM code (running on Arm® Cortex®-A7) restarts the Arm® Cortex®-M4.
2.2. STM32MP2 series[edit | edit source]
On STM32MP2 series, the RETRAM internal memory is 128 Kbytes wide and mainly dedicated to the Arm® Cortex®-M33 for autonomous wakeup from low power Standby mode.
The Cortex-M33 firmware with low power functions has to be loaded to the "RETRAM" with associated reference CRC by the main processor (TDCID) following the procedure described in the SRAM configuration controller (RAMCFG) chapter of STM32MP25 reference manuals.
On Standby exit, in case of wake up event assigned to Arm® Cortex®-M33, the SoC will verify the RETRAM integrity thanks to associated HW ECC and then the Cortex-M33 firmware integrity by checking CRC. In case of success, the SoC will start Cortex-M33 at start address of the RETRAM. Else an error will be generated and sent to main processor or a system reset generated according to system configuration.
Moreover RETRAM is protected by a RISAB memory firewall which allows to define some memory regions with different access rights with a 4kB granularity. Each region can be assigned to the different execution contexts of the plateform.
Refer to the STM32 MPU reference manuals for the complete list of features, and to the software frameworks and drivers, introduced below, to see which features are implemented.
3. Peripheral usage[edit | edit source]
This chapter is applicable in the scope of the OpenSTLinux BSP running on the Arm® Cortex®-A processor(s), and the STM32CubeMPU Package running on the Arm® Cortex®-M processor.
3.1. Boot time assignment[edit | edit source]
3.1.1. On STM32MP15x lines
[edit | edit source]
At boot time, The RETRAM internal memory can contain the Arm® Cortex®-M4 firmware, but could also be dedicated to some other usages.
Click on to expand or collapse the legend...
Domain | Peripheral | Boot time allocation | Comment ![]() | |||
---|---|---|---|---|---|---|
Instance | Cortex-A7 secure (ROM code) |
Cortex-A7 secure (TF-A BL2) |
Cortex-A7 nonsecure (U-Boot) | |||
Core/RAM | RETRAM | RETRAM | ☐ |
3.1.2. On STM32MP2 series[edit | edit source]
The RETRAM is assigned thanks to RISAB configuration that allows sharing and splitting the memory into different regions. It must be done accordingly to the ecosystem usage, as define for:
3.2. Runtime assignment[edit | edit source]
3.2.1. On STM32MP15x lines
[edit | edit source]
At runtime the RETRAM can be allocated to:
- the Arm® Cortex®-M4 (default) for use with the STM32Cube MPU Package, either for runtime firmware that can be mapped in both RETRAM and MCU SRAM, or for retention firmware that only fits into the RETRAM ,
or
- the Arm® Cortex®-A7 secure to be used under OP-TEE,
or
- the Arm® Cortex®-A7 non-secure to be used under Linux as reserved memory.
Click on to expand or collapse the legend...
Domain | Peripheral | Runtime allocation | Comment ![]() | |||
---|---|---|---|---|---|---|
Instance | Cortex-A7 secure (OP-TEE) |
Cortex-A7 nonsecure (Linux) |
Cortex-M4 (STM32Cube) | |||
Core/RAM | RETRAM | RETRAM | ⬚ | ⬚ | ☑ | Assignment to the Arm® Cortex®-M4 if used |
3.2.2. On STM32MP2 series[edit | edit source]
The RETRAM is assigned thanks to RISAB configuration that allows sharing and splitting the memory into different regions. It must be done accordingly to the ecosystem usage, as define for:
4. Software frameworks and drivers[edit | edit source]
The RETRAM is the minimum (and default) memory for the Arm® Cortex®-M4 firmware.The software frameworks and component managing the RETRAM device to host the Arm® Cortex®-M4 firmware are listed below.
- Linux®: Linux reserved memory and Linux remoteproc framework
- OP-TEE: OP-TEE remoteproc source code
- STM32Cube: STM32CubeMP15 Package and STM32CubeMP2 Package
- TF-M:TF-M overview
5. How to assign and configure the peripheral[edit | edit source]
The peripheral assignment can be done via the STM32CubeMX graphical tool (and manually completed if needed).
This tool also helps to configure the peripheral:
- partial device trees (pin control and clock tree) generation for the OpenSTLinux software components,
- HAL initialization code generation for the STM32CubeMPU Package.
The configuration is applied by the firmware running in the context in which the peripheral is assigned.