Skip to main content
Dat Tran
Senior II
December 14, 2023
Question

STM32MP153 - How to drive PWR_ON pin to low

  • December 14, 2023
  • 1 reply
  • 1050 views

Hi, 

We would like to drive pin PWR_ON to low for low power mode.

First, on MCU, we use HAL library: HAL_PWR_EnterSTANDBYMode(), load to M4 and run it first, so M4 now enter standby mode.

Second, on MPU, we set TZEN=0 so non-secure, allow us to modify PWR and RCC registers.

We write a small application, using devmem to change registers, code is below:

...

int main() {
    Register.SetBits(PWR_MPUCR, 1 << 9); //PWR_MPUCR_CSSF
    Register.SetBits(PWR_MPUCR, 1 << 3); //PWR_MPUCR_CSTBYDIS
    Register.SetBits(PWR_MPUCR, 1 << 0); //PWR_MPUCR_PDDS

    Register.SetBits(PWR_CR1, 1 << 0); //LPDS
    Register.SetBits(PWR_CR1, 1 << 1); //LPCFG
    Register.SetBits(PWR_CR1, 1 << 2); //LVDS

    Register.Write(RCC_MP_SREQSETR, 1 << 0);//RCC_MP_SREQSETR_STPREQ
    Register.Write(RCC_MP_RSTSCLRR, 0x7FF);//RCC_MP_RSTSCLRR => clear reset flags

    __asm volatile ("dsb" : : : "memory");
    __asm volatile ("isb" : : : "memory");
 
    __asm volatile("wfi" : : : "memory");; // wait for interrupt

    return 0; // should not be here
}
 
Problem is, when run application from command prompt, nothing happened, PWR_ON pin still high and wfi() seems not work, the application return 0.
 
We checked PWR_MPUCR register and see the values we write into register are correct. 

 

This topic has been closed for replies.

1 reply

PatrickF
ST Employee
December 15, 2023

Hi @Dat Tran 

Some useful information in AN5109 STM32MP15x lines using low-power modes

 
Regards

In order to give better visibility on the answered topics, please click on 'Best Answer' on the reply which solved your issue or answered your question.Tip of the day: Try Sidekick STM32 AI agent