Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 07-25-2022, 04:10 PM   #1
trimen
Junior Member
trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'
 
Posts: 7
Karma: 10052
Join Date: Jul 2022
Location: Prague
Device: PW4,5
PW2 flashing system after eMMC replacement

Hi,

I've got a non-functional kindle PW2 (sn. prefix 9017). After investigating logs on UART, I've concluded that the original eMMC is non-functional. (IO errors)
I was able to obtain SN and PCBSN. (however due to my stupidity I did not backup MAC addresses)
So I bought a new eMMC, which I replaced. eMMC seems to be working, as I was able to set back the SN and the PCBSN.

I based my approach on this thread.

I successfully compiled u-boot with the fastboot support and production version without fastboot. Then I successfully booted them via MfgTool and verified their functionality.
In order to prevent problems, I opted to flash the bootloader only after I'll be able to boot into the main system as I don't want to have bootloader without fastboot in device eMMC (I had to patch the source in order to compile it properly, due the references to non-existent functions)

In this thread I found information that the Amazon update package includes the MMC images, but when I tried to unpack the update file update_kindle_paperwhite_v2_5.8.7.0.1.bin with kindletool I've got only the u-boot binary and rootfs.img image.

I tried to dig here at the forum, but most of the published links are outdated and nonfunctional.
For example here and here.

I would like to ask if someone is able to provide me with the correct images for flashing all system partitions via fastboot or point me on how to extract them from available sources as I couldn't find any relevant sources here or anywhere else.

---
Sorry if the post is a bit inconsistent, it's been a long day and I did not make any progress to the successful boot.
Thanks in advance.
trimen is offline   Reply With Quote
Old 07-26-2022, 07:28 AM   #2
eddie.t.h
Groupie
eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.
 
eddie.t.h's Avatar
 
Posts: 199
Karma: 123456
Join Date: Jan 2018
Device: Too Much Kindle :-)
Everything you need you have in the update file. After unzipping in the imx60_wario directory you have u-boot.bin - that's the bootloader and uImage - that's the kernel. Using fastboot flash the kernel and boot the reader normally. Then using the tools built into the kernel, initialize the partitions, share the FAT partition over USB, record the update file there and run the update from the options.
You will be missing the diag partition, but it is not really needed for the reader to work.
If you had the reader registered to your account then Amazon employees should give you the correct MAC address.
eddie.t.h is offline   Reply With Quote
Advert
Old 07-26-2022, 10:29 AM   #3
trimen
Junior Member
trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'
 
Posts: 7
Karma: 10052
Join Date: Jul 2022
Location: Prague
Device: PW4,5
Thanks for pointing me in the right direction. Because I was tired, I missed that there is uImage.

After trying to boot it, it started just fine and I was able to initialize the eMMC and boot system, so now I have PW2 with 32GB of internal storage!

Just one last thing, where can I obtain diags partition and kernel. I would like to have my kindle full-featured.
trimen is offline   Reply With Quote
Old 07-26-2022, 11:45 AM   #4
eddie.t.h
Groupie
eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.
 
eddie.t.h's Avatar
 
Posts: 199
Karma: 123456
Join Date: Jan 2018
Device: Too Much Kindle :-)
Check those from the attachment.
Attached Files
File Type: gz mmcblk0p2.bin.gz (8.66 MB, 139 views)
File Type: gz diags_kernel.img.gz (2.30 MB, 121 views)
eddie.t.h is offline   Reply With Quote
Old 07-26-2022, 12:41 PM   #5
trimen
Junior Member
trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'trimen knows the difference between 'who' and 'whom'
 
Posts: 7
Karma: 10052
Join Date: Jul 2022
Location: Prague
Device: PW4,5
Thank you for providing the archives.
However, it will need more digging around because there is a potential problem with diags kernel version.

I would like to know, what is variable "sec" in u-boot idme command. I set it to zero, but I cannot find what it's related to.



