FIX: Was Bricked! changed supercap, u-boot, OS & fit serial

Post Reply
micromend
Posts: 70
Joined: Thu Jan 15, 2015 9:49 pm

Re: FIX: Was Bricked! changed supercap, u-boot, OS & fit se

Post by micromend » Fri Feb 13, 2015 10:45 pm

I have just compiled kwboot for MacOS :-)

i downloaded the source files from here:-

http://git.denx.de/?p=u-boot.git;a=tree;f=tools;hb=HEAD

you will need only the files.:-
kwbimage.h
kwboot.c
then I compiled with....

Code: Select all

gcc -o kwboot kwboot.c
$ ./kwboot
Usage: kwboot [-d | -a | -b <image> | -D <image> ] [ -t ] [-B <baud> ] <TTY>

-b <image>: boot <image> with preamble (Kirkwood, Armada 370/XP)
-p: patch <image> to type 0x69 (uart boot)
-D <image>: boot <image> without preamble (Dove)
-d: enter debug mode
-a: use timings for Armada XP

-t: mini terminal

-B <baud>: set baud rate

$
my serial adapters have arrived.....
will try to do some testing tomorrow.....
see if i can load an older version of mainline from UART
unless someone can provide me with the stock lace u-boot..... I can use for testing :roll:
maybe I will have a go at compiling the stock from the lace GPL source.... for testing.....

EDIT: I think i would need compile target PRO_KW_BOARD..... for stock lacie u-boot.......

Code: Select all

make clean
make pro_6281_config
then
make DO_IMAGE_FLASH
or 
make DO_IMAGE_UART
or
make ALL
the great thing about testing from UART
if the test u-boot == fail, the device is not bricked :D

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: FIX: Was Bricked! changed supercap, u-boot, OS & fit se

Post by fvdw » Sat Feb 14, 2015 8:50 am

he great thing about testing from UART
if the test u-boot == fail, the device is not bricked
correct, even if the one that is in flash is corrupt you can still load the one via uart. There is small bootstrap loader that loads u-boot from flash unless it is interrupted to load one in uart.

I don't know the config to use for a 2big2 but for the nwsp2 to this is the configuration command

Code: Select all

make aston_256_6281_config SPIBOOT=1 LE=1
The LE switch is for little Endian, the SPIBOOT is I guess to generate an image that can be boot from spi
If you use lacie source code there is no need for the do_image command, the make file contains the command and will generate the binary for flash and uart.

ps you need to find the right gpl code if you want to have support for GPT formatted disk, or modify the source o incorporate gpt support.
GPT is needed if you want that u-boot is able to load files from disk with GPT partition table which each disk bigger dan 2 TB needs to be able to use the total capacity)
Last edited by fvdw on Sat Feb 14, 2015 9:15 am, edited 1 time in total.

micromend
Posts: 70
Joined: Thu Jan 15, 2015 9:49 pm

Re: FIX: Was Bricked! changed supercap, u-boot, OS & fit se

Post by micromend » Sat Feb 14, 2015 9:10 am

Thank you,

i was up late last night reading the source code, making notes here by editing my post, for things i wanted to test....

your tips are greatly appreciated.

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: FIX: Was Bricked! changed supercap, u-boot, OS & fit se

Post by fvdw » Sat Feb 14, 2015 9:34 am

I think pro_6281_config could be the right one for the 2big2.

ps the shell command script create_all_imagesKW.sh found in the the lacie source code is not the script to generate the u-boots for the lacie's. It seems to be for other kirkwood based boards.

It seem "u-boot 2big NAS- 3.5.9-2.0.6" GPL from lacie has support for GPT, at least the c programs for efi support are included

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: FIX: Was Bricked! changed supercap, u-boot, OS & fit se

Post by fvdw » Sat Feb 14, 2015 9:43 am

ps I cannot guarantee that my tips to compile a u-boot image for 2big2 are correct, I do not have a 2big2 so never tried it.
But I did it succesfully for a nwsp2. So don't blame me if you brick your 2big2

Playing with u-boot always has a risk, but as long as the uart trick works it is not big risk, however the tiny bootloader that loads u-boot from flash or load via uart is alos somewhere in flash. If you corrupt that one the party is over.

Besides the uart trick it is also possible to make an "uImage" of u-boot and load it just as kernel to test before writing it to flash
That will enable you to test the image. But to load u-boot via the small bootloader a header is added to it when compiling u-boot. This header contains dram registrations. if those are wrong then the image won't run. Each board seem to have different dram regs. By picking the right config command for the specific board the correct dram regs should be used automatically to generate the u-boot image for flash and uart. (Both have a different header)

micromend
Posts: 70
Joined: Thu Jan 15, 2015 9:49 pm

Re: FIX: Was Bricked! changed supercap, u-boot, OS & fit se

Post by micromend » Sat Feb 14, 2015 10:38 am

I can always replace the SPI again if i need to, but I would prefer not to keep unsoldering the chip.....

i was looking on the FTP, seems there may be an updated version
it also has pro_6281_config defined :)

Code: Select all

ftp://update.lacie.com
Username: gpl_source
Password: gpl_source
in the uboot folder :-
UBoot Network 2 Family - 3.4.16-1.5.24.bz2

i was looking at the old version last night.....
lacie_U-BOOT_1.3.9_kw.tar

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: FIX: Was Bricked! changed supercap, u-boot, OS & fit se

