English

Can I play with the Bootloader?

I’m hoping to order up a FP2 at the end of the month, when I get paid, but mean time I want to use the phone as a comms device connected to various embedded electronics projects. What I’d really like is for my embedded electronics to be able to power up and down the FP2.

There are a number of ways that this could be done in Hardware, but the simplest by far would be if I could slightly change the Bootloader (if there is even a bootloader) so that the phone powers up when 5V is connected to the micro USB Port. And powers down again when the 5V is disconnected.
So is there a bootloader?

Is it opensource?
If not I guess I’ll have to look at how difficult it would be to de-solder the on/off button and wire it to a relay.

Do you mean you won’t run android at all and stick in some firmware state ? Like some kind of custom-made recovery ?

Not at all. I’ll be running stock Android, well cyanogenmod. Having said that I currently build CM for Nexus S devices to use. The only reason that I want to tweak Bootloader is to have some Hardware control of powering up the phone and Android.

If I wanted to power up the device from an Arduino I could have a solenoid press the actual on/off button but I’m not keen on that. I could de-solder the on/off button and wire it to the Arduino and use an IO Pin. But the cleanest way would be if there was some way to get the phone to auto power up when 5V power is applied. For that I assumed I’d be forced to deal with the bootloader.

Having said all that under normal operation when the phone is off and you apply power you get the charging animation. So what piece of code is responsible for that animation? If it was actually Android proper as opposed to bootloader then I could stick a line of code in there that said “instead of displaying charging animation power up the device”.

I must search for that and see who does the charging animation.

I don’t understand exactly what you’re planning to do, but I recommend you a forum search regarding your bootloader question.

Do you know that (at least the moment) there is no Cyanogen Mod for the FP2?

Maybe the DIY-guru @dvl can add something to this topic?

Sorry, cannot help on this

Hi,

You probably do not want to do anything with the bootloader. The shipped Android provides enough
permissions to access things like the headjack and the usb connectors.

After a more careful read you want to modify the behaviour of the system while booting. The hard way for doing this requires access to low level initialisation routines. It might be better to modify the charging animation code to perform a reboot(that code is open source)

2 Likes

We also have FP2-1213:Phone does not boot into charging mode when plugged in bootable/bootloader/lk (e.g. a change that implements the opposite.)

1 Like

By googling, there are many posts about that, mainly for setting up custom android-based car audio systems.
This part is quite low level, and so very device-specific. As keesj said, the solution is usually to replace the charging animation code, so it will boot the OS instead of displaying this animation. This seems less dangerous than re-compiling the bootloader at high bricking risk.

I had a quick look in the filesystem, but couldn’t find that charging animation, do someone know about this ?

Sorry I perhaps give this the wrong title. I had thought that the bootloader would be responsible for the charging when the phone is powered off but if the charging animation is open then great. I don’t actually want to mess with the bootloader at all just have some mechanism to power up the phone without human intervention.

I have a few Android phones and I have one, a One Plus One that will power up if you set an alarm. That might allow me to set an alarm for a fixed time in the future to force power up of the phone and as soon as it powers up auto start an App to kill that alarm. Then do what has to be done and power down again.

The only problem with that solution is the only phone I have with that functionality is the One Plus One. Maybe it’s in the FP2 and maybe it’s in a specific Android Release but I imagine that feature is going to be HW Dependant.

And on the Animation Software. I previously found one phone which you could change the charging animation so that solution would work but there again I’ve only ever seen that mentioned for one phone. Can’t even remember which one it was now. Must go and search for that again.

Have a look at system/core/healthd.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.