[Discussion] Direct access to e-MMC to fix bricked KF? - CONFIRMED!

Search This thread

soupmagnet

Retired Forum Moderator
Jan 7, 2012
3,990
2,587
Austin, TX
Google Pixel 6
This is very exciting news.

The bootloader partition is 256Kb, which would be /dev/sdb2, and the recovery and boot partitions are the same size at 8MiB, /dev/sdb9 & /dev/sdb10. From the looks of it, they are all mounted to your machine in the right order(i.e. /dev/sdb1 is mmcblk0p1, /dev/sdb2 is mmcblk0p2, etc., etc.).

All you should have to replace is the bootloader, recovery and boot partitions and you should be good to go.

Code:
xloader -> /dev/block/mmcblk0p1
bootloader -> /dev/block/mmcblk0p2
idme -> /dev/block/mmcblk0p3
crypto -> /dev/block/mmcblk0p4
misc -> /dev/block/mmcblk0p5
dkernel -> /dev/block/mmcblk0p6
dfs -> /dev/block/mmcblk0p7
efs -> /dev/block/mmcblk0p8
recovery -> /dev/block/mmcblk0p9
boot -> /dev/block/mmcblk0p10
system -> /dev/block/mmcblk0p11
cache -> /dev/block/mmcblk0p12
userdata -> /dev/block/mmcblk0p13

Good luck!
 

kurohyou

Member
Aug 3, 2013
49
86
Chicago
So now all we need to figure out is which partition of those is the bootloader partition, so u can try flashing the boot loader with the dd command.

Judging by the size of the img file for the bootloader (256kB), I'm thinking sdb2. Since I can't mount yaffs2 without compiling my own kernel, I'm thinking the easiest way to double check would be to dd that partition to an image file, then unpack it and make sure there's the proper files.



Might I suggest backing up the entire emmc device with dd instead of just some of the partitions?

I'll probably do that after I reflash the original bootloader. I'd rather have a backup of something that is more likely to work than something that is not. :p

Also was wondering if all goes well, if the kfhd's emmc pin layout is the same, be nice if a solderless bolt on version could be truly "universal" for all kindles, shape wise it wouldn't be a problem as long as the bolt-on-board has multiple hole configurations.

I took a look at the KFHD teardown at ifixit. It looks like the KFHD motherboard is a completely different layout, unfortunately. The problem wouldn't be the e-MMC pinout being the same, as it's a universal standard, it's finding accessible places on the motherboard to access those pins so the chip doesn't need to be desoldered and then surface mount soldered again (a real pain, considering the lack of stencils for the pin layout and the care needed not to desolder everything while soldering it back on using a desolder station or toaster oven). If someone was willing to donate a dead KFHD, I could probably find said access points. Unfortunately, the first motherboard I get would likely not be returnable to functioning (or at least not for a long while until I can get a solder paste stencil for e-MMCs and can remount it).
 
  • Like
Reactions: soupmagnet

stunts513

Senior Member
Feb 8, 2013
2,238
635
New Braunfels, TX
Ugh well I know someone I posted to awhile ago hard bricked their kindle by flashing the 8.9 inch boot loader on a 7 inch model, pretty sure that's a hard brick unless fastboot happens to work while the screen is off. Anyways they will probably try to ship it to amazon and see if they can get it replaced, maybe if they don't take it in he might send u it. As there are a decent amount of people that hard brick their kindles on this forum I am sure that there is someone that would send you theirs.
http://d3nevzfk7ii3be.cloudfront.net/igi/OOraoCZGaUxxbVVj.huge
I'm sure you already saw this but I noticed a link to the huge version, didn't know if it was any use, but I will say I think the terminals for the emmc are very easily accessible, I believe they are the ones on the right side of the picture. Can't really scale anything though for a real circuit board though with just that pic though like you said.
Sent from my Amazon Kindle Fire HD running CM10.1 Tablet UI using xda-developers app
 
  • Like
Reactions: kurohyou

kurohyou

Member
Aug 3, 2013
49
86
Chicago
Looks like we posted on top of each other. There's no need to unpack the images to see which partitions are which. ;)

