2021-06-28 04:51 PM
Hello everyone!
I’ve tested wake up from standby mode with Wake up pins PI11 (and PI8). But it is not work
I have remove all definitions about wake up pins in dts except place where it defines as wake up pins in stm32mp151.dtsi
Entering in standby mode by putting ‘echo mem > /sys/power/state’. And after that MPU no wakes by I acting on pins PI11 or PI8.
I do not see any WAKE UP Pins in /sys/kernel/debug/wakeup_sources, maybe I need activate it before going to standby?
Do I need set MPU_BEN bit in RCC_MP_BOOTCR before going to standby mode? If yes — how?
Maybe another my misunderstanding?
Solved! Go to Solution.
2021-07-01 08:15 AM
Hello AKudr.1 (Community Member)
In fact IRQ EXTI from 55 to 60. are respectively connected to wkup pin 1 to 6. These wakeup pins are hardcoded. you can refer to the Datasheet they are respectively
wakeup-gpios = <&gpioa 0 GPIO_ACTIVE_HIGH>,
<&gpioa 2 GPIO_ACTIVE_HIGH>,
<&gpioc 13 GPIO_ACTIVE_HIGH>,
<&gpioi 8 GPIO_ACTIVE_HIGH>,
<&gpioi 11 GPIO_ACTIVE_HIGH>,
<&gpioc 1 GPIO_ACTIVE_HIGH>;
IRQ EXTI 55 corresponds to PA0, IRQ EXTI 56 to PA2, etc..
Therefore to use PI8 and PI11 you need to use respectively in your DT:
interrupts-extended = <&exti_pwr 58 IRQ_TYPE_EDGE_FALLING>;
interrupts-extended = <&exti_pwr 59 IRQ_TYPE_EDGE_FALLING>;
The corresponding driver need to use the IRQ EXTI. As an example driver you can use "gpio-keys"
/
...
test_wkup {
compatible = "gpio-keys";
#address-cells = <1>;
#size-cells = <0>;
autorepeat;
status = "okay";
button@4 {
label = "WakeUp4";
linux,code = <BTN_1>;
interrupts-extended = <&exti_pwr 58 IRQ_TYPE_EDGE_FALLING>;
status = "okay";
wakeup-source;
};
};
root@stm32mp1:~# cat /sys/kernel/debug/wakeup_sources
name active_count event_count wakeup_count expire_count e
test_wkup 5 5 0 0 0
10000000.m4 0 0 0 0 0
mmc1 0 0 0 0 0
mmc0 0 0 0 0 0
5c002000.i2c:stpmic@33:onkey 0 0 0 0
alarmtimer.0.auto 0 0 0 0 0
5c004000.rtc 0 0 0 0 0
deleted 0 0 0
Regards,
Olivier
2021-07-01 08:15 AM
Hello AKudr.1 (Community Member)
In fact IRQ EXTI from 55 to 60. are respectively connected to wkup pin 1 to 6. These wakeup pins are hardcoded. you can refer to the Datasheet they are respectively
wakeup-gpios = <&gpioa 0 GPIO_ACTIVE_HIGH>,
<&gpioa 2 GPIO_ACTIVE_HIGH>,
<&gpioc 13 GPIO_ACTIVE_HIGH>,
<&gpioi 8 GPIO_ACTIVE_HIGH>,
<&gpioi 11 GPIO_ACTIVE_HIGH>,
<&gpioc 1 GPIO_ACTIVE_HIGH>;
IRQ EXTI 55 corresponds to PA0, IRQ EXTI 56 to PA2, etc..
Therefore to use PI8 and PI11 you need to use respectively in your DT:
interrupts-extended = <&exti_pwr 58 IRQ_TYPE_EDGE_FALLING>;
interrupts-extended = <&exti_pwr 59 IRQ_TYPE_EDGE_FALLING>;
The corresponding driver need to use the IRQ EXTI. As an example driver you can use "gpio-keys"
/
...
test_wkup {
compatible = "gpio-keys";
#address-cells = <1>;
#size-cells = <0>;
autorepeat;
status = "okay";
button@4 {
label = "WakeUp4";
linux,code = <BTN_1>;
interrupts-extended = <&exti_pwr 58 IRQ_TYPE_EDGE_FALLING>;
status = "okay";
wakeup-source;
};
};
root@stm32mp1:~# cat /sys/kernel/debug/wakeup_sources
name active_count event_count wakeup_count expire_count e
test_wkup 5 5 0 0 0
10000000.m4 0 0 0 0 0
mmc1 0 0 0 0 0
mmc0 0 0 0 0 0
5c002000.i2c:stpmic@33:onkey 0 0 0 0
alarmtimer.0.auto 0 0 0 0 0
5c004000.rtc 0 0 0 0 0
deleted 0 0 0
Regards,
Olivier
2021-07-02 03:39 AM
Thanks you very much. Now I realized how it works.
---
But unfortunately I faced another problem with device trees. I found in tf-a output after waking from STANDBY this strings:
ERROR: Illegal access to 0xe0000000 in :
ERROR: Non-Secure
ERROR: Privilege
ERROR: Read
But this is another story for another forum thread)