Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 06-28-2024, 05:11 PM   #1
minosimo
Member
minosimo began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Jun 2024
Device: Kobo Libra H20
How to boot uboot via mfgtools/uuu?

Hello, I attempted to install postmarketos on my Libra 2 H2O, and some mount issues during flashing ended up wiping the emmc, or at any rate corrupting the partition table. As described on the pmos wiki, it now shows up as

Code:
hiddev96,hidraw2: USB HID v1.10 Device [   NXP    SemiConductor Inc  SE Blank 6SLL] on usb-0000:00:14.0-3/input0
I have been trying to learn how to use uuu to get uboot working again, but it is proving difficult. uuu seems to mostly be used to flash pre-built images, which of course wouldn't exist for the kobo.

According to the wiki, it should be possible to get back into uboot from this mode.

Before attempting the pmos install, I mounted the emmc over usb as described in the wiki and did a dd image dump, though I haven't found any way to make use of it yet.

My first instinct was to try to flash the full emmc image using uuu, but that doesn't seem possible. I'm now rather of ideas and any pointers in the right direction would be much appreciated.

Should I be trying to build uboot, package it into a uuu compatible image, and flash that? There's 25MB of free space before the first partition in the dd image, which I'm guessing is where uboot lives, is that correct? Should I be trying to convert that to something usable by uuu? Or something else?

Thanks!
minosimo is offline   Reply With Quote
Old 06-30-2024, 09:24 PM   #2
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,344
Karma: 2200073
Join Date: Apr 2014
Device: BQ Cervantes 4
Hi. Not familiar with uuu but quite familiar with low level things on kobos a few years ago. Hope these things are still relevant.

Based on the pmos wiki you linked it seems that uboot environment is at offset 768, so it is safe to assume that uboot goes first, from 0 up to 768.

I would try to boot that uboot from the backup you already have, just make a copy with the first chunks:

Code:
dd if=backup.img of=uboot.img bs=128k count=6
and try to load that with uuu

Code:
uuu -b spl uboot.img

You don't need to care about u-boot enviroment at this point, it will use the one that's compiled in case it fails to load it from disk.
pazos is offline   Reply With Quote
Old 06-30-2024, 09:52 PM   #3
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,344
Karma: 2200073
Join Date: Apr 2014
Device: BQ Cervantes 4
Or
Code:
dd if=backup.img of=uboot.img bs=128k count=4
in case uuu or the downloader mode refuse to boot from a image with padded space.
pazos is offline   Reply With Quote
Old 07-06-2024, 07:32 AM   #4
minosimo
Member
minosimo began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Jun 2024
Device: Kobo Libra H20
Thanks pazos, nice to know I'm on the right track. I tried booting the first chunks as you suggested. uuu seems to hang with "Success 0 Failure 0".

