2022-01-24 10:25 PM
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.
Solved! Go to Solution.
2022-01-25 01:41 AM
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'
2022-01-25 12:04 AM
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.
2022-01-25 12:58 AM
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.
2022-01-25 01:41 AM
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'
2022-01-25 08:41 AM
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.
2022-01-26 01:59 AM
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.
2022-01-26 06:02 AM
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.