cancel
Showing results for 
Search instead for 
Did you mean: 

DK1: how to power off the board

VRoma.2
Associate II

Hi.

Is there a way to properly power off the board without using the console's poweroff command?

Tried to press ​wake-up button for 10 seconds with no effect...

Regards,

Vlad.​

1 ACCEPTED SOLUTION

Accepted Solutions
PatrickF
ST Employee

Hi,

For I2C, see https://wiki.st.com/stm32mpu/wiki/I2C_i2c-tools

STPMIC is at address 0x33 on I2C4 bus (peripheral address of I2C4 is 0x5C002000).

There is also I2C command available on uBoot.

Note: wrong STPMIC1 control (i.e. too high voltage) might brick the board.

Long key press shutdown is safe for electrical point of view (i.e. power sequence is ensured).

Linux is not aware of this shutdown, so no filesystem sync is done, you could loose data not really saved on Flash (Filesystem itself is self repairing on next boot).

If you want safe power-off, you should write your own code to catch a button press and go in a clean shutdown.

note that to allow 'shutdown -h 0' to enter in Shutdown instead of Standby, you should change the 'system_off_soc_mode' in Device Tree.

&pwr_regulators{
	status = "okay";
	secure-status = "okay";
 
	/* USER CODE BEGIN pwr_regulators */
	system_suspend_supported_soc_modes = <
		STM32_PM_CSLEEP_RUN
		STM32_PM_CSTOP_ALLOW_LP_STOP
		STM32_PM_CSTOP_ALLOW_STANDBY_DDR_SR
	>;
	/* system_off_soc_mode = <STM32_PM_CSTOP_ALLOW_STANDBY_DDR_OFF>; */
	system_off_soc_mode = <STM32_PM_SHUTDOWN>;
	vdd-supply = <&vdd>;
	vdd_3v3_usbfs-supply = <&vdd_usb>;
	/* USER CODE END pwr_regulators */
};

Regards.

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

6 REPLIES 6
PatrickF
ST Employee

Hi,

with Starter Package up and running the 'long key press' in STPMIC1 is set to 10sec, but if not started, the default value is 16sec.

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
VRoma.2
Associate II

Hi, PatrickF.

​Thank you for the answer.

Is there a way to read and check​ PMIC registers contents from the console?

Some I2C utilities should exist, i suppose?

Would such a shutdown be safe, ​does it allow linux to sync its filesystem before poweroff?

Regards.​

PatrickF
ST Employee

Hi,

For I2C, see https://wiki.st.com/stm32mpu/wiki/I2C_i2c-tools

STPMIC is at address 0x33 on I2C4 bus (peripheral address of I2C4 is 0x5C002000).

There is also I2C command available on uBoot.

Note: wrong STPMIC1 control (i.e. too high voltage) might brick the board.

Long key press shutdown is safe for electrical point of view (i.e. power sequence is ensured).

Linux is not aware of this shutdown, so no filesystem sync is done, you could loose data not really saved on Flash (Filesystem itself is self repairing on next boot).

If you want safe power-off, you should write your own code to catch a button press and go in a clean shutdown.

note that to allow 'shutdown -h 0' to enter in Shutdown instead of Standby, you should change the 'system_off_soc_mode' in Device Tree.

&pwr_regulators{
	status = "okay";
	secure-status = "okay";
 
	/* USER CODE BEGIN pwr_regulators */
	system_suspend_supported_soc_modes = <
		STM32_PM_CSLEEP_RUN
		STM32_PM_CSTOP_ALLOW_LP_STOP
		STM32_PM_CSTOP_ALLOW_STANDBY_DDR_SR
	>;
	/* system_off_soc_mode = <STM32_PM_CSTOP_ALLOW_STANDBY_DDR_OFF>; */
	system_off_soc_mode = <STM32_PM_SHUTDOWN>;
	vdd-supply = <&vdd>;
	vdd_3v3_usbfs-supply = <&vdd_usb>;
	/* USER CODE END pwr_regulators */
};

Regards.

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
VRoma.2
Associate II

Hello PatrickF,

Thank you for support, it is very helpful to me.

Indeed poweroff command leaves BUCK3->VDD rail powered up, and I could not guess - why?

Following power up looks just like normal cold boot, so why leave VDD rail active?

Regards.

VRoma.2
Associate II

Hi,

Managed to switch BUCK3 off in shutdown (via I2C register write), getting negligible drop in current (less than 1ma).

So that not a problem really.

Regards.​

Thanks for the feedback.

That conform to datasheet (about 1mA on VDD on RUN excluding external components and tens/hundreds of uA in STANDBY, depending on retention setup and if any external components).

Standby (i.e. with BUCK3/VDD enabled) allows to wakeup controlled by STM32MP15 PWR block (using PWR_ON pin) with WKUPx pins (as well as internal RTC or TAMP)

OFF (VBAT) mode requires a power-on using STPMIC1 (which could receive wakeup signal from RTC or TAMP).

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.