Indeed we did! Nice to have confirmation on which was the bootloader partition. I went ahead and reflashed it and put the motherboard back in. Plugged it in, and the light on the power button came on orange (which it wasn't doing before). Let it sit for a few minutes and pressed it a few more times and the low battery came up on the screen! I'm assuming it worked and the battery is just dead. I'm going to let it charge while I'm at work tonight and hopefully will have a working and fully charged KF2 in the morning. :victory:
 

kurohyou

Member
Aug 3, 2013
49
86
Chicago
As there are a decent amount of people that hard brick their kindles on this forum I am sure that there is someone that would send you theirs.

I'm sure plenty of people would, but the question is whether they'd send it with the expectation that they wouldn't get it back. :p

...but I will say I think the terminals for the emmc are very easily accessible, I believe they are the ones on the right side of the picture. Can't really scale anything though for a real circuit board though with just that pic though like you said.

Yeah. The designs are kinda tricky like that. Before I went and tracked everything down, I was convinced that most of the solder points would be in a certain area. I quickly learned otherwise. Thankfully, they were all pretty accessible anyway.
 
  • Like
Reactions: soupmagnet

kurohyou

Member
Aug 3, 2013
49
86
Chicago
One last quick update before work: Kindle charged enough to turn on. I confirmed that it now boots into fastboot with fastboot cable. It won't boot the OS but that's probably has to do with different bootloader and kernel versions. I'm going to reflash all the partitions to the same version in fastboot tomorrow when I get home and that should fix the problem. In the meantime, I'm going to say that this is confirmed. :good:
 

kurohyou

Member
Aug 3, 2013
49
86
Chicago
Just wanted to say that I'm still here. I've been working on a guide on how to do this and also planning out a component to make all the connections without soldering. I'll probably have the first draft of the guide ready to post sometime on Tuesday. I'll make sure to put a link to the new thread on here.
 

kurohyou

Member
Aug 3, 2013
49
86
Chicago
I've ran into a bit of a snag. After fixing the hard-brick, as I mentioned, it was still soft-bricked, stalling at the Kindle Fire splash screen. I tried everything I could think of... Reflashing the bootloader to 1.2.4 as found on the TWRP thread, reflashing the other partitions (several times), and even trying to install the second bootloader with TWRP (which resulted in bootloop, even after I slipped stack into a system image and flashed that to the Kindle). I soldered everything back up and decided to do some snooping at the partition table.

According to this post and this thread, the partition tables for the KF2 look like this:
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 11.0MB 10.5MB dkernel
4 11.0MB 78.1MB 67.1MB ext4 dfs
5 78.1MB 78.2MB 65.5kB idme
6 78.2MB 78.2MB 16.4kB crypto
7 78.2MB 78.2MB 2048B misc
8 78.2MB 95.0MB 16.8MB ext4 efs
9 95.0MB 103MB 8389kB recovery
10 103MB 112MB 8389kB boot
11 112MB 1041MB 929MB ext4 system
12 1041MB 1722MB 682MB ext4 cache
13 1722MB 7818MB 6096MB ext4 userdata​


The thing is, when I have it hooked up to my computer, gdisk is giving me a partition table like this:
Disk /dev/sdb: 15269888 sectors, 7.3 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): F9F21FFF-A8D4-5F0E-9746-594869AEC34E
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 15269887
Partitions will be aligned on 4-sector boundaries
Total free space is 222 sectors (111.0 KiB)

Number Start (sector) End (sector) Size Code Name
1 256 511 128.0 KiB 0700 xloader
2 512 1023 256.0 KiB 0700 bootloader
3 1024 21503 10.0 MiB 0700 dkernel
4 21504 152575 64.0 MiB 0700 dfs
5 152576 152703 64.0 KiB 0700 idme
6 152704 152735 16.0 KiB 0700 crypto
7 152736 152739 2.0 KiB 0700 misc
8 152740 185507 16.0 MiB 0700 efs
9 185508 201891 8.0 MiB 0700 recovery
10 201892 218275 8.0 MiB 0700 boot
11 218276 2032803 886.0 MiB 0700 system
12 2032804 3364003 650.0 MiB 0700 cache
13 3364004 15269887 5.7 GiB 0700 userdata​

It's also complaining about the backup GPT table being corrupt, but after doing some reading, I think it's just because it's a series of sparse images?

