From Linux Rockchip
Jump to: navigation, search

After flashing known good Linux kernel to proper recovery partition, it doesn't boot, broken Android screen is shown instead

UPDATE: This q&a covers 100% of symptoms described below, and thus gives proper explanation and ways to resolve the issue.

See this forum thread for description of this issue. In short, taking known working Linux kernel (etc.), wrapped properly as Rockchip image, flashed into proper flash partition with proper offset/size, doesn't lead to ability to boot from recovery, instead "broken Android" logo is displayed.

Investigation shows that flashing the image, and immediately reading it back, leads to complete match:

$ sudo ./rkflashtool w 0x10000 0x8000 <ug802recovkernel.img
$ sudo ./rkflashtool r 0x10000 0x8000 >recovery.cur
$ cmp ug802recovkernel.img recovery.cur
cmp: EOF on ug802recovkernel.img

(note: EOF message is shown because ug802recovkernel.img is smaller than complete partition as read back by "rkflashtool r").

However, after reboot into Android, and then immediately back into bootloader, shows that receovery partition content has changed:

$ sudo ./rkflashtool r 0x10000 0x8000 >recovery.cur2
$ cmp ug802recovkernel.img recovery.cur2
ug802recovkernel.img recovery.cur2 differ: byte 10, line 1

So, there can be two explanations:

  1. Image written somehow doesn't "stick". That's highly unlikely and even mystical - we read the same content back,s o that would require conspiracy on bootloader side: if it doesn't put content into Flash, then it should put it into RAM instead, pretending it does Flash operation.
  2. Recovery image gets overwritten with some "default" backup on Android boot. That would require some misbehavior on conspiracy on vendor Android build side, and it's much easier to believe that than bootloader not flashing image in the first place.

So, the thread above suggests a way to resolve it. It specifically suggest installing a particular (essentially, random) custom ROM, promising that after that, reflashed recovery partition will be bootable. Careful user might not want to follow that advice as is because: 1) random custom ROM means random binaries of unknown origin; 2) no exact custom ROM version and download link is provided: what worked previously may not work now, also it is a chore to actually get access to an image; 3) custom ROMs are usually unduly customized, forcing one person's tastes and preferences upon unsuspecting users; that's bow to microsoftism and violates best practices of Free and Open Source, which usually offer basic functionality and allow users to easily customize system for themselves instead of finding ways to get rid of superfluous and unwelcome components and settings; 4) it's just too much to request to change entire system just to boot a Linux kernel.

So, instead it was found that flashing just CWM (ClockWorkMod) Recovery via an SD card is enough to fix these issues. Collection of CWM builds for Rockchip devices is available via (no sources/build instructions, but otherwise well maintained; plus CWM is open source and just a single component, not replacement for entire system) . Just flashing a Rockchip CWM build enables further flashing via bootloader via rkflashtool. Flashed kernel image will be immediately bootable.

Prior to the investigation, complete 4Gb Flash dump was produced. To re-verify the fix, this dump was flashed back onto device. Please note that this is equivalent of Android factory reset, so don't do this if you don't want to lose your Android data and settings (yes, even though image contains all the data and applications, Android somehow detects complete reflash and behaves as if factory reset was performed). After that, it was verified that kernel image flashed into recovery partition again don't "stick". And after installing CWM via SD card, it again became possible to flash it so it "stick".