Beaglebone black poweroff-restart problem

Dear all,
I have a problem quite similar to this one:
https://groups.google.com/forum/#!topic/beagleboard/qw5zlS4F4p4

This is my setup:
a) a bleaglebone black with 5V on pin VDD_5V
b) a C program doing a shutdown when the power button is pressed.
I have the C program in my rc.local in such a way to have it running in background.

If I have no ethernet cable connected and I try to push the power button, the beaglebone black goes down, the power led switches off but after 1 second the power led goes blue again and the beaglebone black restarts (1 second is often mentioned in the TPS65217 datasheet).

If I have the ethernet cable connected and I try to push the power button, the beaglebone black goes down, the power led switches off and it does not start again.

If I try to power the bleaglebone black by using the jack (and not using the VDD_5V pins), the beaglebone black does not start again (with or without ethernet cable).

My beaglebone black should be a Rev.B.

Any idea about this strange behaviour?

Cheers.

Alberto

Update:
when I set the TPS65217 to go in SLEEP mode, by setting bit 7 of reg 0x0A, after the poweroff command the TPS65217 actually goes in sleep mode and does not start again.
Summarizing:
a) poweroff command + ethernet cable → there is a real poweroff and the system goes off
b) poweroff command but no ethernet cable → the system switches off and the switches on again
c) poweroff command, no ethernet cable + TPS65217 set in sleep mode → the ARM switches of and the TPS65217 goes in SLEEP mode.

It looks like, when the TPS65217 goes off (and ethernet is not plugged), it receives a wake-up signal and starts again but if it goes in SLEEP mode, it does not receive it.
I am really confused about this behaviour.

Hoping someone already saw that and there is a solution.

Cheers.

Alberto

Hi Alberto.

I would like to use something like that, but I’m a newbie in Linux and kernel.
Could you send me your souces and some directions in order to implement these features in my application?

Thanks a lot!

José Henrique