cancel
Showing results for 
Search instead for 
Did you mean: 

STPMIC with STM32H7B3VIH6

jaehoon
Associate III

I've designed a custom board and, I'm writing my own firmware that controls STPMIC.

While writing a general-purpose driver library to enable future use in other hobby projects, I ran into a few questions.
my own general-purpose driver library is: https://github.com/jay94ks/stpmic

 

1. MAIN vs. ALTERNATIVE.
Does this switch automatically based on low-power requirements, or is it something that needs to be configured separately? Or is it the same behavior, but can one side be used for low-power operation when needed?

The PWRCTRL_EN and PWRCTRL polarity bits are described as being used to switch between these two modes. If so, is it possible to switch between these modes solely through software, without any physical pins?

 

2. How many times can I program the NVM?
I placed an order with JLCPCB while designing my hobby project board, but they only had the APQR STPMIC1 in stock, so I couldn't order the CPQR. So, I decided to program the NVM. Is there a limit to the number of times I can write and write to the NVM registers? Also, is it possible to reset the NVM registers to their default state? (For cost reasons, I'm planning to remove the soldered chip and reuse it.) ---> I found this from datasheet when I'm writing this post. (1000 cycle)

 

3. nRST pins and forced pull down(?) of each buck outputs.

This problem has been bothering me for a long time. When I tied the nRST pin of STPMIC and the nRST pin of MCU together, when uploading firmware with STLink, the register of PMIC was also reset and the voltage on the VCC line was completely cut off and then on.

So, I had to solder the debugger 3V3 to the output of BUCK4 to supply power. However, I encountered a few other problems during this process, and I found a way around it. When power was not supplied to the VIN of the STPMIC, the voltage only showed 0V to 1V, as if there was like `pull-down` (even when 3V3 was supplied externally!)

This made writing and testing PMIC drivers incredibly difficult. This issue resulted in the entire board being disabled with just a slight mistake. Every time that happened, I had to remove the inductor at BUCK4 and connect only the external power supply to solve the problem. (I also had to change the BOOT0 pin to high. PHYSICALLY)

When used with the STM32MP series, the nRST can be connected to the STM32 Cube programmer, allowing for proper timing and flashing. And, I realized that connecting it to the STM32H7B3VIH6 was useless. Since I was using it to manage the PMIC's individual BUCKs and LDOs to improve power efficiency, it wasn't necessary. I just thought that connecting the two would allow the PMIC's OCP to manage them properly.

So, must the nRSTs of the two chips be tied to each other?
If I absolutely must tie two pins together, is there any other elegant way to solve the problem described above?

2 REPLIES 2
Vincenzo
ST Employee

Hello jaehoon,

 

1. MAIN vs. ALTERNATIVE.

Main and Alternate are two different pages where you can program how your application operates.

High power or low power,or inversely, it depends on your needs. The trick to use the software control is to 

high (or low) PWRCONTROL input and use the PWRCTRL_EN to change MAIN and ALTERNATE.

 

3. nRST pins and forced pull down(?) of each buck outputs.

If I understood your problem you can use MASK_RESET for Buck3 so the output voltage for VIO is always present during the reset time.

 

Regards,

Vincenzo

Thanks!

I have a further question regarding NVM.
My understanding of NVM write operations is as follows:

 

NVM write operation.
--> read operation is automatically done at PRELOAD_NVM.

1) make STPMIC1 to POWER_ON state.
2) write NVM shadow registers: e.g. NVM_MAIN_CTRL_SHR, LDOS_RANK_SHR1... etc...
3) NVM_CMD = 01 (PROGRAM bit).
4) wait `NVM_SR & 0x01` to be cleared (BUSY bit).
5) NVM_CMD = 10 (READ bit).
6) wait `NVM_SR & 0x01` to be cleared (BUSY bit).
7) check contents written.

 

After programming the NVM like this,
I understood that I could check it written well by reading each SHR one by one.

So, is there a way to know how many times I've had reprogram?