Update UBOOT from OS

Got problems with your B2 or B3? Share and get helped!
past_51
Posts: 22
Joined: 25 Aug 2014, 06:27

Re: Update UBOOT from OS

Post by past_51 » 28 Oct 2014, 03:49

Hi,

I finally did it... a bit late as I thought to do it before... but it worked fine with these commands:

Code: Select all

apt-get -y install mtd-utils
flash_eraseall /dev/mtd0
mtd_debug write /dev/mtd0 0 $(stat --printf '%s' "u-boot.kwb") <path to u-boot-kwb>

Stryker
Posts: 56
Joined: 17 Oct 2013, 11:03

Re: Update UBOOT from OS

Post by Stryker » 16 Nov 2014, 12:26

Cilyan wrote:Yes. Just to be extremely precise (and for later reference):

Code: Select all

apt-get -y install mtd-utils
flash_erase /dev/mtd0 0 0
mtd_debug write /dev/mtd0 0 $(stat --printf '%s' "<path to u-boot-kwb>") "<path to u-boot-kwb>"
- flash_eraseall is deprecated in favor to flash_erase <mtddev> 0 0
- The stat command must get the same file as what you are flashing, to output the correct file size.
But I think you got it :)
I just realized, that these commands are meant to be used while running the OS from disk.
I thought you were supposed to execute them while running the USB-Resuce system (which itself resides in the very flash we are going to overwrite...)

e: Several hours have passed until I finally built up the courage to actually flash the u-boot.
well... IT WORKED, yay me...

It is always the same when you have to do risky stuff with your critical infrastructure.. When you know you will have to spend 10x the time already invested if it goes wrong.
Okay, off to brick my phone next..

ryz
Posts: 183
Joined: 12 Feb 2009, 06:03

Re: Update UBOOT from OS

Post by ryz » 20 Nov 2014, 03:06

I did brick my B3 trying to flash a new Uboot and is now waiting for an serial cable :cry:
I did use

Code: Select all

flash_erase /dev/mtd0 0 0
instead of the

Code: Select all

flash_eraseall /dev/mtd0
which might have been a mistake. So others might be better of using the flash_eraseall which others have had success with. It might of course be some thing other then me using flash_erase instead of flash_eraseall that bricked my system. But if you do not have a strong urge to solder an serial cable you might be better of using the flash_eraseall

johannes
Posts: 1470
Joined: 31 Dec 2006, 07:12
Location: Sweden
Contact:

Re: Update UBOOT from OS

Post by johannes » 20 Nov 2014, 04:11

But if you do not have a strong urge to solder an serial cable you might be better of using the flash_eraseall
..who doesn't? I'll try it right away. :)
/Johannes (Excito co-founder a long time ago, but now I'm just Johannes)

ryz
Posts: 183
Joined: 12 Feb 2009, 06:03

Re: Update UBOOT from OS

Post by ryz » 27 Nov 2014, 21:24

I finally get my serial cable and have now sucseffuly loaded an new u-boot.

I did follow the steps in this guid http://forum.doozan.com/read.php?3,7852,7852 with the precompiled binary of kwboot since I already had an Ubuntu computer.

cinko
Posts: 6
Joined: 04 Feb 2012, 13:55

Re: Update UBOOT from OS

Post by cinko » 05 Jan 2015, 10:28

I think I bricked my B3.

How can I save it guys????

Binkem
Posts: 388
Joined: 10 Jul 2008, 02:26

Re: Update UBOOT from OS

Post by Binkem » 06 Jan 2015, 03:46

@cinko: please be more specific. What did you do/try to do, how did you try to fix the problem etc...

cinko
Posts: 6
Joined: 04 Feb 2012, 13:55

Re: Update UBOOT from OS

Post by cinko » 06 Jan 2015, 17:02

Binkem wrote:@cinko: please be more specific. What did you do/try to do, how did you try to fix the problem etc...
I did a reinstall and then I did the MonuEttes Kernel install. But it didn't
boot after that. So when it didn't boot I tried with the U-boot flash.

And now it does not boot. And when I boot up with the button pressed
it only lights the green LED. I have also tried the Gentoo live USB but couldn't boot from that also.

cinko
Posts: 6
Joined: 04 Feb 2012, 13:55

Re: Update UBOOT from OS

Post by cinko » 07 Jan 2015, 12:35

Solved :)