Code:
[    2.035511] mmc0: unrecognised EXT_CSD revision 8
[    2.040281] mmc0: error -22 whilst initialising MMC card
[    2.050390] Freeing init memory: 1036K
3.0.35-lab126 #1 Tue Sep 3 03:12:16 PDT 2013 armv7l
[    2.258350] emmc: I def:mmcpartinfo:vendor=unknown, host=mmc0, manufacturer_id=0x13:
[    2.296709] mmc0: unrecognised EXT_CSD revision 8
[    2.301440] mmc0: error -22 whilst initialising MMC card
[    2.399185] add wake up source irq 104
[    2.530019] emmc: I def:mmcpartinfo:vendor=unknown, host=mmc0, manufacturer_id=0x13:
[    2.559302] KERNEL: I pmic:fg battery init::mg config init successful
[    2.566926] max77696-battery max77696-battery.0: Voltage alert     3400mV ... 4260mV
[    2.575359] max77696-battery max77696-battery.0: SOC alert         (disabled)
[    2.591427] mmc0: unrecognised EXT_CSD revision 8
[    2.596156] mmc0: error -22 whilst initialising MMC card
[    3.507313] KERNEL: I pmic:fg battery id check::wario_battery_valid=1
trimen is offline   Reply With Quote
Advert
Old 07-26-2022, 12:55 PM   #6
eddie.t.h
Groupie
eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.
 
eddie.t.h's Avatar
 
Posts: 199
Karma: 123456
Join Date: Jan 2018
Device: Too Much Kindle :-)
It's just that the memory you used is too "new" for this kernel to recognize. Unfortunately, Amazon has not upgraded the diagnostic kernel.

As for the "sec" number, unfortunately, this is a great secret of Amazon. I tried once after replacing the memory to recover this number from them but apparently they do not have it in any database. It looks like it must be somehow related to the rest of the serial numbers. In any case, without it, you will no longer register this reader. The only option is to solder back the old Flash memory and make a backup of all numbers.
eddie.t.h is offline   Reply With Quote
Old 08-03-2022, 08:34 AM   #7
mscuttari
Junior Member
mscuttari began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Aug 2022
Device: Kindle Paperwhite 2
I'm in a similar situation with my Paperwhite 2. All of a sudden (since a lot of months, tbh, but it makes no difference) the device is being recognized as "SE Blank MEGREZ" and I've been trying to reflash the bootloader and all the stuff.
I managed to compile u-boot but now when I try to load it with MfgTool I am missing some of the expected serial output, such as the board name and the ram size:

Code:
U-Boot 2009.08-lab126 (Aug 03 2022 - 12:50:24)


CPU: Freescale i.MX6 family TO0.0 at 996 MHz

Temperature:   45 C, calibration data 0x5734fe5f

mx6sl pll1: 996MHz

mx6sl pll2: 528MHz

mx6sl pll3: 480MHz

mx6sl pll8: 50MHz

ipg clock     : 66000000Hz

ipg per clock : 66000000Hz

uart clock    : 80000000Hz

cspi clock    : 60000000Hz

ahb clock     : 132000000Hz

axi clock   : 198000000Hz

emi_slow clock: 22000000Hz

ddr clock     : 396000000Hz

usdhc1 clock  : 198000000Hz

usdhc2 clock  : 198000000Hz

usdhc3 clock  : 198000000Hz

usdhc4 clock  : 198000000Hz

MMC:  FSL_ESDHC: 0,FSL_ESDHC: 1,FSL_ESDHC: 2
This is what I did:
I downloaded the Kindle_src_5.6.2.1_2634390002 source package (more recent ones are missing the boardinfo.h, and I found this to be complete, maybe there are more recent ones that are also complete).
I compiled the bundled linaro toolchain.
I patched include/configs/imx60_wario.h as explained here, then I did the following:
Code:
make CROSS_COMPILE=arm-linux-gnueabi- imx60_wario_config
TYPE=prod make CROSS_COMPILE=arm-linux-gnueabi- -j4
cp u-boot.in ../u-boot-prod.bin
make clean
make CROSS_COMPILE=arm-linux-gnueabi- imx60_wario_bist_config
TYPE=bist make CROSS_COMPILE=arm-linux-gnueabi- -j4
cp u-boot.in ../u-boot-bist.bin
I copied the .bin files one level higher because I noticed that they would get erased by the clean command. Then I followed the other modifications for MfgTool that are listed in the same tried, and tried to flash the u-boot-prod.bin file.
The MfgTool itself reports a failure and here's the log, but still I get the (partial) information on the serial port.

