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

Update UBOOT from OS

Post by past_51 » 27 Aug 2014, 07:54

Hi All,

I'm very interested by updating uboot, in order to run another distrib on the B3 (Archlinux for example).
The problem is that I don't have the specific cable, and I'm asking if it is possible to update it by some OS commands ? (I know that if something goes wrong, the cable would be required)

Looking for that on Internet, I found some information for:
- uclinux
- utilite
- solid-run

(as a new user, I cannot post the URLs)

I checked, and all required things are included in this package : mtd-utils

So, what do you think about that ? Would it be possible ?
Someone already tried it ?

Any feedback or comments are welcome :)

ahoff
Posts: 84
Joined: 01 Apr 2008, 20:50
Location: Swe

Re: Update UBOOT from OS

Post by ahoff » 28 Aug 2014, 15:09

1: Download MouettE:s u-boot file.
2: Folow this guide, but repalce the existing u-boot.kwb with MouettE:s
3 Done
Åke Hoff
Örskogen
Sweden

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

Re: Update UBOOT from OS

Post by MouettE » 28 Aug 2014, 18:02

Solution from ahoff will work fine (it's the excito official way) ; you can also install directly from the OS with the following commands :

Code: Select all

wget http://files.la-mouette.net/bubba/u-boot.kwb
apt-get -y install mtd-utils
flash_eraseall /dev/mtd0
nandwrite /dev/mtd0 u-boot.kwb

Damarus
Posts: 4
Joined: 02 Jun 2014, 07:38

Re: Update UBOOT from OS

Post by Damarus » 28 Aug 2014, 18:18

MouettE wrote:Solution from ahoff will work fine (it's the excito official way) ; you can also install directly from the OS with the following commands :

Code: Select all

wget [...]
apt-get -y install mtd-utils
flash_eraseall /dev/mtd0
nandwrite /dev/mtd0 u-boot.kwb
That does not work! I might have just bricked my B3 doing those steps. It all went on fine until the last step. It just tells me "Unknown flash (not normal NAND)". What can I do?

Damarus
Posts: 4
Joined: 02 Jun 2014, 07:38

Re: Update UBOOT from OS

Post by Damarus » 28 Aug 2014, 18:52

A working command to flash U-Boot is:

Code: Select all

mtd_debug write /dev/mtd0 0 $(stat --printf '%s' "u-boot.kwb") "u-boot.kwb"

past_51
Posts: 22
Joined: 25 Aug 2014, 06:27

Re: Update UBOOT from OS

Post by past_51 » 29 Aug 2014, 06:16

Hi All,

May thanks for your answers.
I will try that this weekend.

To which Linux distribution are you going?

sortsnak
Posts: 14
Joined: 23 Jun 2011, 10:08
Location: Denmark

Re: Update UBOOT from OS

Post by sortsnak » 03 Sep 2014, 04:02

Damarus wrote:A working command to flash U-Boot is:

Code: Select all

mtd_debug write /dev/mtd0 0 $(stat --printf '%s' "u-boot.kwb") "u-boot.kwb"
The official

Code: Select all

nandwrite /dev/mtd0 u-boot.kwb
does not work. nandwrite does not recognize the .kwb file as a valid image. The flasherase command works flawless.

Damarus' method works. I did write a new uboot to my B3. But make sure if you don't have serial access on your B3 - then get it right the 1st time, if you don't use the correct image you may end up bricked. (or forcing yourself to get serial to fix it).

Oh, I'm planning running arch linux, infact, that's what I'm doing now. There is a newly created wiki page howto.

past_51
Posts: 22
Joined: 25 Aug 2014, 06:27

Re: Update UBOOT from OS

Post by past_51 » 04 Sep 2014, 02:45

Hi sortsnak,

Thanks for your reply and comment.
I didn't had time to test it the last weekend. I will try with the method Damarus mentionned.

I think I will go to Archlinux too.

Cilyan
Posts: 7
Joined: 10 Oct 2014, 10:55

Re: Update UBOOT from OS

Post by Cilyan » 10 Oct 2014, 11:05

Hi there !
Thanks for the details, the method works very well.
Do you think it deserves a page on the wiki, or would it be too risky to but such sensitive information there?
Glad to see how easy it is to run Arch on the Bubba now.

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

Re: Update UBOOT from OS

Post by Stryker » 12 Oct 2014, 16:19

ahoff wrote:1: Download MouettE:s u-boot file.
2: Folow this guide, but repalce the existing u-boot.kwb with MouettE:s
3 Done
Do you guys have any ideas as to why this method does not work on my B3?
I have followed the instructions from the How-to-Wiki:
- Empty USB-Stick, FAT32 formatted with Gparted. File is at install/u-boot.kwb
- Plug in the USB-device beforehand, then connect power while holding the power-button.
- Green LED flashes and Status-LED of the USB-Stick light up, signalling mount.

But then the LED stays green forever and there are no indicators the flash-drive is accessed and read from.
A successful flash of the U-Boot should be followed by booting the OS from disk, but nothing happens.
'strings /dev/mtd0/ ...' still shows "U-Boot 2013.01.01-00006-ge588a77-dirty"

I also tried using different USB-Sticks (USB3.0 and 2.0) and reformatting them directly before use.
I have successfully used the USB-UBOOT-Flash-Method before to enable 3TB support.
The only thing different might be the OS running on the drive.
It's the mouette-minimal-wheezy-image and not the Excito-image.

Gordon
Posts: 1322
Joined: 10 Aug 2011, 03:18

Re: Update UBOOT from OS

Post by Gordon » 13 Oct 2014, 02:58

Both the rescue system and u-boot update routine run from flash. You could run Windows on the box and it still wouldn't matter.

I'm pretty sure it's your USB thumb drives. There have been a lot of posts from people not being able to boot the rescue system, specially since Excito started shipping diskless units. I've never had such issues, but I've always used cheap (i.e. free) ones with a maximum size of 1Gb. I suggest you try get hold of one of those yourself, because although it's been a long time since I've occupied myself with this type of electronics, I'm pretty sure that the newer high capacity devices use completely different internals and are most probably not supported by the system that is stored in flash.

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

Re: Update UBOOT from OS

Post by Stryker » 13 Oct 2014, 12:53

I tried several more USB-drives now, neither of them worked.
USB2.0 8GB and 16GB
USB3.0 8GB and 16GB

I do not own any other flashdrives and I am all out of ideas now...
In the past, I have successfully used my USB-drives to update the U-Boot for 3TB-Support, reinstall the excito-image and also boot a rescue-system.
I fear I might have to solder a UART-cable to the motherboard and patch via serial console.

e: I just booted the rescue-system from my 8GB USB3.0-drive. It seems like this stick is recognized by the uboot.
But it won't install the L2Cache-Fix...

Cilyan
Posts: 7
Joined: 10 Oct 2014, 10:55

Re: Update UBOOT from OS

Post by Cilyan » 13 Oct 2014, 13:08

If you can start the rescue system, why don't you use it to flash the uboot? Yes, it may brick your device, but not more or less than using an USB to let uboot flash itself... Just don't forget to erase the partition first, or the write will fail.

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

Re: Update UBOOT from OS

Post by Stryker » 14 Oct 2014, 10:34

With "erasing the partition" you mean the flash_eraseall-command, right?

And just to make sure: These are the correct commands, with mtd_debug instead of nandwrite:

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>

Cilyan
Posts: 7
Joined: 10 Oct 2014, 10:55

Re: Update UBOOT from OS

Post by Cilyan » 16 Oct 2014, 08:43

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 :)

Post Reply