Anyone have any ideas on this or the hanging on boot problem?

I'm going to work on designing that solderless rig some more today. Assuming some other answer doesn't come up before then, once I get the design finished, prototyped, and tested, (probably a month+ away, considering lead time for the prototype board to get here) would some brave soul be willing to hook it up to a working KF2 to see what gdisk says about it?

In the meantime, can someone with TWRP possibly verify what it says about your partitions?

Also, I know this is a silly idea, but it's worth ruling out: What is TWRP using as conversion values between byte, kilobyte, etc.? Some quick math leads me to believe it's using 1000 instead of 1024:
15269887 (sectors) x 512 bytes (sector size) / 1000 (to kB) / 1000 (to MB) = 7818.18...​

This would probably explain the differences in partitions between the two.


P.S. I might just try to slip the 1.2.4 bootloader, 2nd-boot, TWRP, and CM on while I have it connected to the computer and see if that changes anything.
 
Last edited:

soupmagnet

Retired Forum Moderator
Jan 7, 2012
3,990
2,587
Austin, TX
Google Pixel 6
In fastboot enter the following command to reset your partition table:

fastboot -i 0x1949 oem format

When you have your stock partition table set, then you can fill those partitions with your sparse image files and it won't affect their sizes.
 
  • Like
Reactions: kurohyou

soupmagnet

Retired Forum Moderator
Jan 7, 2012
3,990
2,587
Austin, TX
Google Pixel 6
I did that too. I just forgot that I did. Memory of a goldfi...what were we talking about again? :p
You need to make sure the converted values are the same between what you have and what the stock KF2 partition has.

KiB is Kebibytes, which is 1024 bytes, whereas KB is Kilobytes (1000 bytes). Using your dfs partition as an example, the stock partition table reads 10.5 Megabytes which, when converted to Mebibytes is 10.013580322263...which is close enough to what you have on your device that I'm willing to believe there is no difference between the two.

If you want to be sure, you need to get someone else with a KF2 to get the exact sizes of their partitions in bytes for comparison. This can be done in a loop using the adb shell and the 'dd' command:

