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 10-04-2017, 08:48 PM   #16
varu
Member
varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'
 
Posts: 12
Karma: 10000
Join Date: Sep 2017
Device: Kindle PW2
The plan is to change how the display temperature is retrieved, having the adc_disp_gettemp_work function hard-set display_temp_c to a sane value, say 25c (which also happens to be the default sane value chosen: #define DISP_DEFAULT_TEMP 25).

This will ensure that a comparison for the battery temperature still takes place, while also disabling the constant ADC polls. Whether the display will come out unreadable remains to be seen; so far, the display temperature gets set to either 43 or 75C depending on the kernel and I've yet to see unreadable output on it.

Again, I'm open to any suggestions, minus relegating it to the spare parts bin - not giving up just yet

On kernel recompilation, I used the 5.4.3.2 sources, built the included toolchain, & got as far as the compile stage (using these instructions). I used the .config from a live 5.4.3.2 kernel, retrieved from /proc/config.gz. However, I'm now stuck at:

Spoiler:
Code:
  GEN     usr/initramfs_data.cpio
File /initrd/lib/klibc/lib/klibc-XXXXXXXXXXXXXXXXXXXXXXXXXXX.so could not be opened for reading
 line 61
File /initrd/initramfs/lib/arcotg_udc.ko could not be opened for reading
 line 69
File /initrd/initramfs/lib/g_file_storage.ko could not be opened for reading
 line 70
File /initrd/initramfs/lib/mxc_epdc_fb.ko could not be opened for reading
 line 73
File /initrd/lib/klibc/bin/ipconfig could not be opened for reading
 line 77
File /initrd/lib/klibc/bin/nfsmount could not be opened for reading
 line 78
File /initrd/lib/klibc/bin/run-init could not be opened for reading
 line 79
File /initrd/lib/klibc/bin/cat could not be opened for reading
 line 80
File /initrd/lib/klibc/bin/sleep could not be opened for reading
 line 81
File /initrd/sbin/recovery-util could not be opened for reading
 line 82
File /initrd/sbin/hotplug could not be opened for reading
 line 83
File /initrd/lib/klibc/bin/kinit could not be opened for reading
 line 84
File /initrd/lib/klibc/bin/sh.shared could not be opened for reading
 line 85
File /initrd/initramfs/bin/mkdosfs could not be opened for reading
 line 86
File /initrd/initramfs/bin/load_waveform.sh could not be opened for reading
 line 87
make[1]: *** [usr/initramfs_data.cpio] Error 255
make: *** [usr] Error 2


These seem to be the files from the statically linked initramfs. Extracting this and the files contained within from the 5.4.3.2 uImage is no problem thanks to this guide, but I'm not sure how to work it back into the kernel compile stage. The goal is to get a functional kernel compiled, after which I can make the necessary modifications to max77696-adc.c.
varu is offline   Reply With Quote
Old 10-05-2017, 01:02 AM   #17
varu
Member
varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'
 
Posts: 12
Karma: 10000
Join Date: Sep 2017
Device: Kindle PW2
The above turned out to be a deceptively easy fix: dump all the initramfs files in a folder, change initramfs.list locations to match, and voila.

Next up:

Code:
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
arch/arm/mach-mx6/built-in.o: In function `arch_idle_single_core':
usb_h1.c:(.text+0x874): undefined reference to `wdg_prep'
arch/arm/mach-mx6/built-in.o: In function `reduce_bus_freq':
usb_h1.c:(.text+0xfd0): undefined reference to `wdg_prep'
usb_h1.c:(.text+0x111c): undefined reference to `wdg_prep'
arch/arm/mach-mx6/built-in.o: In function `set_high_bus_freq':
usb_h1.c:(.text+0x13f0): undefined reference to `wdg_prep'
make: *** [.tmp_vmlinux1] Error 1
That references the watchdog, the function is imx2_wdt.c, which is being loaded:

Code:
cat .config | grep WDT
CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT=y
CONFIG_IMX2_WDT=y
wdg_prep is a LAB126-specific option:

Code:
#ifdef LAB126

void wdg_prep(){
	imx2_wdt_ping();
}

#endif
.. which should also be enabled:

Code:
cat .config | grep LAB126
CONFIG_LAB126_PRINTK_BUFFER=y
CONFIG_LAB126=y
Now I'm stumped
varu is offline   Reply With Quote
Old 10-05-2017, 02:49 AM   #18
varu
Member
varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'
 
Posts: 12
Karma: 10000
Join Date: Sep 2017
Device: Kindle PW2
It worked!

Inspired by coplate's thread I decided to try compiling with 5.8.1 instead. I used the same process to retrieve the 5.8.1 kernel's config & initramfs. I then made one simple modification to drivers\hwmon\max77696-adc.c:

Code:
static void adc_disp_gettemp_work(struct work_struct *work)
{

    /*this is the only place display_temp gets updated, so no mutex needed! */
    display_temp_c = 25;

    schedule_delayed_work(&adc_disp_temp_work, msecs_to_jiffies(DISP_ADC_TEMP_THRESHOLD));
    return;
}
One successful compile & flash later and I have a successful boot. No more attempts to read the ADC, display_temp_c is always 25, the battery check passes, the display renders fine, and since I'm no longer in diags mode, the touchscreen works!

I'd still like to successfully compile a 5.4.x kernel with the 'fix' - once this is done I will revisit the thread and document the process start to finish. The build issue with the 5.4.3.2 kernel in the previous post remains open. This has now also been resolved, once the errors mentioned above are resolved the kernel compiles just fine & behaves just as the 5.8.1 does - no ADC hits, no temp check failures. That said, I'm not satisfied with the way I resolved it, so this step will be documented once I figure it out to my satisfaction. Now I'm happy with it, essentially looked at how they were doing it in the 5.8.7.0 kernel and adapted the 5.4.3.2 source, very few changes needed. Documentation coming soon.

Last edited by varu; 10-05-2017 at 02:25 PM.
varu is offline   Reply With Quote
Old 12-09-2017, 10:03 AM   #19
nitRA_M
Junior Member
nitRA_M began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Dec 2017
Device: Kindle Paperwhite 3
Hey varu, very nice work!

I studied your researches and as it looks i've exact the same problem on my PW3.
Could you mabye post your patched kernel for 5.8.1? I'm facing some serious troubles with my toolchain-installation so i'm not yet able to compile it myself...
nitRA_M is offline   Reply With Quote
Old 12-15-2017, 01:51 AM   #20
varu
Member
varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'varu knows the difference between 'who' and 'whom'
 
Posts: 12
Karma: 10000
Join Date: Sep 2017
Device: Kindle PW2
My apologies, it's been on my mind every now and then but I haven't gotten a chance to do a proper writeup. If you still need it, let me know and I'll write something up quick, else I'll do something a bit more thorough by the end of the year (I had this on weekly notification and the behaviour indicates a polling script that unfortunately ran the day before you posted).

I'm not sure of the differences between the PW2 and PW3, I only compiled mine for the PW2 so I have no idea if it'd work. I'm also not sure if posting a compiled kernel is allowed on the forum, if I remember correctly I had to extract various binaries & modules from the existing kernels & add them to the source for the compile process to work.

FYI, after leaving the thing on a non-smart charger for 4-5 days (the one I was using would cut off supply after the current draw sank below a certain threshold), the ADC stopped misbehaving! No more warnings with the diag or any other stock kernel, as well as successful boots every time (I tested a number of stock firmwares out of sheer disbelief.. worked fine every time) & an excellent battery life. Although I don't quite understand why this is the case, the evidence speaks for itself.. I should've listened to Cinisajoy and just left the thing plugged in

Last edited by varu; 12-15-2017 at 01:57 AM.
varu is offline   Reply With Quote
Old 12-15-2017, 08:45 AM   #21
knc1
99.44/100% On Holiday
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,151
Karma: 18200597
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
The kernel is GPLv2 - post away.
In fact, according to the license, you MUST make your changes available to the public.
(that is what the 'P' stands for in the name).
knc1 is offline   Reply With Quote
Old 01-17-2020, 10:29 AM   #22
eddie.t.h
Member
eddie.t.h can extract oil from cheeseeddie.t.h can extract oil from cheeseeddie.t.h can extract oil from cheeseeddie.t.h can extract oil from cheeseeddie.t.h can extract oil from cheeseeddie.t.h can extract oil from cheeseeddie.t.h can extract oil from cheeseeddie.t.h can extract oil from cheese
 
eddie.t.h's Avatar
 
Posts: 20
Karma: 1000
Join Date: Jan 2018
Device: Many Kindle :-)
I know this is an old thread but maybe someone will be useful to what I discovered.

I had exactly the same problem as @Varu, i.e. battery error 22 after restart, and when the reader was sometimes able to start, the display worked very slowly. In the logs I found exactly the same errors regarding the lack of display temperature reading. In my case, the system set the default reading at -10 ° C (14 ° F), which I guess was the reason for the very slow operation of the display.
I found on the internet that the ED060XD4 display has a built-in 10k thermistor on pins 30-31.
When I looked at my display under the microscope, the cause of the problem appeared immediately - the temperature sensor was torn off. I don't know how it could happen because my reader was never taken apart.
After repairing the connections, everything works as it should, no errors.
Attached Thumbnails
Click image for larger version

Name:	Webp.net-resizeimage.jpg
Views:	30
Size:	290.5 KB
ID:	176483   Click image for larger version

Name:	Webp.net-resizeimage (1).jpg
Views:	37
Size:	310.8 KB
ID:	176484  
eddie.t.h is offline   Reply With Quote
Old 01-17-2020, 02:10 PM   #23
knc1
99.44/100% On Holiday
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,151
Karma: 18200597
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
That is a thermal stress crack created during the board's reflow soldering process.
I.E: Not the proper temperature curve at that point in the board.
Which also makes sense, that is near the edge of the board and your motherboard might well have been on the edge of that group of motherboards.

Translation: Shit Happens
knc1 is offline   Reply With Quote
Reply

Tags
boot, code, loop, repair

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
KPW1 needs repair. Code 2. Serial port fix. amocus Kindle Developer's Corner 8 09-03-2015 03:30 PM
[Need Help] PW2 fault with Repair Code 2 matrix121985 Kindle Developer's Corner 2 11-13-2014 04:37 AM
pw2 Repair Needed help please! pes2014a Kindle Developer's Corner 7 04-21-2014 10:55 AM
Kindle PW2 now £89 for a short time with coupon code BookCat Amazon Kindle 19 02-28-2014 04:30 PM


All times are GMT -4. The time now is 06:16 PM.


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