Automatic powering on and not staying powered off
#1
Hello,

This thread is a fork from another thread, as requested by the OP.  First, here's a sum-up of what's been already discussed:

(03-09-2021, 11:15 AM)dsimic Wrote: When the phone is connected to the official dock, and a charger is plugged into the dock, shutting down the operating system causes the phone to power off and, unexpectedly, power back on immediately.  I've tested it more than a few times, and it always (mis)behaves like that.

(03-09-2021, 11:15 AM)dsimic Wrote:
(03-01-2021, 12:24 AM)GregH Wrote: Another side effect is that the device will not stay off with DCIN powered - no charging while switched off, it keeps booting up again :-(

This is pretty much the same behavior as with the official dock connected to the phone, which I've described earlier in this post.

After reviewing the relevant part of the available documentation for AXP803 (i.e. the PMIC), it's clear why this happens with 5 V applied to the DCIN pogo pin.  Basically, the PMIC detects the presence of valid input power voltage, which is satisfied in this case, and automatically begins the power-on procedure.  However, this doesn't explain the same behavior with the official dock plugged into the phone.

(03-14-2021, 08:29 PM)bokomaru Wrote: Phone -> USB C to A cable -> old "dumb" power brick -> AC wall outlet: Connecting the first time causes the phone to power on. But I can power the phone off from software, and then it stays "off".

Phone -> convergence dock -> USB C to a cable -> old "dumb" power brick -> AC wall outlet: Connecting the first time causes the phone to power on. After powering off the phone from software, the phone powers back on; won't stay "off".

(03-14-2021, 08:29 PM)bokomaru Wrote:
(03-14-2021, 07:42 AM)megous Wrote: anx7688 doesn't do anything unless the pinephone is powered on, so there's some fun to be had when charging via USB-PD chargers when the phone is off.

Maybe that's related to this, i.e., maybe the phone powers on by design, so that USB-PD can be negotiated if applicable.

I also remember reading that, for similar reasons, while charging, Android phones tend to be booted up. At least into the bootloader, and then the bootloader maybe knows to enter a different "charging indication" mode or to "stop here" until X or Y event happens.

Anyways, my point is that either of the two conflicting observations can happen, depending on which hardware you connect. If you want to reproduce my "off" test cases, try using a "dumb" brick without USB-PD.
  Reply
#2
Here are a couple of responses from my side:

(03-14-2021, 08:29 PM)bokomaru Wrote: Phone -> convergence dock -> USB C to a cable -> old "dumb" power brick -> AC wall outlet: Connecting the first time causes the phone to power on. After powering off the phone from software, the phone powers back on; won't stay "off".

Thank you very much for confirming this!  The only reasonable explanation is that plugging a charger into the official dock causes the dock to provide 5 V prior to any negotiation with the upstream USB port (i.e. the phone), which in turn causes the PMIC to enter the power-on procedure.  This is probably a bug in the official dock.

(03-14-2021, 08:29 PM)bokomaru Wrote:
(03-14-2021, 07:42 AM)megous Wrote: anx7688 doesn't do anything unless the pinephone is powered on, so there's some fun to be had when charging via USB-PD chargers when the phone is off.

Maybe that's related to this, i.e., maybe the phone powers on by design, so that USB-PD can be negotiated if applicable.

I also remember reading that, for similar reasons, while charging, Android phones tend to be booted up. At least into the bootloader, and then the bootloader maybe knows to enter a different "charging indication" mode or to "stop here" until X or Y event happens.

As already noted, this is simply part of the behavior of the AXP803; if it detects valid input voltage, it automatically starts the power-on procedure.  Here are a couple of quotations from page 25 of the AXP803 datasheet that describe this:

Quote:Power on source
Below are the 2 power up sources supported by AXP803 in mechanical off state:
1. Charger insertion (including ACIN and VBUS insertion); 
2. Power on key pressed

Quote:Power on from charger insertion
The PMIC will start the power on sequence by a charger insertion.  A charger insertion is detected from a rising voltage on the ACIN/VBUS node.  If  4.1 V < ACIN/VBUS < 7.0 V, the charger will start charging immediately and autonomously. The existence of ACIN/VBUS is stored in REG 00H[7/5 ].

It could very well be that I'm missing something, but the AXP803 datasheet describes no means to change this behavior of the AXP803.
  Reply
#3
I think this is the way Allwinner intended it to work, what happens on Android phones or tablets is that they boot into a 'charger image' instead of the real OS, this just displays the battery icon/charge status, and they do that by checking the power-on reason register (REG 02H: Power up/down reason register in the AXP803).
So what really is needed is imho to extend u-boot in a way to handle that case and configure the ANX7688 as well...
Come have a chat in the Pine IRC channel >>
  Reply
#4
It would be very good to actually start using Ondrej's p-boot in some of the Linux distributions for the PinePhone.  Many features are already available in p-boot, and I'd suppose that it would be possible to add support for the interaction with ANX7688.
  Reply
#5
(03-16-2021, 07:36 AM)xalius Wrote: I think this is the way Allwinner intended it to work, what happens on Android phones or tablets is that they boot into a 'charger image' instead of the real OS, this just displays the battery icon/charge status...

I agree. The "auto power on" part is expected, and it's up to the software side to decide how to behave. (like an Android phone, or just power on normally, or whatever you want)


@dsimic, about "not staying powered off": With an Android phone that I have, the same thing actually happens. If you think about it, it's still totally expected. (1) I'm booted into the "normal" OS. (2) I connect a charger, and the OS shows me that I'm charging. (3) I tell software to power down. (4) The phone turns off. (5) The phone automatically turns back on and goes into the 'charger image' to show a battery fuel gauge.

So I don't think this is a bug in the phone nor the convergence dock.

If anything is odd, it's just the one case with the "dumb" power brick where my phone seemed _not_ to power back on automatically. To be fair, I can't be totally sure that the A64 really was off; this was just the default Manjaro image, and its boot loader doesn't display anything on the screen. (Although, I _think_ it's the boot loader that turns on the notification LED, and that wasn't on)
  Reply
#6
The weird, inconsistent part is that the phone doesn't always power on automatically.  As already described, when the phone is connected to a "dumb" (USB BC) charger, the phone stays powered off after system shutdown.  If the same charger is connected to the official dock, and the dock is connected to the phone, the phone powers on automatically after system shutdown.  Something weird is going on there. Smile

However, I do agree that the automatic powering on upon plugging in a charger is actually useful, but we'd need to start using it as a feature, by having something in place that displays the status of battery charging instead of booting into the OS.  To me, p-boot seems to be the way to go.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Powering the modem after turning off the smartphone Mikoduso 3 2,580 02-04-2022, 04:06 PM
Last Post: grwlf
  USB powered hub g40 0 787 01-12-2022, 05:38 PM
Last Post: g40
  Privacy question - is GPS active with phone powered off? Zebulon Walton 7 6,620 01-09-2021, 03:12 PM
Last Post: bokomaru
  Can the pinephone be powered without a battery? stragulus 6 7,475 02-13-2020, 06:06 PM
Last Post: stragulus

Forum Jump:


Users browsing this thread: 1 Guest(s)