Code:
DLL version: 2.2.3
Wednesday, August 03, 2022 14:28:39   Start new logging
ModuleID[2] LevelID[10]: CMyExceptionHandler thread is running
ModuleID[2] LevelID[1]: new MxHidDeviceClass
ModuleID[2] LevelID[10]: new MxHidDevice[03AED888]
ModuleID[2] LevelID[10]: Device Manager thread is running
ModuleID[2] LevelID[10]: CmdOperation[0] device chagned and reset to state 0
ModuleID[2] LevelID[10]: ExecuteCommand--Boot[WndIndex:0], File is C:\<hidden for privacy>\Mfgtools-Rel-4.1.0_130816_MX6SL_UPDATER\Profiles\MX6SL Linux Update\OS Firmware\u-boot.bin
ModuleID[2] LevelID[10]: *********MxHidDevice[03AED888] Jump to Ramkernel successfully!**********
ModuleID[2] LevelID[1]: PortMgrDlg(0)--MxHidDevice--Command Boot excute failed
ModuleID[2] LevelID[10]: CmdOperation[0], current command executed failed, so SetEvent(hDevCanDeleteEvent)
I have also tried unpacking with kindletool the update provided by Amazon and flashing the contained u-boot.bin, but that does not seem to work at all, and I get the following log from MfgTool (and no output on the serial port):

Code:
DLL version: 2.2.3
Wednesday, August 03, 2022 14:33:26   Start new logging
ModuleID[2] LevelID[10]: CMyExceptionHandler thread is running
ModuleID[2] LevelID[1]: new MxHidDeviceClass
ModuleID[2] LevelID[10]: new MxHidDevice[0413D888]
ModuleID[2] LevelID[10]: Device Manager thread is running
ModuleID[2] LevelID[10]: CmdOperation[0] device chagned and reset to state 0
ModuleID[2] LevelID[10]: ExecuteCommand--Boot[WndIndex:0], File is C:\<hidden for privacy>\Mfgtools-Rel-4.1.0_130816_MX6SL_UPDATER\Profiles\MX6SL Linux Update\OS Firmware\u-boot.bin
ModuleID[2] LevelID[1]: MxHidDevice::Write() Error writing to device 0x3e3.
ModuleID[2] LevelID[1]: RunPlugIn(): TransData(0x9804A0, 0x1A1DC,0x4147FC0) failed.
ModuleID[2] LevelID[1]: PortMgrDlg(0)--MxHidDevice--Command Boot excute failed
ModuleID[2] LevelID[10]: CmdOperation[0], current command executed failed, so SetEvent(hDevCanDeleteEvent)
Do you have any suggestion?
mscuttari is offline   Reply With Quote
Old 08-03-2022, 01:15 PM   #8
mscuttari
Junior Member
mscuttari began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Aug 2022
Device: Kindle Paperwhite 2
I think I've found the problem.
The interrupt-checking loop inside drivers/mmc/imx_edshc.c, at line 380, never terminates. Seems like the interrupt never gets raised.

Code:
	while (!(tmp = 
		 (readl(&regs->irqstat) & IRQSTAT_TC))
	       );
A quick (hand-written) draft of the stack trace:
Code:
esdhc_send_cmd
mmc_read
idme_check_update
setup_board_info
...
I suspect the emmc to have failed, and thus the DMA to not raise the interrupt for the finished operation, but I don't know how to confirm that.

Aside from this, I don't understand why the stock pre-built u-boot.bin is not printing anything at all.
mscuttari is offline   Reply With Quote
Old 08-04-2022, 02:08 AM   #9
eddie.t.h
Groupie
eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.
 
eddie.t.h's Avatar
 
Posts: 199
Karma: 123456
Join Date: Jan 2018
Device: Too Much Kindle :-)
Quote:
Aside from this, I don't understand why the stock pre-built u-boot.bin is not printing anything at all.
The U-boot stops when it is supposed to detect the flash memory. Yours is damaged in some way and the whole process freezes. You need to start by replacing it.
eddie.t.h is offline   Reply With Quote
Old 08-04-2022, 05:38 AM   #10
mscuttari
Junior Member
mscuttari began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Aug 2022
Device: Kindle Paperwhite 2
Quote:
Originally Posted by eddie.t.h View Post
The U-boot stops when it is supposed to detect the flash memory. Yours is damaged in some way and the whole process freezes. You need to start by replacing it.
Yeah I finally managed to flash the pre-built u-boot that is in the update file. The official Windows tool (MfgTool) couldn't do it, but imx_usb on Linux (which is not an official tool) did the job.

