PMIC NVM programming

The STM32CubeProgrammer PMIC NVM window is available exclusively for MPU devices. It extracts the PMIC partition [ID 0xF4] using the PRGFW-UTIL interface to read, display, and program the PMIC NVM registers. STPMIC1 has 8 registers and STPMIC25 has 40 registers, each register with a 1-byte size.

PRGFW-UTIL can be downloaded from ST GitHub: STMicroelectronics/STM32PRGFW-UTIL.

The UI has five main features:

  1. Get the PMIC information.

  2. Read and display PMIC registers.

  3. Edit and program PMIC registers.

  4. Program a binary file, only for the entire PMIC registers, since partial

    register programming is not supported.

  5. Save or export the PMIC registers, NVM partition, in an output binary file.

To begin reading the PMIC partition, open the PMIC NVM window by pressing the NVM button located in the main window. Once the partition is successfully read, data are displayed in a table format.

../../../_images/PMIC_NVM_programming-Fig149.webp

Fig. 101 PMIC NVM window

Get PMIC NVM structure information

This section displays an overview of the device.

  • Structure version: version 1 so far.

  • Ref ID: STPMIC1, STPMIC25, STPMIC2L, or STPMIC1L.

  • NVM ID: Customized, A, B, or C.

  • I2C address: the address that PRGFW-UTIL uses to communicate with PMIC.

Read and display words

After checking the PMIC partition, the tool decodes and shows the words in table view format including four columns:

  • Name: NVM register name.

  • Address: hexadecimal value representing the address in the NVM.

  • Value: hexadecimal value, editable.

  • Description: displays the description of the register and its fields.

Note

Press the Read button to refresh all table fields or discard changes.

The value and name cells expose a tooltip message to add description, name, hex value, and binary value representation.

Edit and program registers

There are two ways to edit the value of the register:

  1. Use the combo box with a list of possible values.

  2. Directly write the register value in the text field and press Enter

    after each change.

The modified element is highlighted in red.

After modification, it is mandatory to press the Apply button and confirm the operation to start the update and refresh the table view.

Program binary file

To program a binary file into the PMIC NVM register, it is necessary to take care about the following points:

  1. Select the adequate binary having a .bin extension.

  2. The file size must have the exact size of the PMIC NVM registers partition,

    for example STPMIC1 8 Bytes and STPMIC25 40 Bytes.

  3. Using an incorrect file may risk damaging the board.

  4. Press the Program button to start the download sequence.

Note

If the binary file contains the same content as the NVM registers, the tool takes no action.

Save/Export PMIC NVM partition

This capability allows saving the whole content of the PMIC NVM partition into a binary file with .bin extension or into an output text file in human-readable format, which can be used for future analysis or to archive the current device configuration.

Press Save or Export and choose the desired output file name and directory. If the save operation is completed successfully, an informational dialog appears to confirm the completion of the process.

Note

PRGFW-UTIL firmware must be installed before launching the PMIC NVM window, which is necessary to expose the PMIC partition. It is mandatory to use an adequate version of PRGFW-UTIL that supports the new PMIC structure format, version 1 or later. Otherwise the tool shows an error message.