2019-07-14 08:16 PM
I'd like to test the standby mode on the board STM32MP157C-DK2,so I run the application 'OpenAMP_TTY_echo_wakeup' by following the doc -- readme.txt in STM32Cube MP1 package. However ,once I run the command
$ echo mem > /sys/power/state
to move CA7 in CStop mode , it will report such error:
[ 281.518965] PM: Syncing filesystems ... done.
[ 281.546418] Freezing user space processes ... (elapsed 0.001 seconds) done.
[ 281.553742] OOM killer disabled.
[ 281.557176] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[ 281.564607] Suspending console(s) (use no_console_suspend to debug)
[ 281.629016] dwc2 49000000.usb-otg: suspending usb gadget configfs-gadget
[ 281.629035] dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0
[ 281.629045] dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0
[ 281.694403] stm32-dma 48001000.dma: Suspend is prevented by Chan 1
[ 281.694436] dpm_run_callback(): platform_pm_suspend+0x0/0x48 returns -16
[ 281.694447] PM: Device 48001000.dma failed to suspend: error -16
[ 281.694458] PM: Some devices failed to suspend, or early wake event detected
[ 281.705449] dwmac4: Master AXI performs any burst length
[ 281.705484] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
[ 281.747812] dwc2 49000000.usb-otg: resuming usb gadget configfs-gadget
[ 282.290600] OOM killer enabled.
[ 282.293712] Restarting tasks ... done.
[ 282.344351] PM: suspend exit
-sh: echo: write error: Device or resource busy
Do you know the reason for this problem?
Solved! Go to Solution.
2019-07-16 12:16 AM
Thanks! I've found the reason from this link: https://wiki.st.com/stm32mpu/wiki/STM32CubeMP1_Package .I use the Starter Package, but I run the app "OpenAMP_TTY_echo_wakeup" by loading its firmware by IDE at Engineering boot mode. This link points out:
Most of the examples can be used in Engineering boot mode (except those that require firmware running on a Cortex-A7, such as the OpenAMP examples)
So I switch to Production boot mode , the app works.
2019-07-15 12:54 AM
Hello,
please refer to https://wiki.st.com/stm32mpu/wiki/Power_overview#How_to_enter_and_exit_low-power_modes
Note that if you use the Starter Package, i.e Weston/Wayland configuration, the low-power mode is entered upon a 'systemctl suspend' command.
2019-07-15 08:05 AM
Moreover: If you don't set a wakeup source before entering low power mode, the A7 will go to Cstandby and not in Cstop (see above article).
See also: "/usr/local/Cube-M4-examples/STM32MP157C-DK2/Applications/OpenAMP/OpenAMP_TTY_echo_wakeup/README" file on the board for also a complete set of power use case example.
2019-07-16 12:16 AM
Thanks! I've found the reason from this link: https://wiki.st.com/stm32mpu/wiki/STM32CubeMP1_Package .I use the Starter Package, but I run the app "OpenAMP_TTY_echo_wakeup" by loading its firmware by IDE at Engineering boot mode. This link points out:
Most of the examples can be used in Engineering boot mode (except those that require firmware running on a Cortex-A7, such as the OpenAMP examples)
So I switch to Production boot mode , the app works.
2019-07-16 12:39 AM
Thx! I've found the reason.
But there is still a question, I use the Starter Package, Weston/Wayland configuration. I tested the standby mode according to the fifth step of the app's README firstly as follows:
echo disabled > /sys/devices/platform/soc/4c001000.mailbox/power/wakeup
echo "*standby" >/dev/ttyRPMSG0
echo mem > /sys/power/state
Then I wakeup it using Wake up button WKUP1 pin, it will reboot. However, when I replace "$echo mem > /sys/power/state" with the command :
systemctl suspend
as you said, it will not reboot.
What is the difference in detail between the two commands?
Should I always use command 'sysytemctl suspend' in my Weston board?
2019-07-16 04:33 AM
2019-07-17 07:34 PM
Although the question I raised is already over, I still have some questions:
1.Do you mean that on my Weston board, all the places that use command “echo mem > /sys/power/state�? should be replaced with "systemctl suspend" command ?
For example, the third example of this "OpenAMP_TTY_echo_wakeup" demo to enter System Stop Mode following these steps:
echo "*stop" >/dev/ttyRPMSG0
echo mem > /sys/power/state
so should I change to
echo "*stop" >/dev/ttyRPMSG0
systemctl suspend
to enter System Stop Mode in the right way ?
The results show that both operations can wake up A7 and M4 finally , but the log information is a little different, the wakeup time of "systemctl suspend" is longer.So which command is correct?
2.According to your second suggestion,do you mean that I can ignore the influence of Weston and and use the "echo mem > /sys/power/state" command to enter System Standby Mode in the right way ?But when I try it by following your steps, the board will still reboot.
3.Is it only the Weston configuration to use the "echo mem > /sys/power/state" command to enter System Standby Mode and then wakeup with rebooting? Will other configurations use this command to enter System Standby Mode the right way and wakeup without rebooting?
2019-07-18 12:44 AM
I will try to answer my best but some questions are not clear for me, please react if you need clarifications.
1/ Yes. Either you keep Weston up and running and then, you will need to replace any "echo mem > /sys/power/state" command with "systemctl suspend" OR if you don't mind weston, you can also stop weston with "systemctl stop weston" and play only with "echo mem > /sys/power/state" command.
2/ See 1. On my side following previous suggestion 2, the board is not rebooting, only Weston will start from scratch:
root@stm32mp1:/usr/local/Cube-M4-examples/STM32MP157C-DK2/Applications/OpenAMP/OpenAMP_TTY_echo_wakeup# echo mem > /sys/power/state
[2019-07-18 09:25:59
[ 1181.285058] PM: suspend entry (deep)
[ 1181.287183] PM: Syncing filesystems ... done.
[ 1181.294530] Freezing user space processes ... (elapsed 0.002 seconds) done.
[ 1181.302112] OOM killer disabled.
[ 1181.305495] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[ 1181.312817] Suspending console(s) (use no_console_suspend to debug)
[2019-07-18 09:26:09
[ 1181.376234] dwc2 49000000.usb-otg: suspending usb gadget configfs-gadget
[ 1181.376925] dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0
[ 1181.376938] dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0
[ 1181.441448] Disabling non-boot CPUs ...
[ 1181.485377] CPU1 killed.
[ 1181.488768] Enabling non-boot CPUs ...
[ 1181.489731] CPU1 is up
[ 1181.507012] dwmac4: Master AXI performs any burst length
[ 1181.507045] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
[ 1181.547034] dwc2 49000000.usb-otg: resuming usb gadget configfs-gadget
[ 1181.701710] dwc2 49000000.usb-otg: new device is high-speed
[ 1181.773611] dwc2 49000000.usb-otg: new device is high-speed
[ 1181.834458] dwc2 49000000.usb-otg: new address 56
[ 1181.856444] configfs-gadget gadget: high-speed config #1: c
[ 1182.096111] OOM killer enabled.
[ 1182.099142] Restarting tasks ... done.
[ 1182.107776] PM: suspend exit
3/ "echo mem > /sys/power/state" is the standard sysfs interface offered by the suspend framework. So it is to be used whatever the application is running on top of this. The way the system will go low power will depend on the Wakeup source set by the system (can be set in device tree or depending of the case, can be done also with sysfs (see mailbox or uart console examples)).
See: https://wiki.st.com/stm32mpu/wiki/Power_overview for more dedails.
Note: in the "OpenAMP_TTY_echo_wakeup" sample application, RPMSG offers the facility to set M4 power state with specific linux commands:
It is a way to do it but it is not standard.
2019-07-18 05:09 AM
Thank you very much for your answer. I'm still a beginner for low power mode and linux kernel, so I'm sorry that I have so many questions to ask.
1.The Table 33 in doc STM32MP157xxx reference manual RM0436.pdf mentions that DDR is off in System Standby Mode:
However, if DDR is off, the platform must be reboot after wakeup. But in the doc AN5109 low power application note , Figure 7 shows that DDR isn't off, the Table 6 shows that the DDR status is off or self refresh:
So what is the true state of DDR?
2.How do you define the Wakeup Time after exiting from System Standby Mode? The ppt STM32MP1 Microprocessor - Continuing the STM32 Success Story mentions the wakeup time is around 1 second,
But if I count all the log time after pressing the wakeup button, it's more than 2s.
NOTICE: CPU: STM32MP157CAC Rev.B
NOTICE: Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
NOTICE: Board: MB1272 Var2 Rev.C-01
INFO: Reset reason (0x810):
INFO: System exits from STANDBY
INFO: Using SDMMC
INFO: Instance 1
INFO: Boot used partition fsbl1
INFO: Product_below_2v5=1: HSLVEN update is
INFO: destructive, no update as VDD>2.7V
NOTICE: BL2: v2.0(debug):
NOTICE: BL2: Built : 13:13:37, Oct 2 2018
INFO: BL2: Doing platform setup
INFO: PMIC version = 0x10
INFO: RAM: DDR3-1066/888 bin G 1x4Gb 533MHz v1.41
INFO: BL2 runs SP_MIN setup
INFO: BL2: Loading image id 4
INFO: Loading image id=4 at address 0x2fff0000
INFO: Image id=4 loaded: 0x2fff0000 - 0x30000000
INFO: BL2: Skip loading image id 5
INFO: read version 0 current version 0
NOTICE: BL2: Booting BL32
INFO: Entry point address = 0x2fff0000
INFO: SPSR = 0x1d3
INFO: PMIC version = 0x10
NOTICE: SP_MIN: v2.0(debug):
NOTICE: SP_MIN: Built : 13:13:37, Oct 2 2018
INFO: ARM GICv2 driver initialized
INFO: stm32mp HSI (18): Secure only
INFO: stm32mp HSE (20): Secure only
INFO: stm32mp PLL2 (27): Secure only
INFO: stm32mp PLL2_R (30): Secure only
INFO: SP_MIN: Initializing runtime services
INFO: SP_MIN: Preparing exit to normal world
[ 86.448084] dwc2 49000000.usb-otg: suspending usb gadget configfs-gadget
[ 86.448103] dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0
[ 86.448113] dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0
[ 86.511324] Disabling non-boot CPUs ...
[ 86.565569] CPU1 killed.
[ 86.573631] Enabling non-boot CPUs ...
[ 86.574591] CPU1 is up
[ 86.579126] usb usb1: root hub lost power or was reset
[ 86.590644] dwmac4: Master AXI performs any burst length
[ 86.590675] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
[ 86.635805] dwc2 49000000.usb-otg: resuming usb gadget configfs-gadget
[ 86.974792] usb 1-1: reset high-speed USB device number 2 using ehci-platform
[ 87.360361] OOM killer enabled.
[ 87.363467] Restarting tasks ... done.
[ 87.404366] PM: suspend exit
[ 87.505037] bind driver brcmfmac/sdmmc
[ 87.508756] mmci-pl18x 58007000.sdmmc: allocated mmc-pwrseq
[ 87.513317] mmci-pl18x 58007000.sdmmc: Linked as a consumer to regulator.8
[ 87.526341] mmci-pl18x 58007000.sdmmc: mmc1: PL180 manf 53 rev1 at 0x58007000 irq 49,0 (pio)
[ 87.594891] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[ 87.600579] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 87.617166] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 87.634126] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[ 87.642405] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 87.657533] mmc1: queuing unknown CIS tuple 0x80 (6 bytes)
[ 87.749313] mmc1: new high speed SDIO card at address 0001
[ 87.778086] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 87.945098] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 88.035330] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Sep 11 2018 09:22:09 version 7.45.98.65 (r707797 CY) FWID 01-b54727f
So how do you define the time from Standby to linux console?
3.My log info and reboot phenomenon is different from your second suggestion -- stop weston,go to standby ,wakeup and start weston , so I’m confusing that whether I did enter the System Standby Mode actually by using the "systemctl suspend" command.
Is there any way to judge it? The log information in the log of my question 2 shows as follows:
INFO: Reset reason (0x810):
INFO: System exits from STANDBY
can it prove that I did enter the standby mode? Or can I judge by testing the value of Vddcore ? Do you have any suggestions?
Thanks a lot!
2019-07-18 07:13 AM
1/ in Standby mode, you have the choice to switch off the ddr or to keep it in self refresh "SR" (both are supported).
2/ 1 sec for standby wake up is what is achievable for a final product. We already confirmed this value customizing a bit the SW on DK2. DK2 standard delivery is a development platform so not optimized for power (even if all the power mechanisms are present and can be experienced). For example, full debug is activated and almost all the peripherals.
A wiki page is under construction to show how to reach better power results with ST boards.
3/ If you have an EV1 board (MB1263C):
Some 0Ω shunt resistors (R80, R81, R82) on the back side of the board are present on power supplies and can be replaced by 0.1Ω resistors on VDDCORE, VDD, VVDQ_DDR to measure the voltage and deduce current.