STM32CubeProgrammer STPMIC1 NVM management

Revision as of 18:11, 13 February 2024 by Registered User
Applicable for STM32MP13x lines, STM32MP15x lines

STM32CubeProgrammer (STM32CubeProg) can be used to read and update the non-volatile memory (NVM) of the power management IC (PMIC) on the 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, which is the official STMicroelectronics tool 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 Download command (Packet number=0xF4000000 with 0xF4 for Special operation: PMIC NVM) and Read partition command (with partition Id = 0xF4) command of the UART protocol in AN5275.

This optional partition is programmed without header.

It is supported:

  • in STM32PRGFW-UTIL, the only supported tools in ecosystem release ≥ v5.0.0 More info.png ,
  • in U-Boot when PMIC STPMIC1 is not handled in the secured world by OP-TEE; in ecosystem release ≥ v4.0.0 , this partition is not supported by default.

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).

2. 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.

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

3. STPMIC1 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.

4. Reference list[edit source]