Post by fvdw » Sat Feb 14, 2015 1:18 pm

yes, there is also a version
UBoot 2big NAS - 3.5.9-2.0.6.bz2, seems to be from 2011 while the 3.4.16 is from 2009

if you wish I can try to compile them

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: FIX: Was Bricked! changed supercap, u-boot, OS & fit se

Post by fvdw » Sat Feb 14, 2015 4:02 pm

ps there are 2 versions of the 2big2, one with nand flash and one with spi flash. if you bought a "disk less' version (without disks) it will the nand version, otherwise the spi version. probably the u-boot command flinfo can reveal which one you have
If it is the nand version you need a different u-boot config file then spi version

micromend
Posts: 70
Joined: Thu Jan 15, 2015 9:49 pm

Re: FIX: Was Bricked! changed supercap, u-boot, OS & fit se

Post by micromend » Sat Feb 14, 2015 5:28 pm

I have the SPI version

I do not have the NAND with the full firmware :(

I am also having a terrible time with the toolchains, trying to compile this natively on the nas.....

the new mainline u-boot will compile no problem *if* i add the toolchain

Code: Select all

CROSS_COMPILE=arm-linux-gnueabi- make u-boot.kwb
strange i need to add the toolchain, the last install i did did not need it....

but the old code is looking for:-

Code: Select all

make: arm-none-linux-gnueabi-gnueabi-gnueabi-gnueabi-gnueabi-gnueabi-gcc: Command not found
something in this old code is very unhappy with the new gcc and toolchains

i am sure it is the *none* that is causing the problems......

if you could compile a version for me that would be awesome.

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: FIX: Was Bricked! changed supercap, u-boot, OS & fit se

Post by fvdw » Sat Feb 14, 2015 6:59 pm

its done, I compiled the 3.4.16-1.5.24 version

It produces a binary for flash and one for to be loaded via uart.
if you sent me your e-mail address by pm I can mail them to you. This nas-central board doesn't allow attachments

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: FIX: Was Bricked! changed supercap, u-boot, OS & fit se

Post by fvdw » Sat Feb 14, 2015 7:12 pm

I already sent you the files by e-mail. I found your e-mail in the user data base of plugout.net

micromend
Posts: 70
Joined: Thu Jan 15, 2015 9:49 pm

Re: FIX: Was Bricked! changed supercap, u-boot, OS & fit se

Post by micromend » Sat Feb 14, 2015 7:23 pm

amazing, thank you

I will give them a try now !

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: FIX: Was Bricked! changed supercap, u-boot, OS & fit se

Post by fvdw » Sat Feb 14, 2015 9:26 pm

ok, be aware that you need to use the clunc program to interupt u-boot and enable net-console mode on the lacie u-boot. So if you don't have the serial port connected you won't be able to connect via ethernet if you don't use clunc. You could use the fvdw-sl console this has an u-boot console that uses clunc to interrupt u-boot on the lacie devices

micromend
Posts: 70
Joined: Thu Jan 15, 2015 9:49 pm

Re: FIX: Was Bricked! changed supercap, u-boot, OS & fit se

Post by micromend » Sat Feb 14, 2015 11:05 pm

i found this, it says kwboot works on lacie kirkwood devices
https://www.mail-archive.com/search?l=u ... &q=subject:

but i am having problems, if i have netconsole open or clunc i can see the serial is sending data

not quite sure exactly what you say with interupt u-boot...
is it to stop u-boot from starting ? or to stop u-boot from loading the OS ?

anyway something is not quite right...

going to reboot into linux this time and try again.......

EDIT:
same error in linux :(

Code: Select all

ubuntu:~$ sudo ./kwboot -b u-boot.bin -B 115200 /dev/ttyUSB0
Sending boot message. Please reboot the target...-
Sending boot image...
  0 % [+xmodem: Protocol error
I think I will try tomorrow with the prolific adapter, I was using the FTDI today........

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: FIX: Was Bricked! changed supercap, u-boot, OS & fit se

Post by fvdw » Sun Feb 15, 2015 10:43 am

When loaded and start running the lacie u-boot checks the ethernet interface for a specific magic packet, if it detects one it interrupts it program and switches to net console mode and wait for you with the u-boot prompt. In that mode you can connect to u-boot via the network interface.
If it doesn't detect the magic packet it continues and stays in serial port mode and it will display a prompt on the serial port to interrupt boot before trying to load linux from a HDD. This sequence you will see when hooking up to the serial port.
Now clunc is a program that broadcast the magic packet and let u-boot set up the right ip information for the nas from which pc the packet was send and switch to net console mode.
Then you can connect with a program like netcat. The fvdw-sl console is doing that for you, starting clunc, waiting until u-boot responds and then opening a command window to let you talk to u-boot (it runs under windows).
So if you do not have the serial port hooked up you will need to use clunc and netcat to talk to u-boot via the network interface. But if you have a serial port connected there is no need to use clunc or nc as you don't need netconsole mode to talk to u-boot you can use the serial port.

I don't know what kwboot is exactly doing but from the output you posted it seems to fail to upload the uart image due to a protocol error.

I used in the past the method described here with success to upload an uart image. http://forum.doozan.com/read.php?3,4640,4640#msg-4640
This afternoon I will make an uImage from the u-boot image you should be able to load that via tftpboot using the mainline u-boot.

Post Reply