View Single Post
Old 04-07-2018, 07:47 AM   #4
3ldn1k
Member
3ldn1k began at the beginning.
 
3ldn1k's Avatar
 
Posts: 12
Karma: 10
Join Date: Apr 2018
Location: russia, india
Device: kt3 basic
tutorial to unbrick kindle kt3 basic 2016, after flashing wrong diags over fastboot

(to moderator: please update this post, because previous has errors in [color])
hello, world.
... few days ago i send wrong image to diags_kernel partition, it bricks my reader.

Image on screen freezed with "Reboot and enter fastboot mode." message, reader stucked in bootloader, with attempt to boot diags, but has no diags partition:




Now, here is my "uboot unbrick from no-diags method", commands is bold:
  1. solder serial (make good, better if all-soldered connections), establish u-boot connection (i use linux and minicom terminal, with file transfer abilities).
  2. start kindle, wait for uboot terminal connection, when boot process crash with:
    <...>
    BOOTing diags from mmc ...
    mmc1(part 0) is current device
    MMC read: dev # 1, block # 29392, count 28672 ... 28672 blocks read in 319 msec: OK
    MMC read: dev # 1, block # 29192, count 256 ... 256 blocks read in 6 msec: OK
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    <...>
  3. here, in uboot prompt, you can use help command, try bist and then fastboot, if it doesnt work - go next steps, and if you are lucky, and fastboot possible - go to step #16
  4. uboot > printenv
    output will be similar like this (we need only values from red strings):
    Spoiler:
    <...>
    baudrate=115200
    boot_fdt=no
    bootcmd=run diags_boot
    bootdelay=3
    console=ttymxc0
    diags_boot=echo BOOTing diags from mmc ...; run setmmcdev; run loadkernel_diags; run loadd}
    fdt_addr=0x83000000
    loadaddr=0x80800000
    loaddt=mmc read 0x83000000 0x208 0x100;
    loaddt_diags=mmc read 0x83000000 0x7208 0x100;
    loadkernel=mmc read 0x80800000 0x2D0 0x7000;
    loadkernel_diags=mmc read 0x80800000 0x72D0 0x7000;

    mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot} uart_at_4M
    mmcargs_diags=setenv bootargs console=${console},${baudrate} root=/dev/mmcblk0p2 rootwait w
    mmcautodetect=yes
    mmcdev=1
    mmcpart=2
    mmcroot=/dev/mmcblk0p1 rootwait rw
    setmmcdev=mmc dev 1 0;
    stderr=serial
    stdin=serial
    stdout=serial
    testboot=echo BOOTing from mmc ...; run setmmcdev; run loadkernel; run loaddt; run mmcargs}

    Environment size: 940/8188 bytes
    uboot >
    <...>
  5. next, send file to memory with loady command:
    uboot > loady
  6. press ctrl-a, then release keys and press 'S', choose and send diagkern.bin from your backup (i used minicom terminal, you can send image to loadpoint by different methods), choose ymodem protocol, wait for loading, press any key.
  7. uboot > md 0x80800000
    (it shows you first part of your image in memory (now you can compare it with diagkern.bin file)
  8. remember or write address, where file loaded:
    <...>
    Ready for binary (ymodem) download to 0x80800000 at 115200 bps...
    <...>
  9. look at loadpoint in emmc with md 0x83000000 command, you can see some code, from wrong, previous flashed flashed "diags_kernel" partition.
  10. uboot > protect off all
    (very important step, because next step - write blocks to EMMC)
  11. uboot > mmc read 0x80800000 0x208 0x24B8
    uboot output:
    <...>
    uboot > mmc read 0x80800000 0x208 0x24B8
    MMC read: dev # 1, block # 520, count 9400 ... 9400 blocks read in 107 msec: OK
    <...>
  12. uboot > mmc write 0x83000000 0x208 0x24B8
    uboot output:
    <...>
    uboot > mmc write 0x83000000 0x208 0x24B8
    MMC write: dev # 1, block # 520, count 9400 ... 9400 blocks write in 272 msec: OK
    <...>
  13. uboot > bootm 0x83000000
  14. uboot > bist
  15. uboot > fastboot
  16. to flash diags kernel over fastboot - take file diagkern.bin, from working 5.9.4 backup, open new terminal window, and send fastboot command:
    > fastboot flash diags_kernel diagkern.bin
    in linux you must use sudo before fastboot. also, here you can flash other backup files.
  17. uboot > bootm 0x83000000
  18. reset, for reboot kindle.
  19. to let system boot in main mode - open new terminal window, and send fastboot command:
    > fastboot set bootmode main
  20. Job Well Done! (c)Darkwing Duck

    2018, Dr.01d
3ldn1k is offline   Reply With Quote