Welcome! Log In Create A New Profile

Advanced

2017.07-2023.04 U-Boot Kirkwood - GoFlexNet, GoFlexHome, PogoE02, Dockstar, iConnect, NetgearStora, PogoV4/Mobile, Sheevaplug, NSA325, NSA320, NSA310S, NSA320S, NSA310, HP T5325, Dreamplug

Posted by bodhi 
Sounds good! I always have 2 serial console adapters. Got them for 2.5 bucks a piece so you'd never know when it goes bad :)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Hi,

I have a Pogo E02 flashed with old uboot (2011.12) from the Arch install. Now I try to change to new uboot and debian. but it has some bad blocks:
 
[root@pogoe2 ~]# dmesg | grep -i 'bad'
[   14.706954] Scanning device for bad blocks
[   14.712020] Bad eraseblock 67 at 0x000000860000
[   14.716820] Bad eraseblock 132 at 0x000001080000
[   14.728687] Bad eraseblock 292 at 0x000002480000
[   14.744875] Bad eraseblock 510 at 0x000003fc0000
[   14.756000] Bad eraseblock 660 at 0x000005280000
[   14.758126] Bad eraseblock 689 at 0x000005620000
[   14.758173] Bad eraseblock 690 at 0x000005640000
[   14.759630] Bad eraseblock 710 at 0x0000058c0000

are these bad blocks in the first 1M? Can I flash the new uboot?



Edited 1 time(s). Last edit at 08/30/2014 02:24PM by zzbao.
NSA325 users,

Here is the latest NSA325 U-Boot-2013.10 for testing. There are 2 files in this tarball. Both are NAND version from the same build. The mtd0 version is ready to flash. The uart version is used for uart booting.

Successful UART booting with serial console is required, especially for flashing to NAND. This is very important so that the envs can be adjusted (due to the differences between u-boot versions, some u-boot envs will be obsoleted and must be recreated).

uboot.2013.10-tld-1.nsa325.mtd0.kwb
uboot.2013.10-tld-1.nsa325.uart.kwb

Please test with UART booting, this is NAND version, so the command is:
./kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2013.10-tld-1.nsa325.uart.kwb -p

U-Boot version

U-Boot 2013.10-tld-1 (Aug 29 2014 - 22:07:26)


Note that you will see CRC error in environment. This is because the envs location this U-Boot uses is 0xC0000. There is nothing in that location yet. Feel free to set the envs to boot into Debian just like you have done for stock u-boot before, but don't save with saveenv. Just cut/paste the old envs to set them here for booting.

Download at Dropbox:
uboot.2013.10-tld-1.nsa325.bodhi.tar
md5
ae163289cb6a5db6bb897c0b96d5264a

Flashing Instruction:

The instruction for flashing to mtd0 is basically the same for this u-boot image as others in the 2014.07 U-Boot thread. However, since this is a pre-release image, this u-boot should be flashed to mtd0 only after UART booting has been tried successfully.

In summary:
cat /etc/fw_env.config 

# MTD device name	Device offset	Env. size	Flash sector size	Number of sectors 
/dev/mtd0 0xc0000 0x20000 0x20000

Erase mtd0 
flash_erase /dev/mtd0 0 4

Write image to NAND 
nandwrite /dev/mtd0 uboot.2013.10-tld-1.nsa325.mtd0.kwb


UPDATE:

If for whatever reason, UART bootting is not succesful and the watchdog kicks in before the image is completely loaded. Try this alternative test version attached in this post: very small NSA325 u-boot image.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 7 time(s). Last edit at 11/29/2014 03:17AM by bodhi.
bodhi Wrote:
-------------------------------------------------------

> Since WarheadsSE has not released this U-Boot to
> GitHub, please consider this a pre-released test
> version, not an "official realease" from me. The
> official release will be a different build
> whenever the u-boot-kirkwood GitHub is ready.

I would like to help, but would not know how :D
Do you need testing with it?