It goes past the log I posted but it reports an mmc failure. Maybe newer versions have included a timeout to detect it, but I've not checked the source code to actually confirm it.

It's funny to see how it broke even though the device has been barely used at all.

Code:
esdhc_send_cmd: data2 ransfer fail status=0x100000
mmc read failed

Error! Couldn't read NV variables. (-1)
Sadly I don't have the required tools for bga chip soldering but it's a thing I've been needing for a while, also for other stuff, so I will try in future to get it and replace the memory chip (I know about the steep learning curve and I will make some other tests beforehand).
mscuttari is offline   Reply With Quote
Old 08-04-2022, 04:08 PM   #11
eddie.t.h
Groupie
eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.
 
eddie.t.h's Avatar
 
Posts: 199
Karma: 123456
Join Date: Jan 2018
Device: Too Much Kindle :-)
Unfortunately, you have lost all the identification numbers of your device. It will never be 100% operational, i.e. you will not register it in your Amazon account again.
You can try to freeze the Flash memory chip - sometimes it is enough to make it work for a while.

Last edited by eddie.t.h; 08-04-2022 at 04:11 PM.
eddie.t.h is offline   Reply With Quote
Old 08-04-2022, 05:32 PM   #12
mscuttari
Junior Member
mscuttari began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Aug 2022
Device: Kindle Paperwhite 2
Quote:
Originally Posted by eddie.t.h View Post
Unfortunately, you have lost all the identification numbers of your device. It will never be 100% operational, i.e. you will not register it in your Amazon account again.
You can try to freeze the Flash memory chip - sometimes it is enough to make it work for a while.
What do you mean with identification numbers? If you mean serial number and mac address I have both. The first was on my Amazon account, while I contacted the Amazon support for the second.
mscuttari is offline   Reply With Quote
Old 08-05-2022, 03:20 AM   #13
eddie.t.h
Groupie
eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.
 
eddie.t.h's Avatar
 
Posts: 199
Karma: 123456
Join Date: Jan 2018
Device: Too Much Kindle :-)
Serial number, mac address of the WiFi card, pcb serial number - these three can be recovered without a problem, unfortunately there is still such a thing as a second serial number (SEC), which is somehow mysteriously calculated from the remaining numbers (I suppose). Without it, the reader will not pass verification on Amazon servers.
eddie.t.h is offline   Reply With Quote
Old 08-05-2022, 05:39 AM   #14
mscuttari
Junior Member
mscuttari began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Aug 2022
Device: Kindle Paperwhite 2
So you're saying that who performed an emmc upgrade didn't get a fully operational Kindle? Where is the SEC stored?
mscuttari is offline   Reply With Quote
Old 08-05-2022, 06:42 AM   #15
eddie.t.h
Groupie
eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.eddie.t.h is an accomplished Snipe hunter.
 
eddie.t.h's Avatar
 
Posts: 199
Karma: 123456
Join Date: Jan 2018
Device: Too Much Kindle :-)
If you have an working orginal memory (at least a working u-boot) , you can read off all the numbers. They are stored in a protected Flash Memory Area (RPMB). Numbers can be read and written to uboot using the idme command.

Last edited by eddie.t.h; 08-05-2022 at 06:46 AM.
eddie.t.h is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PW2 eMMC Capicity Upgrade Tutorial! zephray Kindle Developer's Corner 29 08-14-2023 06:52 PM
PW2 Unbricking PW2 - erased eMMC mecnal Kindle Developer's Corner 2 12-15-2019 07:39 PM
Jbed pw2 trashes file system of it crashes barkas Kindle Developer's Corner 17 01-06-2015 04:10 PM
I pulled a goof and broke my Kindle. Replacement: can someone help downgrade PW2 drakebelisarius Kindle Developer's Corner 1 02-23-2014 07:36 PM
need replacement for PW2 peaceridge Which one should I buy? 45 12-10-2013 09:42 AM


All times are GMT -4. The time now is 02:55 PM.


MobileRead.com is a privately owned, operated and funded community.