STM32CubeProgrammer PMIC NVM management

Revision as of 20:07, 16 February 2024 by Registered User
Applicable for STM32MP13x lines, STM32MP15x lines, STM32MP25x lines

Renaming.png This page is a candidate for renaming (move).
The requested new name is: STM32CubeProgrammer PMIC NVM management .
The supplied reason is: no specific to STPMIC1, generic to all PMIC .
-- <signature>.
Wiki maintainers: remember to update the pages that link this page before renaming (moving) it.

STM32CubeProgrammer (STM32CubeProg) can be used with STM32PRGFW-UTIL to read and update the non-volatile memory (NVM) of the power management IC (PMIC) on the STM32 MPU board, which is seen as a specific partition on the device.

This page describes the format of the partition used by the embedded programming service to allow PMIC NVM access by STM32CubeProgrammer (see AN5275: USB DFU/USART protocols used in STM32MP1 series bootloaders for protocol details).

Refer to STM32CubeProgrammer article to know how to use the STM32CubeProgrammer and to STM32PRGFW-UTIL README.md to know how to use the STM32PRGFW-UTIL, which are the official STMicroelectronics tools to update the PMIC NVM on STM32 MPU platforms.

1. PMIC NVM partition[edit source]

The PMIC NVM partition is identified by the reserved Id 0xF4:

  • it is exported (when the IC is present on the board) as a specific alternate setting of the USB DFU [1]
  • it accessible with commands of the UART protocol in AN5275
    • Download command (0x31) with Packet number=0xF4000000: 0xF4 for Special operation: PMIC NVM and 0x0 address
    • Read partition command (0x12) with partition Id = 0xF4.

This optional partition is programmed without header.

It is supported in STM32PRGFW-UTIL, the only supported tools for PMIC NVM update in ecosystem release ≥ v5.1.0 More info.png .

For read operation, the host requests the PMIC NVM partition data and the platform replies with all the partition content.

For write operation, the host must send the full partition containing one or more modifications (any reserved bit must be preserved).

Info white.png Information
In OpenSTLinux, the PMIC STPMIC1 is handled in the secured world by OP-TEE ecosystem release ≥ v4.0.0 , the PMIC NVM update is no more supported in U-Boot.

1.1. STPMIC1 NVM partition[edit source]

For STPMIC1, the NVM partition has a fixed size of 8 bytes and exports in R/W the NVM shadow registers bytes (Address 0xF8 to 0xFF) as defined in STPMIC1 datasheet: DS12792.

NVM
offset
STPMIC1
Address
NVM user shadow register
0 0xF8 NVM_ON_OFF_CTRL_SHR
1 0xF9 NVM_BUCK_RANK_SHR
2 0xFA NVM_LDO14_RANK_SHR
3 0xFB NVM_LDO56_VREF_RANK_SHR
4 0xFC NVM_BUCKS_VOUT_SHR
5 0xFD NVM_LDO13_VOUT_SHR
6 0xFE NVM_LDO56_VOUT_SHR
7 0xFF NVM_DEV_ADDR_SHR

1.2. STPMIC2 NVM partition[edit source]

For STPMIC2, the NVM partition has a fixed size of 38 bytes and exports in R/W the NVM shadow registers bytes (Address 0x90 to 0xB7) as defined in STPMIC25 datasheet: DS14278.

NVM
offset
STPMIC25
Address
NVM user shadow register
0 0x90 MAIN_CTRL_SHR1
1 0x91 MAIN_CTRL_SHR2
2 0x92 RANK_SHR1
3 0x93 RANK_SHR2
4 0x94 RANK_SHR3
5 0x95 RANK_SHR4
6 0x96 RANK_SHR5
7 0x97 RANK_SHR6
8 0x98 RANK_SHR7
9 0x99 RANK_SHR8
10 0x9A BUCK_MODE_SHR1
11 0x9C BUCK1_VOUT_SHR
12 0x9D BUCK2_VOUT_SHR
13 0x9E BUCK3_VOUT_SHR
14 0x9F BUCK4_VOUT_SHR
15 0xA0 BUCK5_VOUT_SHR
16 0xA1 BUCK6_VOUT_SHR
17 0xA2 BUCK7_VOUT_SHR
18 0xA3 LDO2_SHR
19 0xA4 LDO3_SHR
20 0xA5 LDO5_SHR
21 0xA6 LDO6_SHR
22 0xA7 LDO7_SHR
23 0xA8 LDO8_SHR
24 0xA9 PD_SHR1
25 0xAB PD_SHR3
26 0xAC BUCKS_IOUT_SHR1
27 0xAD BUCKS_IOUT_SHR2
28 0xAE LDOS_IOUT_SHR
29 0xAF FS_OCP_SHR1
30 0xB0 FS_OCP_SHR2
31 0xB1 FS_SHR1
32 0xB2 FS_SHR2
33 0xB3 FS_SHR3
34 0xB4 BUCK_AUTOCAL_S
35 0xB5 I2C_ADDR_SHR
36 0xB6 USER_SHR1
37 0xB7 USER_SHR2

2. PMIC NVM programming via CLI[edit source]

The purpose of the tool is to facilitate the programming of the STPMIC with STM32PRGFW-UTIL by providing a dedicated command line interface (not available through the GUI) that simplifies the detection and selection of the appropriate partition for both UART and DFU interfaces.

Syntax: -pmic <PMIC_file_path>

<PMIC_file_path> : Indicate the binary file path (8 Bytes as length).

See STM32CubeProgrammer article and STM32PRGFW-UTIL for details.

3. Reference list[edit source]