ReedWood
Posts: 17
Joined: 08 Nov 2013, 16:06

Re: Update UBOOT from OS

Post by ReedWood » 24 Jan 2015, 12:45

Hi,

I try to update the u-boot on my b3 from a running arch linux installation. I did the following All commands are executed all real root.

backup old u-boot
> mtd_debug read /dev/mtd0 0 786432 mtd0.backup

-> worked as expected

erase flash
> flash_erase -u /dev/mtd0 0 0
Erasing 64 Kibyte @ b0000 -- 100 % complete

-> seems to have worked, but reading mtd0 again shows, that the erase hat no effect


write the new u-boot
> du -b u-boot.kwb
255984 u-boot.kwb
> mtd_debug write /dev/mtd0 0 255984 u-boot.kwb
Copied 255984 bytes from u-boot.kwb to address 0x00000000 in flash

-> Again, reading mtd0 showed that flashing had no effect. On boot B3 behaves as usual, so realy nothing happend.


Now, I still want to flash the new u-boot. What am I missing. Why can I not effectively write into mtd0. Do I have to mount it?

Thanks,
Wolfgang

ReedWood
Posts: 17
Joined: 08 Nov 2013, 16:06

Re: Update UBOOT from OS

Post by ReedWood » 25 Jan 2015, 03:04

I now also tried nandwrite and flashcp. Both didn't report an write error, but the content of the flash did not change. At least flashcp reported that veryfing the write failed, since source and target differ.

Do I need to unlock the flash before writing? I found an unlock option for flash_erase and applied it with no effect. I am really suprised, that I do not receive a write error with any of the tools tried. Is it possibel that the flash on my B3 is physically corrupted? Reading still works flawless.

Thanks for any hints.

MouettE
Site admin
Posts: 290
Joined: 06 Oct 2011, 19:45

Re: Update UBOOT from OS

Post by MouettE » 25 Jan 2015, 13:55

You should try to flash u-boot from u-boot following this guide Updating_your_B3_to_support_3TB_disks using the u-boot.kwb file you want to flash.

ReedWood
Posts: 17
Joined: 08 Nov 2013, 16:06

Re: Update UBOOT from OS

Post by ReedWood » 26 Jan 2015, 15:07

Thank you MouettE for your advice. I tried it with and without seriel connection, with and without lan cable, using the upper and the lower usb port. The thumb drive I use has a fresh msdos partition table with a single vfat partiton on it. However, the u-boot on the nor flash stays at 2010.06. The series output starts like this.

-----------------------------
U-Boot 2010.06 (Jun 10 2011 - 09:06:51)
BUBBA|3

SoC: Kirkwood 88F6281_A0
DRAM: 512 MiB
In: serial
Out: serial
Err: serial
Net: egiga0, egiga1
88E1116 Initializing on egiga0 @08 done
88E1116 Initializing on egiga1 @18 done
Hit any key to stop autoboot: 0
** Bad partition 1 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
resetting ...
-----------------------------

I also tried to flash u-boot from the u-boot command line using "sf erase" und "sf write" but nothing could change the content of the flash. Might there be a jumper I have to set? In case the nor flash is damaged, is it possible to replace it?

I want to use the community u-boot from github [1] which you might know, since the last commit if from you. :) Btw. what is the difference between this repo and your own [2] despite the fact that [2] look more official.

Thanks!

[1] https://github.com/nielsek/community-b3-uboot
[2] https://github.com/Excito/U-Boot-B3

johannes
Posts: 1470
Joined: 31 Dec 2006, 07:12
Location: Sweden
Contact:

Re: Update UBOOT from OS

Post by johannes » 26 Jan 2015, 15:54

Perhaps a dumb question, but do you press and hold the rear button when appyling power? Does the front LED light up green for a while, before it fails? I might be wrong but the serial low you show doesn't look as it's trying to load from USB...
/Johannes (Excito co-founder a long time ago, but now I'm just Johannes)

ReedWood
Posts: 17
Joined: 08 Nov 2013, 16:06

Re: Update UBOOT from OS

Post by ReedWood » 27 Jan 2015, 03:09

Yes I do press and old the rear button and the LED turns green. I press is for approx 2 seconds after I attached power. The serial output is from a normal start w/o the thumb drive attached. I will post the startup sequence with attached thumb drive tonight.

Post Reply