2025-05-08 1:51 AM
I am using the STM32MP257F-DK board. By default, this board automatically boots when power is applied. If the wakeup button is held for about 15 seconds, the system powers off. A short press and release of the wakeup button generates an interrupt signal that can be used by the kernel.
I would like to change this behavior with the following custom setup:
When power or battery is applied, the board should not boot automatically.
The system should only boot if the wakeup button is pressed and held for a defined time (around 3 seconds).
After the system has booted, pressing and holding the wakeup button again for the same defined time (around 3 seconds) should trigger a power-off.
A short press and release of the button should continue to generate an interrupt signal usable by the kernel.
Based on the following documentation:
https://wiki.st.com/stm32mpu/wiki/STM32MP2_PWR_internal_peripheral#stm32mp21_PWR_a35_runtime_rif
https://wiki.st.com/stm32mpu/wiki/STM32MP2_PWR_internal_peripheral#stm32mp2_PWR_a35_boottime_rif
It seems that these changes can be implemented by modifying the linux-stm32mp, optee-os-stm32mp, and tf-a-stm32mp sources.
Could you please guide me on exactly how to configure or modify these sources to implement this custom power and wakeup behavior?