After replugging the kobo, it appears in dmesg with
Code:
[[129961.122394] usb 1-1: new high-speed USB device number 48 using xhci_hcd
[129966.531420] usb 1-1: device descriptor read/64, error -110
[129982.403312] usb 1-1: device descriptor read/64, error -110
[129982.512361] usb usb1-port1: attempt power cycle
[129982.899300] usb 1-1: new high-speed USB device number 49 using xhci_hcd
[129987.922329] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[129993.552290] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[129993.760309] usb 1-1: device not accepting address 49, error -62
it keeps trying power cycles and eventually gives up with 'unable to enumerate USB device'

To get the kobo back into uuu mode I can just unplug it, hold the power for a few seconds and plug it back in.

Is there more debugging I could try from here, would a uart connection make this easier?
minosimo is offline   Reply With Quote
Old 07-18-2024, 05:58 PM   #5
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,344
Karma: 2200073
Join Date: Apr 2014
Device: BQ Cervantes 4
Hi, sorry about the delay

Yes, uart is mandatory to see if it works, as the uboot binary you're trying to restore outputs to the serial port. Otherwise you'll need to build an uboot that outputs to the usb serial loader.

In any case we're trying to restore the second stage loader here. Once uboot is restored on the emmc it should be possible to restore your full backup using the same steps you did to create it.
pazos is offline   Reply With Quote
Old 07-21-2024, 06:06 PM   #6
minosimo
Member
minosimo began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Jun 2024
Device: Kobo Libra H20
Not at all, I'm very thankful for your help!

The usual way to get into fastboot is to hold pagedown while powering on the device, which I tried to accomplish here with variations of flashing the boot.img, holding pagedown, replugging, holding the power button, but the behavior is the same.

I also tried flashing to the emmc with `uuu -b emmc boot.img` but the result was the same, uuu hangs at 100% with "Sccess 0 Failure 0" and the device goes to xhci_hcd in dmesg. That the result is the same makes me feel like something is going wrong in the transfer? I also noticed that the behavior is inconsistent, sometimes it hangs with the progress bar at 0%, sometimes at 100%. Whether the image is padded or not doesn't seem to make a difference.

The wiki does provide an alternate way to get into fastboot by running `fastboot 0` in the serial console, but if I understand right that also depends on a working fastboot, which I don't seem to have at the moment anyway.
minosimo is offline   Reply With Quote
Old 07-21-2024, 06:35 PM   #7
minosimo
Member
minosimo began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Jun 2024
Device: Kobo Libra H20
I'd delete my above post if mobileread had that option

Forgive me if it's obvious, but what should be by target path to getting the original image back onto the kobo? I thought uuu would be able to flash a full image to the emmc, but from nxp.com forums it seems the process is more like flash uboot, access uboot via serial, and use that to flash the ubootenv and rest of the emmc?
minosimo is offline   Reply With Quote
Old 07-22-2024, 12:16 PM   #8
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,344
Karma: 2200073
Join Date: Apr 2014
Device: BQ Cervantes 4
Quote:
Originally Posted by minosimo View Post
it seems the process is more like flash uboot, access uboot via serial, and use that to flash the ubootenv and rest of the emmc?
Yup, that's mostly it.

Uboot is a second stage loader (like grub on your computer). AFAICT fastboot is implemented on top of uboot.

So the first step is to load u-boot in memory and jump to it (via uuu). Then from a u-boot prompt enable fastboot.

I'm afraid you'll need that UART.
pazos is offline   Reply With Quote
Old 07-25-2024, 11:06 AM   #9
minosimo
Member
minosimo began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Jun 2024
Device: Kobo Libra H20
Thank you very much for your guidance! I was able to restore the kobo, install pmos, then go back to the factory image. I updated the wiki with more information: https://wiki.postmarketos.org/wiki/K...(kobo-librah2o)
minosimo is offline   Reply With Quote
Old 07-25-2024, 11:18 AM   #10
minosimo
Member
minosimo began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Jun 2024
Device: Kobo Libra H20
The correct link is: Kobo Libra H2O (kobo-librah2o)

Last edited by DNSB; 07-25-2024 at 03:50 PM. Reason: Corrected URL
minosimo is offline   Reply With Quote
Old 07-25-2024, 11:37 AM   #11
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,892
Karma: 76440364
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
I think you need to edit your post and correct the url. The forum has added a tag and placed the closing bracket outside the tag

Sent from my Pixel 7a using Tapatalk
PeterT is offline   Reply With Quote
Old 07-25-2024, 01:28 PM   #12
minosimo
Member
minosimo began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Jun 2024
Device: Kobo Libra H20
I am unable to edit my posts as I have only 7 posts.
minosimo is offline   Reply With Quote
Old 07-25-2024, 03:51 PM   #13
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 41,263
Karma: 158182188
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I've corrected the URL and seems to work now.
DNSB is offline   Reply With Quote
Old 07-29-2024, 06:42 PM   #14
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,344
Karma: 2200073
Join Date: Apr 2014
Device: BQ Cervantes 4
Quote:
Originally Posted by minosimo View Post
Thank you very much for your guidance! I was able to restore the kobo, install pmos, then go back to the factory image. I updated the wiki with more information: https://wiki.postmarketos.org/wiki/K...(kobo-librah2o)
That's great! Congrats

Do you plan to keep it stock or go back to pmos? is pmos any good on a kobo?
pazos is offline   Reply With Quote
Old 07-30-2024, 12:14 PM   #15
minosimo
Member
minosimo began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Jun 2024
Device: Kobo Libra H20
pmos works brilliantly, you can ssh in, run commands, explore to your heart's content, but the display is unsupported at the moment

For now I went back to stock. Next I will try building Quil/inkbox: https://github.com/Quill-OS/quill
minosimo is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
KT3 wiped mmc, only uboot csakakirc Kindle Developer's Corner 15 08-21-2023 03:06 PM
uboot ignores input cwalls Kindle Developer's Corner 5 01-16-2022 12:36 AM
PW Source for PaperWhite uboot? hjalfi Kindle Developer's Corner 11 03-17-2021 08:36 PM
Uboot needed for pw2 Merlin09 Kindle Developer's Corner 67 03-13-2020 09:31 PM


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


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