[BOOT] FIREFIREFIRE 1.2 - bootloader with recovery selection

Search This thread

nind

Senior Member
Mar 27, 2011
79
134
/home/nind/
If the bootloader is borked how are you going to run fastboot commands?

firefirefire/u-boot is only the 2nd stage bootloader, there is a 1st stage bootloader which checks if there is something special on USB (factory cable, i think UART3 should work too btw.) does some small stuff and then go into fasboot mode (if special usb cable) or load the 2nd stage bootloader (u-boot) into RAM and jump into it. So if you have the factory cable plugged in the first stage bootloader should (?!?) handle it. Ah not sure now when i write these line, thought i thought it was this way.
Note: From my understanding it should work like this, but i've not tried it so better ask someone with more knowledge.


Btw: fattire has coded a (2nd stage) bootloader CyanoBoot based on u-boot. It does the multiboot (boot from internal memory/SDCard) right (they had part of it working before). There are differences between the B&N and Amazon u-boot (the nook has also more hardware keys) but it should not be too hard to port, is interested in porting have a closer look (source is here: http://goo-inside.me/devs/fattire/cyanoboot/acclaim/ )
 
Last edited:

kinfauns

Retired Senior Moderator and Retired DC Lead
Jan 5, 2012
1,864
3,543
ahh. my apologies. for what its worth, it seems you still need fastboot to get out of the usbboot? like it relys on firefirefire to get out.

Sent from my HTC Glacier using xda premium

Yes. Based on what pokey9000 said about setting the nvram value back, it looks like you'd need fastboot to do just that. It doesn't necessarily have to be FFF... even the stock bootloader will allow fastboot. The point of the usbboot is that you can keep your original bootloader in place and test the new bootloader without flashing it to the device. As long as you can reset the bootmode back, nothing else is changed on the device.

---------- Post added at 01:39 PM ---------- Previous post was at 01:16 PM ----------

firefirefire/u-boot is only the 2nd stage bootloader, there is a 1st stage bootloader which checks if there is something special on USB (factory cable, i think UART3 should work too btw.) does some small stuff and then go into fasboot mode (if special usb cable) or load the 2nd stage bootloader (u-boot) into RAM and jump into it. So if you have the factory cable plugged in the first stage bootloader should (?!?) handle it. Ah note sure now when i write these line, thought it was this way.
Note: From my understanding it should work like this, but i've not tried it so better ask someone with more knowledge.


Btw: fattire has coded a (2nd stage) bootloader CyanoBoot based on u-boot. It does the multiboot (boot from internal memory/SDCard) right (they had part of it working before). There are differences between the B&N and Amazon u-boot (the nook has also more hardware keys) but it should not be too hard to port, is interested in porting have a closer look (source is here: http://goo-inside.me/devs/fattire/cyanoboot/acclaim/ )

Yeah, I haven't got a clue which stage bootloader would handle fastboot. However, pokey9000 says in this post...

http://xdaforums.com/showthread.php?t=1405052

that...

As useful as they are now, fastboot cables may not work in the future. They rely on the bootloader to work, and it's possible that a future OTA could disable fastboot.

While he doesn't specify which stage, it seems to imply that it would be u-boot.bin since that's what gets updated by Amazon in the update zip files.

Something like fattire's bootloader would be great for this device, but I don't have close to the expertise required to attempt a port. Maybe pokey9000 will be enticed by their developments to jump back into it?
 

jmcoffey

Senior Member
Dec 6, 2011
338
71
Peachtree City
'fastboot boot u-boot.bin' does not work because the boot command for fastboot expects to see a bootable filesystem as its next argument. FWIW, I've tried this and fastboot reports that it is creating, downloading, and booting the boot image, but does nothing after that.

I know how to flash a bootloader onto my device. However, as my post indicated, I'm not confident that my build of u-boot.bin will work properly and I'm not so inclined to permanently brick my Kindle Fire trying to do this. I'm trying to find a way to test it without flashing it.

Do you have a factory cable? I would try flashing your bootloader if I was assured that the factory cable would work to fix it.

Sent from my Kindle Fire using XDA
 

smirkis

Senior Member
Oct 8, 2010
1,820
611
San Diego, CA
Do you have a factory cable? I would try flashing your bootloader if I was assured that the factory cable would work to fix it.

Sent from my Kindle Fire using XDA

nothings for sure. and noone could guarantee you anything unfortunately.

I like where this is going, I was looking at cyanoboot when they released it and thought it could be useful to us.

but just for the record. when fff bootloader is flashed, it even changes the requirement of fastboot -I command via the cable which further leads me to believe the cable really does rely heavily on the u-boot.bin which is the secondary bootloader.

Sent from my HTC Glacier using xda premium
 
Last edited:

kinfauns

Retired Senior Moderator and Retired DC Lead
Jan 5, 2012
1,864
3,543
Do you have a factory cable? I would try flashing your bootloader if I was assured that the factory cable would work to fix it.

Sent from my Kindle Fire using XDA

Yes, I have a factory cable and I would have flashed it already if I could assure myself of that! That wasn't meant to sound rude, but sometimes these forum discussions fail to convey the *nudge nudge* facetious quality of some responses. I know you are trying to be helpful.

OK... for a progress update. It took me a while to find a box to reappropriate, back it up, install linux, etc. etc.... but...

Code:
# ./usbboot aboot.bin ../bootloaders/myfff/u-boot.bin 
?
sending 2ndstage to target...
waiting for 2ndstage response...
sending image to target...

I have it booting through usbboot and my "custom logo" appears on screen. I originally expected it to complete booting, but it goes black after several seconds. This had me worried. After reading through a bunch more of pokey9000's posts in a few of the development threads, I now believe it's just supposed to stay in fastboot for a short time, blackout, then wait for another usbboot command... which makes sense since it's still in the 4003 bootmode.

At that point, I can give it another usbboot command and it will go through another cycle of what I pasted above. If I give it a few fastboot commands while it's in fastboot mode during the first several seconds after booting, it will stay in fastboot mode indefinitely, it seems. I've tried this with both my rebaked FFF as well as pokey9000's FFF 1.2 and the behavior is identical, with the exception of the boot logo, of course. I think it's working, but that's not to say I'm 100% confident either.

I'd love to have some kind of method to recover if it goes bad, but that doesn't seem likely...
 

kinfauns

Retired Senior Moderator and Retired DC Lead
Jan 5, 2012
1,864
3,543
Since the usbboot test appeared to go OK, I decided to take a deep breath and flash. Fastboot, recovery, and normal booting all work just fine.

Thanks to pokey9000 for the source code, the directions to build and the usbboot tool to test. Also a thumbs up to the members here who offered support and allowed me to bounce some thoughts/ideas around. I've included a shot of my Kindle Fire dogfooding.
 

Attachments

  • P1000281.JPG
    P1000281.JPG
    108.2 KB · Views: 315

dieandromeda

Senior Member
Apr 15, 2011
249
52
Since the usbboot test appeared to go OK, I decided to take a deep breath and flash. Fastboot, recovery, and normal booting all work just fine.

Thanks to pokey9000 for the source code, the directions to build and the usbboot tool to test. Also a thumbs up to the members here who offered support and allowed me to bounce some thoughts/ideas around. I've included a shot of my Kindle Fire dogfooding.

nice. i hope u can make a tutorial...
 

kinfauns

Retired Senior Moderator and Retired DC Lead
Jan 5, 2012
1,864
3,543
nice. i hope u can make a tutorial...

I'm not sure there's much more for me to add beyond what pokey9000 has posted already.

make/convert your image
http://xdaforums.com/showpost.php?p=21262416&postcount=126

get source code and build it
http://xdaforums.com/showpost.php?p=21775177&postcount=151

test u-boot.bin with usbboot
http://xdaforums.com/show...0&postcount=74

flash by hand directions in OP
http://xdaforums.com/showpost.php?p=19837228&postcount=1

Post here if you get stuck and I'll try to help. Good luck!
 
  • Like
Reactions: nind and foxdog66

_ante_

Member
Feb 19, 2012
34
8
I'm not sure there's much more for me to add beyond what pokey9000 has posted already.

make/convert your image
http://xdaforums.com/showpost.php?p=21262416&postcount=126

get source code and build it
http://xdaforums.com/showpost.php?p=21775177&postcount=151

test u-boot.bin with usbboot
http://xdaforums.com/show...0&postcount=74

flash by hand directions in OP
http://xdaforums.com/showpost.php?p=19837228&postcount=1

Post here if you get stuck and I'll try to help. Good luck!

Nice job :thumbup:

Sent from my Kindle Fire (CM7) using xda premium
 

Top Liked Posts

  • There are no posts matching your filters.
  • 24

    This is a replacement bootloader so you can get into recovery with just the one power button. It's very simple to use, just turn on the Fire, and when the logo pops up press the power button.

    FIREFIREFIRE also makes fastboot easy. For a few seconds on every boot, fastboot is enabled; no idme bootmode or special cable needed. The USB ID is changed to one that's supported by even the oldest fastboots. Unlike the stock, you do not need to use the "-i 0x1949" on every run of fastboot.

    Now FIREFIREFIRE can fix your partition tables. "fastboot oem format" will overwrite the partition table with the stock table. You can use this to revert to factory partitioning if you have been messing with parted or the like, or can be used with the USB boot kit (Rekindle) to manually rebuild a totally bricked Fire. Running this command on 1.0 or earlier will fail.

    Release notes:
    1.2 - MD5: a8c8d702606de8ab7e73b898de50b4b6 u-boot.bin
    • Merge in 6.2->6.2.1 changes: low battery charge safety shutdown, official offsets for NVRAM params
    • The power LED now tells you more stuff: dim slightly while in fastboot / ready to detect recovery button press, bright green again when the boot of standard OS starts, more orangey orange when recovery starts
    • Fix Amazon's broken LED code

    1.1 - MD5: 7a4f1a2ff60b13a3534df318f99d813c u-boot.bin
    • Fixed the built-in partitioning to match the partition map on a stock KF
    • Removed USB PID version. Realized this would screw up Windows. VID:pID will always be 18d1:0100 from now on

    1.0
    • Fastboot USB VID switched to Google's VID. Once this is installed you don't need to use "-i 0x1949" on every fastboot command
    • USB PID reflects the version. 0x0100 is version 1.0, 0x0402 is 4.2, etc
    0.9
    • New logo with "press power button for recovery" message at the bottom
    • Delays ~10 seconds if no button pressed, but pushing the button immediately goes into recovery
    • During the delay, you can connect with fastboot. Works under Linux, but the delay may be too short for Windows

    Howto flash
    The TWRP installer flashes FFF 1.0 when it's run. For most purposes this is ok, but because TWRP has been orphaned, I can't recommend it as a way to get the latest. By the time you read this, KFU should support flashing FFF, and for Windows users is by far the easiest way.

    Howto flash by hand
    • Get into fastboot mode somehow. Having and older FFF from the TWRP installer is a good start. Currently KFU or fbmode is the easiest
    • flash with "fastboot -i 0x1949 flash bootloader u-boot.bin" (take out "-i 0x1949" if FFF is already installed)
    • disable fastboot: "fastboot -i 0x1949 oem idme bootmode 4000"
    • reboot: "fastboot -i 0x1949 reboot"

    Howto backup EVERYTHING (on Linux):
    (not relevant in this post anymore, but good reference)
    • This will back up all partitions and the hidden NVRAM data. If you ever have to restore from scratch, you can get fastboot to write a new partition table and then fastboot in these backups
    • Need >8GB local free, and adb installed and able to get a shell.
    • Make a new directory to store the dump files and cd into it.
    • Make sure that your KF is running adb as root. As of 6.2.1 this requires running BurritoRoot, then "adb root" on your PC after it completes.
    • Then run in a terminal:
    Code:
    for F in `seq 1 12`; do adb pull /dev/block/mmcblk0p$F; done
    adb shell idme ? > nvram.txt

    On a brand new KF, this backup will bzip2 down to ~300MB. Once you start writing to the flash, this will go up even if you delete files due to nonempty free blocks.

    github is now up at https://github.com/pokey9000/kf_u-boot
    3
    Yeah, a boring video of the "factory cable" method since the nvram boot mode is broke would be useful :p But awesome that it works.


    There you go.
    2
    Hey pokey9000,
    Is there a way to flash a new splash image to your bootloader with fastboot like we do with some other devices?
    Code:
    fastboot flash splash1 splash1.img
    Id like to have a new image on boot if thats ok. :D
    11i08ip.png

    You need to make a 600x1024 graphic in png, rotate it counterclockwise 90 degrees, then follow this guide to generate an Android compatible RLE. Then put the RLE into the source tree at board/omap4kc1/initlogo.rle and rebuild.

    You have to leave a lot of flat color as gradients, photos, etc make the RLE too big to fit into u-boot.

    Then you'll want to use the usb boot method to test u-boot without flashing, or risk bricking your Fire if you screw up.


    FWIW, that looks almost like my original logo. The whole reason I called it FIREFIREFIRE is that the source doesn't ship with a logo (Amazon copyright or something) and when I made the dummy image to fill the void I just opened up GIMP and made a textbox with the first thing that popped in my head. Then it kind of stuck.
    2
    *bump*

    New FFF that can restore your partition table. See the OP
    2
    nice. i hope u can make a tutorial...

    I'm not sure there's much more for me to add beyond what pokey9000 has posted already.

    make/convert your image
    http://xdaforums.com/showpost.php?p=21262416&postcount=126

    get source code and build it
    http://xdaforums.com/showpost.php?p=21775177&postcount=151

    test u-boot.bin with usbboot
    http://xdaforums.com/show...0&postcount=74

    flash by hand directions in OP
    http://xdaforums.com/showpost.php?p=19837228&postcount=1

    Post here if you get stuck and I'll try to help. Good luck!