Code:
for i in $(seq 13); do adb shell su -c "dd if=/dev/block/mmcblk0p$i of=/dev/null"; done
Which will read each partition block by block and report the sizes in bytes (But, I'm sure you already know this).


You can use that information to compare the exact sizes in bytes with what you have in your partitions. If they are the same, there's a good chance you are missing something while trying to restore those partitions (perhaps you have the wrong ones, or you are missing a vital step in the process, etc.).



[Edit:] An even better way of doing it would be to use 'parted' to print the partition table while booted into TWRP:

Code:
[COLOR=DimGray]$[/COLOR] adb shell
[COLOR=DimGray]~ #[/COLOR] parted /dev/block/mmcblk0
[COLOR=DimGray](parted)[/COLOR] unit KiB print
That will print the current partition table for the device with the exact start and end blocks for each partition (in KiB), which would probably make comparison between the two about a LOT easier.
 
Last edited:

kurohyou

Member
Aug 3, 2013
49
86
Chicago
KiB is Kebibytes, which is 1024 bytes, whereas KB is Kilobytes (1000 bytes).

Wait... So when did we actually start utilizing the base ten unit in computers? I know that for the longest time it's been used as a marketing gimmick to make it seem like you're getting more for your money, but I thought it was always understand that once you left that world of cheap tricks and got to where it really mattered, it was the base two derived unit. I think this is the first thing (TWRP) that I've run across that output it like that (KB as 1000 bytes). Granted, I don't spend nearly so much time messing with computers as I do other things, so it's possible I've missed it all these years.

[Edit:] An even better way of doing it would be to use 'parted' to print the partition table while booted into TWRP:

Code:
[COLOR=DimGray]$[/COLOR] adb shell
[COLOR=DimGray]~ #[/COLOR] parted /dev/block/mmcblk0
[COLOR=DimGray](parted)[/COLOR] unit KiB print
That will print the current partition table for the device with the exact start and end blocks for each partition (in KiB), which would probably make comparison between the two about a LOT easier.

Honestly, I'd prefer to bypass this whole KiB/KB mess and just go with sectors, which are straightforward enough (and the added bonus that you can convert to KiB/KB as you wish). I don't suppose there's a way to make parted on TWRP output that, is there?

If they are the same, there's a good chance you are missing something while trying to restore those partitions (perhaps you have the wrong ones, or you are missing a vital step in the process, etc.).

I tried both using KFFirstAide and doing it manually. With KFFAide, I tried both the 10.2.1 and 10.2.3 options under KF2 and said yes to wipe userdata/cache. Maybe the images are bad? Can anyone verify that they're good images?

As for manually, I did use the same image that KFFirstAide downloaded and used these commands (in the directory containing the files):
Code:
fastboot -i 0x1949 flash boot boot.img 
fastboot -i 0x1949 flash recovery recovery.img
fastboot -i 0x1949 flash system system.img
fastboot -i 0x1949 -w
After that, still stuck at the KindleFire logo.

When I tried to to slip in stack and install 2nd-bootloader/TWRP, I first used dd to push stack into the system.img (I can't remember if I did it to the raw or sparse image) and used (on Ubuntu):
Code:
dd if=stack of=(path to system image on hard drive) bs=6519488 seek=1 conv=notrunc
Then made the image system_stack.img.

On the KF:

Code:
fastboot -i 0x1949 flash bootloader otter2-u-boot-prod-10.2.4.bin
fastboot -i 0x1949 flash boot otter2-freedom-boot-10.4.3.img
fastboot -i 0x1949 flash recovery otter2-twrp-2.6.0.0-recovery.img
fastboot -i 0x1949 flash system system_stack.img
fastboot -i 0x1949 -w

That resulted in the restarting bootloop. :eek:
 

soupmagnet

Retired Forum Moderator
Jan 7, 2012
3,990
2,587
Austin, TX
Google Pixel 6
Wait... So when did we actually start utilizing the base ten unit in computers? I know that for the longest time it's been used as a marketing gimmick to make it seem like you're getting more for your money, but I thought it was always understand that once you left that world of cheap tricks and got to where it really mattered, it was the base two derived unit. I think this is the first thing (TWRP) that I've run across that output it like that (KB as 1000 bytes). Granted, I don't spend nearly so much time messing with computers as I do other things, so it's possible I've missed it all these years.
A delineation was made, but like with everything else in IT, there are always those who are in staunch resistance to conformity.

Honestly, I'd prefer to bypass this whole KiB/KB mess and just go with sectors, which are straightforward enough (and the added bonus that you can convert to KiB/KB as you wish). I don't suppose there's a way to make parted on TWRP output that, is there?
You cant use parted to print in sectors, but you can use "unit B print" to print in Bytes and divide the values by 512.

I tried both using KFFirstAide and doing it manually. With KFFAide, I tried both the 10.2.1 and 10.2.3 options under KF2 and said yes to wipe userdata/cache. Maybe the images are bad? Can anyone verify that they're good images?

As for manually, I did use the same image that KFFirstAide downloaded and used these commands (in the directory containing the files):
Code:
fastboot -i 0x1949 flash boot boot.img 
fastboot -i 0x1949 flash recovery recovery.img
fastboot -i 0x1949 flash system system.img
fastboot -i 0x1949 -w
After that, still stuck at the KindleFire logo.

When I tried to to slip in stack and install 2nd-bootloader/TWRP, I first used dd to push stack into the system.img (I can't remember if I did it to the raw or sparse image) and used (on Ubuntu):
Code:
dd if=stack of=(path to system image on hard drive) bs=6519488 seek=1 conv=notrunc
Then made the image system_stack.img.

On the KF:

Code:
fastboot -i 0x1949 flash bootloader otter2-u-boot-prod-10.2.4.bin
fastboot -i 0x1949 flash boot otter2-freedom-boot-10.4.3.img
fastboot -i 0x1949 flash recovery otter2-twrp-2.6.0.0-recovery.img
fastboot -i 0x1949 flash system system_stack.img
fastboot -i 0x1949 -w
That resulted in the restarting bootloop. :eek:
I honestly couldn't say what's going on here. The device is booting, which means the OMAP's signature checks are successful, so there shouldn't be anything left to prevent the device from being restored. I would suggest flashing your system and stack images separate from each other, and make sure your md5sums check out before flashing.

As far as using 'fastboot -w'...my only experience with it is early on with my original KF. After using it, my sdcard and data partitions both lost their formatting and they had to be entirely rebuilt in parted before I could get it working again. You may want to check that your userdata partition still has its ETX4 formatting. It's entirely feasible that it would prevent the device from booting otherwise.
 

kurohyou

Member
Aug 3, 2013
49
86
Chicago
I would suggest flashing your system and stack images separate from each other, and make sure your md5sums check out before flashing.

Can you flash stack in fastboot? I've read and searched until my eyes nearly bled and all I can see is using adb to push it to sdcard and then using dd while it's booted in rooted stock. Am I incorrect in assuming that "fastboot flash" erases everything else that is on partition aside from what is being flashed?

As far as using 'fastboot -w'...my only experience with it is early on with my original KF. After using it, my sdcard and data partitions both lost their formatting and they had to be entirely rebuilt in parted before I could get it working again. You may want to check that your userdata partition still has its ETX4 formatting. It's entirely feasible that it would prevent the device from booting otherwise.

The last time I had it connected, I did notice that cache and userdata were no longer ext4. Any suggestions on reformatting them? I mean, it seems too straightforward to just reformat them as ext4 and expect it to work. :p


...and while I'm here, small update on the status of the no-solder device. I'm still trying to figure out the best way to make the contacts, considering the need to access at the site of SMD components. The two ideas in my head are pogo pins vs wire wrap posts/1 or 2 mm pitch headers. The problem is, the pogo pin route is a bit costly, and would mean I probably going with 1-bit data transfer (as opposed to 4-bit) which both decreases the number of pins and increases the minimum size of the pins to hold down cost (1.0 mm pitch pogo pins runs $8-9 each whereas the 2.0mm run $4-5 each). The downside to the wire wrap/header idea is that the amount of precision required with still no guarantee of a connection good enough to transfer data and the risk of bending for the wire wrap (but it would be much, MUCH cheaper). The GOOD news, however, is that I found the standoffs and a cheap usb to SD/MMC IC and nabbed samples. Standoffs are perfect for what I have in mind, and I'm still waiting on the IC.

The other idea I'm playing with is making it modular, that is, having the board that connects to the KF2 motherboard separate from the board that contains the IC/connects to USB and connect them using a ribbon cable. The positive about that is the ability to use the same control board with a board made to connect to the KFHD if/when that one is figured out. The negative: more components/boards = more cost.
 
  • Like
Reactions: soupmagnet

soupmagnet

Retired Forum Moderator
Jan 7, 2012
3,990
2,587
Austin, TX
Google Pixel 6
Can you flash stack in fastboot? I've read and searched until my eyes nearly bled and all I can see is using adb to push it to sdcard and then using dd while it's booted in rooted stock. Am I incorrect in assuming that "fastboot flash" erases everything else that is on partition aside from what is being flashed?
You're right, I didn't even think about the fact that you don't have access to adb. derp :silly:

The last time I had it connected, I did notice that cache and userdata were no longer ext4. Any suggestions on reformatting them? I mean, it seems too straightforward to just reformat them as ext4 and expect it to work. :p
Actually, that's exactly what you should do...with mke2fs perhaps? Just be sure not to 'fastboot -w' again ;)


...and while I'm here, small update on the status of the no-solder device...
Whatever you come up with, I'd be very interested in purchasing one for myself. Keep me posted.
 

lex66676

Member
Dec 6, 2012
26
11
Backup KF2 emmc use Acronis True Image Home

Hi guys! and I have a dead KF2 http://xdaforums.com/showthread.php?p=35326639#post35326639


I soldered the circuit http://xdaforums.com/showthread.php?p=44873922
using SD-microSD adaptor https://docs.google.com/file/d/0B5GqHfQ7kFGjR3FSS3AxRmRSYXM/edit?usp=sharing
edit



thank you so much "kurohyou"

Thanks to all who participated in this thread :fingers-crossed:


I would like to ask the owners to do business KF2 Backup e-mmc using Acronis True Image Home
that would roll the image of a dead e-mmc KF2 and copy the image to a file sharing.

THANK YOU FOR YOUR HELP
SORRY FOR THE TRANSLATION
 
Last edited:

ddffee

New member
Aug 12, 2013
2
0
if i want to find out the way to fix my kindle hd 8.9,what should i do?

Sent from my Nexus 4 using xda app-developers app
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    Looks like we posted on top of each other. There's no need to unpack the images to see which partitions are which. ;)

    Indeed we did! Nice to have confirmation on which was the bootloader partition. I went ahead and reflashed it and put the motherboard back in. Plugged it in, and the light on the power button came on orange (which it wasn't doing before). Let it sit for a few minutes and pressed it a few more times and the low battery came up on the screen! I'm assuming it worked and the battery is just dead. I'm going to let it charge while I'm at work tonight and hopefully will have a working and fully charged KF2 in the morning. :victory:
    5
    Just wanted to say that I'm still here. I've been working on a guide on how to do this and also planning out a component to make all the connections without soldering. I'll probably have the first draft of the guide ready to post sometime on Tuesday. I'll make sure to put a link to the new thread on here.
    4
    Hello! Been lurking for a while and just finally decided to post.

    A little background: My first Kindle Fire 2 was rooted just fine. Everything worked for several months, then the screen went bad. Called Amazon and got a replacement sent over. The night I received said replacement, I decided that I wanted to try the 2nd bootloader + TWRP and install CyanogenMod. Unfortunately, I missed the part about reverting back to the older version of the bootloader before patching. Oops.

    TLDR; Bricked KF2.


    That brings me to the main focus of this topic: After reading a plethora of threads stating that there was no way to fix a bricked KF2 with the USB, I began thinking... Theoretically speaking, couldn't the e-MMC be accessed if it was taken out and mounted to an e-MMC to USB? This would allow reflashing the partitions and (hopefully) returning it to an unbricked state. Of course, that means remounting the e-MMC to the KF2 motherboard, but you can do wonders with a stencil, some solder paste, and a toaster oven, it seems.

    Then, while searching for a good e-MMC to USB adapter, I stumbled across a very intriguing thread on hacking TomToms' NAV3 where the e-MMC is left on the device and wired to a MMC USB reader. Page 36 and 37 are the useful bits. (I can't post links yet, so this is the best to demonstrate): mobilescommunity.com/tomtom-discussions/178770-nav3-cracking-patching-copying-navcore-v10-v11-v12-36.html

    At this point, I'm just waiting on an old, broken KF1 to arrive to track down where the leads go and possible solder points. I'll keep you posted as things progress.


    Any comments, thoughts, suggestions?


    P.S. I have a feeling that this would be better suited in the development forum, but as I am new, I can't post there. Assuming that this crazy idea actually works, (and considering that I'll probably have ten posts by then), I'll likely post a clean guide over on that forum.
    4
    I made a thread for the how-to for this. Currently, it's still a WIP. You can here it here: http://xdaforums.com/showthread.php?p=44873922
    4
    Uraaa! KF2 is risen from the dead !! :cool:

    thank you very much: kurohyou,stunts513,olegykz

    here backup image KF2 emmc (KF2 10.4.6 ): sorry deleted

    can be copied using: win32diskimager sorry deleted

    !!!!! Read and Save your image first use win32diskimager !!!
    KF2_emmcConnectSDDown.jpg KF2_emmcConnectSDUP.jpg SD-microSD_adaptor.jpg

    after the firmware image will Gparted ScreenshotLINUX.png Gdisk & Fdisk log in Linux View attachment InfoTerminal.txt

    If after flashing your device stuck in the Fastboot mode use KFFirstAide100 to restore the firmware KF2 10.2.3
    sorry deleted

    Use this utility for format emmc KF2, SDformatter4_0 sorry deleted

    if you need to KFFirstAide100 files https://yadi.sk/d/By1qmwgj3Tf6Y4 sorry only run txt file
    in folder KF2 (10.2.3 firmware backup files)
    boot-prod.img boot-prod.img.md5
    recovery-prod.img recovery-prod.img.md5
    system.img system.img.md5
    in folder KindleBackup (11 partition files backup (10.4.6-PacMan4.3))
    1 xloader.img
    2 bootloader.img
    3 dkernel.img
    4 dfs.img
    5 idme.img
    6 crypto.img
    7 misc.img
    8 efs.img
    9 recovery.img
    10 boot.img
    11 system.img