--
DavideDG
My NAS userspace configs
My Zyxel NSA325 mod
My D-Link DNS325 mod
My Lacie NS2MAX mod
I flashed the older uboot.2014.07-tld-1.goflexnet.bodhi.tar yesterday to my GoflexNet device. All steps were OK. Now the device does not boot anymore after reset. No light is blinking and nothing occur on serial connection. I am waiting for delivery of JTAG interface now because my device is not able to boot from USB with kwboot.



Edited 1 time(s). Last edit at 08/31/2014 06:43AM by shv.
davidedg,

Thanks! the code base for this u-boot (u-boot-kirkwood) is pretty solid. And I'm done testing new code that WarheadsSE added for the NSA325 (I'm running from NAND). So the general tests remain are regression tests. If you like, you can boot with UART, and set the envs (cut/paste) to the values you have right now, see if you can boot into your Debian rootfs.

The regression tests that I have not run are (I can't run the large SATA HDD test because I don't have any bare 3TB/4TB disk):

- EFI/GPT partition booting
- Ext4 booting (dfarning done this test)
- Large disk > 2TB
- bootz

The idea is if you can run UART booting as a rescue mechanism, then you can flash to NAND, and do whatever you can to verify.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
@shv,

uboot.2014.07-tld-1.goflexnet.bodhi.tar is the latest U-Boot and I'm running it on my GoFlex Net. Did you keep the log? I can take a look to see if you've missed anything.

I hope you did not flash the archive itself?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 09/01/2014 02:37AM by bodhi.
zzbao,

> are these bad blocks in the first 1M? Can I flash
> the new uboot?

Block 67 and the rest, they are way up in other area in NAND.

Please be extremely careful, because the Pogo E02 does not have UART booting. If you have a typo in your commands, you will have a brick :) and the only way to recover is JTAG.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Hi bodhi,

i have 2 problems with flashing the new u-boot an my nsa 325 v2.

1. Bad Blocks:

root@nsa325:/home# dmesg | grep -i 'bad'
[ 21.769430] Scanning device for bad blocks
[ 21.779256] Bad eraseblock 100 at 0x000000c80000
[ 21.789546] Bad eraseblock 200 at 0x000001900000

2. flash_erase u-boot in debian as root

root@nsa325:~# flash_erase /dev/mtd0 0 4
flash_erase: error!: /dev/mtd0
error 13 (Permission denied)

Can i flash with this bad blocks?

And why do i have no permission to flash_erase as root?


sunfire
sunfire,

> root@nsa325:/home# dmesg | grep -i 'bad'
> [ 21.769430] Scanning device for bad blocks
> [ 21.779256] Bad eraseblock 100 at
> 0x000000c80000
> [ 21.789546] Bad eraseblock 200 at
> 0x000001900000
>

These bad blocks are OK. They are far in other regions, not in first 1M.

> 2. flash_erase u-boot in debian as root
>
> root@nsa325:~# flash_erase /dev/mtd0 0 4
> flash_erase: error!: /dev/mtd0
> error 13 (Permission denied)
>

This is because the current kernel NSA325 setup does not allow writing to mtd0. I've updated the kernel and will release version 3.16.0-tld-2, which will have other changes and change to this mtd0 default setting.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 08/31/2014 05:20PM by bodhi.
Hi Bodhi,

thx for the fast answer.

When will 3.16.0-tld-2 be released?

I need a new u-boot, because the watchdog does not support a cold start with debian.

It restarts every time :(

I hope i can fix it with a new submarine :)

sunfire
sunfire,

> When will 3.16.0-tld-2 be released?
Not sure when exactly, could be a next few days.

> I need a new u-boot, because the watchdog does not
> support a cold start with debian.

Boot with a fast USB thumb drive would help a little. But if the HDD is needed to be fsck then it would be too slow to survive the watchdog.

> I hope i can fix it with a new submarine :)
:) Das U-boot?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
bodhi Wrote:
-------------------------------------------------------
> This is because the current kernel NSA325 setup does not allow writing to mtd0.

