Page 2 of 3

Re: Update UBOOT from OS

Posted: 28 Oct 2014, 03:49
by past_51
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>

Re: Update UBOOT from OS

Posted: 16 Nov 2014, 12:26
by Stryker
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..

Re: Update UBOOT from OS

Posted: 20 Nov 2014, 03:06
by ryz
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

Re: Update UBOOT from OS

Posted: 20 Nov 2014, 04:11
by johannes
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. :)

Re: Update UBOOT from OS

Posted: 27 Nov 2014, 21:24
by ryz
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.

Re: Update UBOOT from OS

Posted: 05 Jan 2015, 10:28
by cinko
I think I bricked my B3.

How can I save it guys????

Re: Update UBOOT from OS

Posted: 06 Jan 2015, 03:46
by Binkem
@cinko: please be more specific. What did you do/try to do, how did you try to fix the problem etc...

Re: Update UBOOT from OS

Posted: 06 Jan 2015, 17:02
by cinko
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.

Re: Update UBOOT from OS

Posted: 07 Jan 2015, 12:35
by cinko
Solved :)

Re: Update UBOOT from OS

Posted: 24 Jan 2015, 12:45
by ReedWood
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

Re: Update UBOOT from OS

Posted: 25 Jan 2015, 03:04
by ReedWood
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.

Re: Update UBOOT from OS

Posted: 25 Jan 2015, 13:55
by MouettE
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.

Re: Update UBOOT from OS

Posted: 26 Jan 2015, 15:07
by ReedWood
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

Re: Update UBOOT from OS

Posted: 26 Jan 2015, 15:54
by johannes
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...

Re: Update UBOOT from OS

Posted: 27 Jan 2015, 03:09
by ReedWood
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.