View Single Post
Old 12-24-2011, 02:50 AM   #1
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,066
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Thumbs up Kindle Touch serial port recovery.

NEWS FLASH: A Kindle Touch can now be debricked in cases like mine by using only the USB Drive, even if it is only visible to the host PC for a few seconds during the reboot cycle like mine was. It has been reported to work if your Kindle is stuck at the startup screen with no progress bar, and it also works if you kindle is stuck at the dreaded "Repair Needed" screen (like mine was). No serial port connection is required, so no need to open up the Kindle back cover.

UPDATE: Success! My kindle touch works again. I was able to repair my "bricked" (unbootable) kindle touch without using a backup copy of the root partition (mmcblk0p1). Read the rest of this thread for history and details of this technical adventure. Let's begin this story at the beginning:

Yes, I need it. I did something stupid and now my Touch will not boot. It sticks at the "Repair Needed" screen. EDIT: There are reports that at least three developers have bricked their kindle touch after making small changes to startup scripts (like I did).

I do have a backup copy of my root partition, which I was sure to do before making any of my own changes to root.

Anyway, while it is booting, the USB drive is visible for about 10 seconds. By testing in a loop for a file to show up in the mount for the USB drive, then creating an ENABLE_DIAGS file, I was able to boot to the diagnostics partition. Not much useful there, unlike the Kindle 4. Time to crack it open and make a serial cable.

After many hours of messing around with little success, and even after building level converters for 1.8v TTL TxD to 3.3v TTL RxD, and 3.3v TTL TxD to 1.8v TTL RxD, it still did not work. Time to get out the oscilloscope.

With the scope I could see that when attached to the USB serial adapter, the kindle TxD output logic zero was way too high. After much testing, I discovered that the USB serial adapter had an LED attached directly to the RxD pin with no buffer or isolation. The 1.8v TTL TxD from the kindle could not sink that much current. It could only get what should be near 0v down to about 2.5v.

I then unsoldered the surface mount LED on the USB adapter. Then the adapter needed an external pullup resistor, which was 2.2K ohms in my level shifter circuit. Even without the LED, the kindle could only get the output down to about 1.8v. I increased the value of the pullup resistor to 22K ohms, and now the kindle could get the logic 0 down to about 0.7v, and (finally) there was serial data on my terminal screen. Here it is:

Spoiler:
PHP Code:
U-Boot 2009.08-lab126 (Nov 03 2011 11:56:43)

CPU:   Freescale i.MX50 family 1.1V at 800 MHz
mx50 pll1
800MHz
mx50 pll2
400MHz
mx50 pll3
216MHz
ipg clock     
50000000Hz
ipg per clock 
50000000Hz
uart clock    
24000000Hz
ahb clock     
100000000Hz
axi_a clock   
400000000Hz
axi_b clock   
200000000Hz
weim_clock    
100000000Hz
ddr clock     
800000000Hz
esdhc1 clock  
80000000Hz
esdhc2 clock  
80000000Hz
esdhc3 clock  
80000000Hz
esdhc4 clock  
80000000Hz
MMC
:  FSL_ESDHC0FSL_ESDHC1
Board
Whitney WFO
Boot Reason
: [POR]
Boot DeviceMMC
Board Id
XXXXXXXXXXXXXX
S
/NB011XXXXXXXXXXXX
DRAM
:  256 MB
Using 
default environment

In
:    serial
Out
:   logbuff
Err
:   logbuff
Quick Memory Test 0x70000000
0xfffe000
POST done in 13 ms
Hit any key to stop autoboot
:  0
## Booting kernel from Legacy Image at 70800000 ...
   
Image Name:   Linux-2.6.31-rt11-lab126
   Image Type
:   ARM Linux Kernel Image (uncompressed)
   
Data Size:    5090112 Bytes =  4.9 MB
   Load Address
70008000
   Entry Point
:  70008000
   Verifying Checksum 
... OK
   Loading Kernel Image 
... OK
OK
Starting kernel 
...
mxc_spi mxc_spi.0chipselect 0 already in use
mxc_spi mxc_spi.0chipselect 0 already in use
mxc_spi mxc_spi.2chipselect 0 already in use
2.6.31-rt11-lab126 #1 Thu Nov 3 12:14:23 PDT 2011 armv7l
INFO:Loaded module /lib/modules/eink_fb_waveform.ko  (35728 bytes)
mxc_epdc_fb mxc_epdc_fbnot use_builtin_cmap !!
INFO:Loaded module /lib/modules/mxc_epdc_fb.ko default_panel_hw_init=1 default_update_mode=(45148 bytes)
INFO:eink initialized... (486400 bytes)
INFO:Using default keypad setting. (not passing "kb_rev" to module)
INFO:Loaded module /lib/modules/whitney_button.ko  (9268 bytes)
Press [ENTER] for recovery menu...       /INFO:*** Partition table verified for /dev/mmcblk0 ***
INFO:Checking for updates... (auto-pilot mode)
/
dev/mmcblk0p4:
CHS=4/16/105536 size=3458203648 bytes
flag type      first       last  lba first   lba size
Partition p1
:
0x00 0x0b         16 <large>            16    6754288
    CHS
0/1/- <large>
Partition p2:
Partition p3:
Partition p4:
INFO:Setup loop device /dev/loop0 for /dev/mmcblk0p4 8192
INFO
:No update*.bin foundno update needed.
INFO:no updates found.
BOOTING DEFAULT.
  