Out of curiosity, since my kernel build never had this "switch", how do you prevent mtd0 from writing?

> > I hope i can fix it with a new submarine :)
> :) Das U-boot?

First time I searched info on Google for "U-Boot", I was puzzled :D

--
DavideDG
My NAS userspace configs
My Zyxel NSA325 mod
My D-Link DNS325 mod
My Lacie NS2MAX mod
davidedg,

It is defined in mtd nands part:

cat arch/arm/mach-kirkwood/nsa325-setup.c.orig | grep -5 MTD

static struct mtd_partition nsa325_nand_parts[] = {
       {
               .name = "uboot",
               .offset = 0,
               .size = SZ_1M,
               .mask_flags = MTD_WRITEABLE
       }, {


This write flag was masked, and must be removed to allow writing to mtd0.

cat arch/arm/mach-kirkwood/nsa325-setup.c.orig | grep -5 MTD

static struct mtd_partition nsa325_nand_parts[] = {
       {
               .name = "uboot",
               .offset = 0,
               .size = SZ_1M
       }, {

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 09/01/2014 06:35PM by bodhi.
i flashed uboot.2013.10-tld-1.nsa325.mtd0.kwb on nsa325 with 3.16.0-tld-2. Now the new uboot is coming up, but it dont read the envs from mtd1, right?
can i copy the envs from mtd1 or have i to kwboot with uart?
sigma Wrote:
-------------------------------------------------------
> i flashed uboot.2013.10-tld-1.nsa325.mtd0.kwb on
> nsa325 with 3.16.0-tld-2. Now the new uboot is
> coming up, but it dont read the envs from mtd1,
> right?
> can i copy the envs from mtd1 or have i to kwboot
> with uart?

Cool! right, the new u-boot uses diferent location: 0xC0000. So you can cut/paste the existing ones. You can saveenv afterward, it wont touch the old envs location. Booted into Debian, change the /etc/fw_env.config to use 0xC0000.

Please post back your result to let me know in general what's work and anything you'll find that doesnot work as expected.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 09/04/2014 08:34PM by bodhi.
I cant kwboot the uart.kwb, at 94% is always an xmodem error, somehow i thought the watchdog is disabled with this new uboot.
bodhi Wrote:
-------------------------------------------------------
> @shv,
>
> uboot.2014.07-tld-1.goflexnet.bodhi.tar is the
> latest U-Boot and I'm running it on my GoFlex Net.
> Did you keep the log? I can take a look to see if
> you've missed anything.
>
> I hope you did not flash the archive itself?

I don't have a log. But I am sure that I didn't flash the archive. I hope I will get the JTAG running so that I can check the Flash memory content to see what is is wrong. I will try to use a USB Blaster interface togther with OpenOCD tool. It will take some time to get the interface delivered from China.

-shv
sigma Wrote:
-------------------------------------------------------
> I cant kwboot the uart.kwb, at 94% is always an
> xmodem error, somehow i thought the watchdog is
> disabled with this new uboot.

Yes, the watchdog is disabled when u-boot starts. But UART booting is before that! so the binary must be loaded completely and then u-boot starts. That was the reason we've been struggling to get a small u-boot that can be loaded and run correctly before the watchdog timer expired.

Did you boot with the smaller uart version in the tarball? it works consistenly for me.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
@bodhi
yes i used uboot.2013.10-tld-1.nsa325.uart.kwb
@sigma,

Do your downloaded binaries look like this?

-rw-r--r--  1 root root 312828 Aug 29 22:12 uboot.2013.10-tld-1.nsa325.uart.kwb
-rw-r--r--  1 root root 393216 Aug 30 01:28 uboot.2013.10-tld-1.nsa325.mtd0.kwb

Your serial connection might be slow or noisy. I've booted this image many times without failing to load 100%:
uboot.2013.10-tld-1.nsa325.uart.kwb

When you see xmodem error, just recall the kwboot command and start again.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 2 time(s). Last edit at 09/05/2014 04:41PM by bodhi.
What can i do against noisieness, bying a new ftdi? I tried it 10 times always stopped at 94%, with or without hd.
@sigma,

Let me take a look at the UART build size to see if it is even smaller. These 2 versions were both built as NAND binaries.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
sigma Wrote:
-------------------------------------------------------
> What can i do against noisieness, bying a new
> ftdi? I tried it 10 times always stopped at 94%,
> with or without hd.

See this post: http://forum.doozan.com/read.php?2,14351,17501#msg-17501. DavideDG had some problem with the serial connection using VM.

BTW, the HDD does not affect UART image loading in any way. From the point when UART is handshaked until the image is loaded completlely, no devices are detected yet, except serial.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
@bodhi

On my Desktop is siduction running, a sid rolling release. But got it kwboot only one time with stock uboot with many tries before and after. With stock uboot it stopped ever at 97% with new uboot at 94%.
@sigma,

That's certainly strange. I would look at the serial cable routing, do you route it under the board to the outside? I'm taking wildarse guess here! because I loaded this image many times completely without the watchdog barking.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Hi Bodhi,

with your new kernel (thx a lot) i erased my mtd0 and write a new u-boot.

But i lost all of my enviroment variables.

I set them from a backup, then i got an ide error.

I changed ext2load to ext4load in some enviroment variables, but after this my u-boot doesn't parse variables in some enviroment variables like $(bootargs_linux) or $(loadaddr).

If i set the content of $(bootargs_linux) and $(bootargs_linux) in bootcmd_linux=setenv bootargs $(bootargs_linux); ide reset; ext4load ide 0:1 $(loadaddr) /uImage; ext4load ide 0:1 0x01100000 /uInitrd; bootm $(loadaddr) 0x01100000 by hand it starts.

Any idea why it doesn't parse variables after flashing?
@sunfire,

Looking back to the upload post:

Quote

This is because the envs location this U-Boot uses is 0xC0000. There is nothing in that location yet. Feel free to set the envs to boot into Debian just like you have done for stock u-boot before, but don't save with saveenv. Just cut/paste the old envs to set them here for booting.

The reason was stock u-boot is limited in scripting capability (so the awkward way to set bootargs). Because the new u-boot provides hush shell scripting, with the new u-boot, the envs should be set this way:

set_bootargs_usb=console=ttyS0,115200 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2)
bootcmd_usb=mw.l f1010100 0020c000; setenv bootargs $set_bootargs_usb; usb start; ext2load usb 0:1 $loadaddr /boot/uImage; ext2load usb 0:1 0x01100000 /boot/uInitrd; bootm $loadaddr 0x01100000
bootcmd=run bootcmd_usb
arcNumber=4495
mainlineLinux=yes
machid=118f

After you set them in serial console, go ahead and save them with
saveenv

UPDATE:

Reading DavideDG posts, I recall one more thing: the variables should have no parantheses (I am not at my box so I can't cut/paste mine here).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 3 time(s). Last edit at 09/06/2014 04:40PM by bodhi.
I think I followed the instructions in the first post carefully to install the new U-Boot in my E02 running Debian but it won't boot either the PogoOS or Debian from my USB stick so I must have done something wrong.

I have a serial port and the console shows a string of the following error message

get_fl_mem: unknown device type; using raw offset! (this one repeats a bunch of times)
find_inode failed for name=uboot-original-mtd0.kwb
load: Failed to find inode
### JFFS2 LOAD ERROR<0> for uboot-original-mtd0.kwb!
resetting ...

I looked at the output of printenv and arcNumber and Machid were wrong. I corrected them to 3542 and dd6 and issued the boot command but that did not help.

How/where do I find the environment values that I had saved as per the instructions? Any other suggestions?

Thanks.



Edited 1 time(s). Last edit at 09/06/2014 08:28PM by unmesh.
unmesh,

Please post the whole log captured on serial console. From the 1st line (u-boot banner) til the last (when if failed to boot).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Sorry, you can't reply to this topic. It has been closed.