The PWRBTN# pin is an active low input which can cause the Edison module to transition into and out of sleep, or cause a power off , depending on the configuration of the software. According to the Edison schematic the PWRBTN is connected to SW1UI2 of the Arduino expansion board. You can see more information of SW1UI2 in https://communities.intel.com/docs/DOC-23454 .
RESET_OUT# can be used by external hardware to indicate system reset. This external hardware will be your custom board, in the document it states that “If the Intel® Edison is running, then a momentary press will cause the Intel® Edison to go into the low power sleep mode.”, this is what you are looking for right? Then, since you are not using the Arduino board use a switch or a button connected to the PWRBTN to get this behavior.
I'm not using the Arduino expansion board, it's a full custom board. In this board I have a switch connected to the PWRBTN pin. I made some test today and I get the following result
- (initial state the edison is power on)
- I pushed the PWRBTN during +/- 7s => edison go in sleep mode = good behavior
- I release the PWRBTN => edison stay in sleep mode = bad behavior
As you wrote, the documentation says "he PWRBTN# pin is an active low input which can cause the Edison module to transition into and out of sleep, or cause a power off , depending on the configuration of the software". How can I change this configuration ?
The power button functions, as far as I know, are handled by pwr-button-handler (big surprise I know). To change the functionality of the power button you have to change this program or replace it. You can see the code in the edison-src download under device-software/meta-edison-distro/recipes-support/pwr-button-handler/. I hope that helps.
Thanks yodal, I think it's a good way !
However I seems to have still an issue. In the original pwr-button-handler.c, I comment the two lines "system(argv[X])" on line 154 and 106 then I compile and copy the program in /usr/bin and reboot my Edison for apply. After reboot, the action on the power button is still the same. Any idea ? I try systemctl reenable pwr_button_handler.service but i got the same problem.
Looking closer at it, it might be best to use the normal code and just change what is passed to the program by systemctl. Changing the service's parameter might sick instead of altering the program. If all else fails, try editing the program/service file before building the kernel and then flash a new kernel with your changes.