argc == 10
  argv
[0]: "kinit"
  
argv[1]: "consoleblank=0"
  
argv[2]: "rootwait"
  
argv[3]: "ro"
  
argv[4]: "ip=off"
  
argv[5]: "root=/dev/mmcblk0p1"
  
argv[6]: "quiet"
  
argv[7]: "eink=fslepdc"
  
argv[8]: "video=mxcepdcfb:E60,bpp=8"
  
argv[9]: "console=ttymxc0,115200"
  
argc == 4
  argv
[0]: "IP-Config"
  
argv[1]: "-i"
  
argv[2]: "Linux kinit"
  
argv[3]: "ip=off"
IP-Configno devices to configure
kinit
do_mounts
kinit
name_to_dev_t(/dev/mmcblk0p1) = dev(179,1)
kinitroot_dev dev(179,1)
kinit: /dev/root appears to be a ext3 filesystem
kinit
trying to mount /dev/root on /root with type ext3
kinit
Mounted root (ext3 filesystemreadonly.
info firsttime:mount_rw:time=4600:Mounting root RW for first boot
info firsttime
:mount_ro:time=4960:Mounting root RO
info modules
:modprobe:loading module g_file_storage:
init.exerecevent pre-start process (529terminated with status 1
info system
:start:time=5160:
info hardware:no_wan::WiFi only deviceNo WAN found
info modules
:modprobe:loading module fuse:
info system:config:platform=yoshi,board=whitney,rev=20,proto=N,wifi=Y,wan=N:
info modules:modprobe:loading module ppp_async:
info modules:modprobe:loading module whitney_button:
info system:done:time=6630:
info zforce:start:version=2.0b0r12:
info userstore:run:time=6980,action=start:
info userstore:found_shutdown_flag::Found SHUTDOWN flag file
info display
:started:time=7150:
info battery:charged:cap=100,mV=4126,mAH=1474:



Welcome to Kindle!

kindle logininfo hardware:no_wan::WiFi only deviceNo WAN found
info X
:load:time=10700:
info X:xorg.conf:Generating xorg.conf:
MAC from kernel xx:xx:xx:xx:XX:XX
info X
:makexconfig:Whitney Input device detection status:
info X:makexconfig:KeypadOK:
info X:makexconfig:Touch deviceOK:
info X:makexconfig:Accelerometer deviceN/!!:
info X:xorg.conf:xorg.conf generated:
info X:starting:time=12390:
wmi_control_rx() : Unknown id 0x101e
info X
:started:time=17440:
info blanket_f:module already loaded:splash:
info X:keyboard:Disabling keyboard repeat on Home Key:
info locale:read:lang=en_US.utf8,lc_all=en_US.utf8:Retrieved Language
crit lab126_gui
:reboots=2,max=2:shutting down and showing customer service page:
info shutdown:begin:level=0,halt=1,special=cust_service:
info upstart_f:job_already_stopped:job=passwdlg:
info upstart_f:jobs_stopped:elapsed_ms=0,timeout_ms=20000:
info blanket_f:loading blanket module:shutdown:
info shutdown_showimage:screen:splashing screen:cust_service
info shutdown_showimage
:screen:waiting for cust_service screen to come up:
info upstart_f:stopping_job:job=lab126:
info upstart_f:stopping_job:job=x:
Reset Cause readback0x2
info upstart_f
:jobs_stopped:elapsed_ms=4360,timeout_ms=45000:
info shutdown:cust_service:starting:
info ss_cust_service:nothing to do for this shutdown mode:"cust_service":
info ss_cust_service:completed successfully::
info shutdown:cust_service:done:
info upstart_f:stopping_job:job=filesystems:
info filesystem:unmount_userstore:Unmounting UserStore:
info userstore:run:time=28720,action=stop:
info userstore:found_bootup_flag::Found BOOTUP flag file
info filesystem
:rotate_log:Rotating Logs:
bootW def:hlt:halt=Device,version=000000:
info filesystem:unmount_varLocal:Unmounting VarLocal:
info upstart_f:jobs_stopped:elapsed_ms=3940,timeout_ms=30000:
info shutdown:mounting root filesystem read-only::
info shutdown:syncing disks::
info shutdown:end:level=0,halt=1:
System halted.
Halting ... 


Next step: use this working serial port to do the recovery, but I need some sleep before I do something even more stupid.

Stupid is as stupid does, and all that...

By the way, being in a hurry and not having an official connector, I first tried cutting down a microSDHC adapter that had the same pin spacing. No obvious way to attach it though. Next I cut down a telephone extension cord plug (USA style pinout). After test fitting, I could see that it would snap in place and stay, if only I had cut off just a little less plastic in a couple of carefully controlled locations.

I ended up using some old IDE ribbon cable (a strip of 3 wires about 6 inches long). I stripped and solder-tinned both ends, then soldered one end to the pins in the kindle socket. The other end went first to my adaptor, then later to my level shifter circuit. The circuit uses open space (rat's nest, or point-to-point) wiring method, which works fine if the component leads are cut short enough and spaced safely apart. That is the way TVs and radios were wired in the old vacuum tube days, with the assistance of terminal strips where needed.

The 3-wire ribbon cable is held in place with some tape. I think I will leave it attached and tucked safely inside when I replace my back cover.

I will post my progress when I resume this recovery after some sleep.

Last edited by geekmaster; 12-31-2011 at 06:55 AM.
geekmaster is offline   Reply With Quote