[SOLVED] A13 power-up sequence - boot when charger connected

Started by tommi, March 18, 2013, 03:01:19 PM

Previous topic - Next topic

tommi

Hi,

We have a problem with booting up the A13 board.
Everything works fine when using external power source without using power switch. Android boots up and our application starts fine.

Problem is when we have battery connected. If we switch the power off and then connect the external power source, to boot device up, it will only start to charge the battery.

Is it possible to boot the device when battery is already inserted and then main power is connected, without the help of any power switches?


EDIT:
I have found various instructions about bootsequence of Android. And based on that I tried to create own image, and modify the init.rc-file 'on charger' -part, but it seems not to have any effect. I suspect that charging animation is handled on linux side and boot does not get so far.

Does anyone have more info about how startup modes are defined in olimex build, so I could change the behaviour of boot when battery is connected?


BR, Tommi

tommi


BJFreeman

from what I have found so far:
The A13 wifi uses AXP209(QFN48) power chip that deals with all power issues. The yellow led is controlled by it.
Androic and linux only monitor the Power chip. except for powerdown sequence
http://linux-sunxi.org/images/c/ce/AXP209-SpecSheet-Translated.pdf
or
https://github.com/linux-sunxi/u-boot-sunxi/wiki/AXP209

https://github.com/OLIMEX/OLINUXINO/tree/master/HARDWARE/A13-PDFs
Fulltimer since 89

murerten

I posted a message about this before:

https://www.olimex.com/forum/index.php?topic=868.msg5585#msg5585

Try adding this to your fex file:

;----------------------------------------------------------------------------------
; system configuration
;----------------------------------------------------------------------------------
[target]
...
power_start = 1


I did this and it works on android 4.1 sdk.

tommi


Thanks Murerten and BJFreeman.  :) (And sorry that I did not notice your post earlier)

power_start = 1 works also on 4.0.3 image.

junetec

Quote from: murerten on May 28, 2013, 08:25:35 PM
I posted a message about this before:

https://www.olimex.com/forum/index.php?topic=868.msg5585#msg5585

Try adding this to your fex file:

;----------------------------------------------------------------------------------
; system configuration
;----------------------------------------------------------------------------------
[target]
...
power_start = 1


I did this and it works on android 4.1 sdk.

There's any way to change fex file or something else (to add boot when charge connected) without need to build completely the image?

Because I try it, but at the moment I don't have succes to buil it.

oldpenguin

If you boot linux from an SD card you can mount the boot partition and change whatever file you like.
You have several /dev/nanda ... /dev/nande. I just can't remember which one corresponds to the boot partition.
You can try and mount one at a time and see its contents.
Regards
Antonio

oldpenguin

Update
mkdir mnt
mount /dev/nanda mnt
ls -l mnt

You should see something like this:
root@debian:~# ls -l mnt
total 1168
-rwxr-xr-x 1 root root  49408 Jan  1  1980 boot.axf
-rwxr-xr-x 1 root root    106 Jan  1  1980 boot.ini
-rwxr-xr-x 1 root root 174884 Jan  1  1980 drv_de.drv
-rwxr-xr-x 1 root root 344813 Jan  1  1980 font24.sft
-rwxr-xr-x 1 root root 357443 Jan  1  1980 font32.sft
drwxr-xr-x 2 root root   2048 Jan  1  1980 linux
-rwxr-xr-x 1 root root    512 Jan  1  1980 magic.bin
drwxr-xr-x 2 root root   2048 Jan  1  1980 os_show
-rwxr-xr-x 1 root root  27068 Jan  1  1980 script0.bin
-rwxr-xr-x 1 root root  26604 Sep 25  2012 script.bin
drwxr-xr-x 2 root root   2048 Jan  1  1980 sprite
-rwxr-xr-x 1 root root 195380 Jan  1  1980 sprite.axf
drwxr-xr-x 3 root root   2048 Jan  1  1980 vendor


Regards

Antonio

granite_crusher

#8
Hello,

I don't know if this is right post to write.
I bought A13 card not long ago, and would like to make some useful device for field works.
However I couldnt find how exactly power-up sequice works.
In my case (I have rev.E) powering up and down behaves differently depending of what sources of power is plugged in. By the way I am using linux so power down can be affected by it.
1. just AC/DC adapter:
    power on -> as adapter gets pluged in.
    power down -> command "# shutdown -P now"
    power on again -> hold power button for few sec
2. LiPo battery + AC/DC adapter:
    power on (1st time) -> as adapter gets pluged in nothing happens (no signal goes from VGA as it would be not plugged, so I guess it is off? (empty black screen without complain from monitor about signal missing doesnt coun as no signal). Then hold power button for few sec and it starts up.
    power down -> either from cli "# shutdown -P now" or either from xfce4 shutdown button shutdowns board, but it gets powerd/started/booted up just after few seconds. If I write in cli "# shutdown -P now" second time - it shutdowns and no signal comes out from VGA (I guess it is off).
    power on again -> power button does nothing: holding pushing... anything, no sign of life. Instead this time holding reset button starts board on (boots up).
    power down (again requires shutdown twice).

    two possibilities comes to my head:
    1. power on board and booting up OS is totally independant things which I fail to grasp in this board, so all this strange behaviour is from software. (that probably means if I shutdown OS, board itself stays on? what would explain why LiPo battery gets drained out while OS stays shuted down, and it happens in few hours.
    2. Is this hardware problem?

    I really would like to hear from olimex or anybody who know how does it works. I guess such information would enrich manual too.

junetec

Quote from: oldpenguin on June 21, 2013, 01:39:16 PM
Update
mkdir mnt
mount /dev/nanda mnt
ls -l mnt

You should see something like this:
root@debian:~# ls -l mnt
total 1168
-rwxr-xr-x 1 root root  49408 Jan  1  1980 boot.axf
-rwxr-xr-x 1 root root    106 Jan  1  1980 boot.ini
-rwxr-xr-x 1 root root 174884 Jan  1  1980 drv_de.drv
-rwxr-xr-x 1 root root 344813 Jan  1  1980 font24.sft
-rwxr-xr-x 1 root root 357443 Jan  1  1980 font32.sft
drwxr-xr-x 2 root root   2048 Jan  1  1980 linux
-rwxr-xr-x 1 root root    512 Jan  1  1980 magic.bin
drwxr-xr-x 2 root root   2048 Jan  1  1980 os_show
-rwxr-xr-x 1 root root  27068 Jan  1  1980 script0.bin
-rwxr-xr-x 1 root root  26604 Sep 25  2012 script.bin
drwxr-xr-x 2 root root   2048 Jan  1  1980 sprite
-rwxr-xr-x 1 root root 195380 Jan  1  1980 sprite.axf
drwxr-xr-x 3 root root   2048 Jan  1  1980 vendor


Regards

Antonio

Thanks for the info.
It works for me in the A13 with the Android 4.0.

But I try with the A20 with 4.1 and don't work.
Someone know why?

Regards.

Enric