Welcome! Log In Create A New Profile

Advanced

Pogoplug E02 Bad Block, with questions about installing the U-Boot software

Posted by mxhdrm 
Pogoplug E02 Bad Block, with questions about installing the U-Boot software
September 01, 2014 08:22AM
Hi all,

I have a problem with a bad block coming up when I try to install the U-Boot software on my black pogoplug E02. I’m am following the directions here: http://blog.qnology.com/2013/03/tutorial-pogoplug-e02-with-arch-linux.html I’m attempting to make a (second) Squeezebox player for my network. I’ve followed these instructions before, but when I get to the installing of the U-Boot section, it fails with bad blocks.

I am able to boot into the OS that comes with the plug. I receive an IP address as handed out by my router. I have not set it to be a static IP as of yet. I can log in as root. The LED on the front of the unit is a steady green one. I’ve not looked at passing commands to it and checking for a change in the LED status.

I’ve seen that there are new instructions for this, but I’m unable to completely follow them. I have installed the tools from download.doozan.com .
The following is the output that I have for: dmesg, fw_printenv, and cat /proc/mtd .

Unfortunately I don’t know what version of U-Boot I’m using. I do not have a serial console attached. I have ordered the correct parts in order to have one though. However, they will take a few days to arrive. At least I think I’ve purchased the correct parts for a serial connection. But that’s a different topic altogether.

Thank you for any assistance you may be able to give me.
Attachments:
open | download - dmesg output.txt (10.1 KB)
open | download - fw_printenv output.txt (228 bytes)
open | download - proc-mtd.txt (164 bytes)
Re: Pogoplug E02 Bad Block, with questions about installing the U-Boot software
September 01, 2014 04:33PM
mxhdrm,

Did you keep the log of your attempt to flash U-boot? It's always good to include that, too.

Your bad block is right within the first 1M of NAND, and to be precise it is in first 512K, which is where U-Boot is. The instruction in the blog mentioned above, with both the flash_erase and nandwrite commands must have failed, resulted in a bricked Pogoplug. So don't shutdown or turn off power.

[    1.050000] Bad eraseblock 3 at 0x00060000
[    1.060000] Bad eraseblock 15 at 0x001e0000
[    1.070000] Bad eraseblock 225 at 0x01c20000
[    1.110000] Bad eraseblock 983 at 0x07ae0000


Here is what you need to do to recover:

Download u-boot image from this thread, if you have not done so in the attempt.
The u-boot image you need to use is in this tarball: uboot.2014.07-tld-1.pogo_e02.bodhi.tar.

Extract the archive to /tmp
cd /tmp
tar -xf uboot.2014.07.tld-1. pogo_e02.bodhi.tar
List the image to confirm that it is extracted, and it is 512k:
ls -lh uboot.2014.07.tld-1.pogo_e02.mtd0.kwb

Erase mtd0
flash_erase /dev/mtd0 0 5

Write image to NAND
nandwrite /dev/mtd0 uboot.2014.07.tld-1.pogo_e02.mtd0.kwb

Please copy the log of the above commands and their output and post here.

We'll go to the next step after you've done these.

EDIT: more info

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



Edited 3 time(s). Last edit at 09/01/2014 06:16PM by bodhi.
Re: Pogoplug E02 Bad Block, with questions about installing the U-Boot software
September 06, 2014 07:18PM
Hi bodhi,

Thanks for the assistance. I was unable to write back sooner on account of work.

Anyway, this is the output of the two commands that I was able to run. Once I got the file onto the device, I've run these commands:

Pogoplug:/tmp$ ls -lh uboot.2014.07.tld-1.pogo_e02.mtd0.kwb
-rw-r--r--    1 root     root       512.0k Jan  8 11:46 uboot.2014.07.tld-1.pogo_e02.mtd0.kwb


Pogoplug:/tmp$ ./flash_erase /dev/mtd0 0 5
Erase Total 5 Units
Performing Flash Erase of length 131072 at offset 0x60000
MTD Erase failure: Input/output error


Since I already know that my flash is not working properly, I've decided to not press forward and attempt the command after the erase one. Unfortunately, I did not keep a log of my previously attempted Uboot flash.

If there's anything else I can do, please let me know.

Thanks.
Re: Pogoplug E02 Bad Block, with questions about installing the U-Boot software
September 06, 2014 08:30PM
mxhdrm,

> Anyway, this is the output of the two commands
> that I was able to run. Once I got the file onto
> the device, I've run these commands:
>
>
> Pogoplug:/tmp$ ls -lh
> uboot.2014.07.tld-1.pogo_e02.mtd0.kwb
> -rw-r--r--    1 root     root       512.0k Jan  8
> 11:46 uboot.2014.07.tld-1.pogo_e02.mtd0.kwb
>
>
>
>
> Pogoplug:/tmp$ ./flash_erase /dev/mtd0 0 5
> Erase Total 5 Units
> Performing Flash Erase of length 131072 at offset
> 0x60000
> MTD Erase failure: Input/output error
>
>
>
> Since I already know that my flash is not working
> properly, I've decided to not press forward and
> attempt the command after the erase one.
> Unfortunately, I did not keep a log of my
> previously attempted Uboot flash.
>
> If there's anything else I can do, please let me
> know.
>
> Thanks.

I've expected to see the output above. It's OK. That error is just for the bad block. The other blocks were erased OK (no other errors). So go ahead with the next command to write the image to NAND.
nandwrite /dev/mtd0 uboot.2014.07.tld-1.pogo_e02.mtd0.kwb

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Pogoplug E02 Bad Block, with questions about installing the U-Boot software
September 07, 2014 12:13PM
bodhi,

Here's the output of that next command:


Pogoplug:/tmp$ ./nandwrite /dev/mtd0 uboot.2014.07.tld-1.pogo_e02.mtd0.kwb
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Bad block at 60000, 1 block(s) from 60000 will be skipped
Writing data to block 4 at offset 0x80000
pwrite: Input/output error
Erasing failed write from 00080000-0009ffff
Writing data to block 5 at offset 0xa0000
pwrite: Input/output error
Erasing failed write from 000a0000-000bffff
Writing data to block 6 at offset 0xc0000
pwrite: Input/output error
Erasing failed write from 000c0000-000dffff
Writing data to block 7 at offset 0xe0000
pwrite: Input/output error
Erasing failed write from 000e0000-000fffff
Data was only partially written due to error
: Input/output error
Pogoplug:/tmp$

That's the result of the last command you suggested I run. I wasn't sure if it would work anyway, but since you said you expected that result, I'm not all that worried.

Does what was "written" make any sense?

Thanks,

mxhdrm
Re: Pogoplug E02 Bad Block, with questions about installing the U-Boot software
September 07, 2014 03:51PM
mxhdrm,

> Writing data to block 0 at offset 0x0
> Writing data to block 1 at offset 0x20000
> Writing data to block 2 at offset 0x40000

These were successful.

> Writing data to block 3 at offset 0x60000
> Bad block at 60000, 1 block(s) from 60000 will be
> skipped

This is what I expected to see.

> Writing data to block 4 at offset 0x80000
> pwrite: Input/output error
> Erasing failed write from 00080000-0009ffff
> Writing data to block 5 at offset 0xa0000
> pwrite: Input/output error
> Erasing failed write from 000a0000-000bffff
> Writing data to block 6 at offset 0xc0000
> pwrite: Input/output error
> Erasing failed write from 000c0000-000dffff
> Writing data to block 7 at offset 0xe0000
> pwrite: Input/output error
> Erasing failed write from 000e0000-000fffff
> Data was only partially written due to error
> : Input/output error

These were not expected. Your dmesg only showed the block 3 is bad, but not showing blocks 4-7 as bad blocks. So the error is not a good sign.

OK. Let's try this and see what the results will be:
flash_erase /dev/mtd0 0 8
nandwrite /dev/mtd0 uboot.2014.07.tld-1.pogo_e02.mtd0.kwb

What I hope to see from the above 2 commands is the flash_erase will successfully erase 7 blocks, and skip block 3. If that is the case, then the nandwrite will have no error other than showing a bad block (3) was skipped. Pls post output of these 2 commands.

Also, be careful not to have a power outage :) this is the Pogo E02, there is no recovery mean other than JTAG.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Pogoplug E02 Bad Block, with questions about installing the U-Boot software
September 07, 2014 04:47PM
Hi bodhi,

Here's the results. I believe, based on what you've said, that this went as planned.

Pogoplug:/tmp$ ./flash_erase /dev/mtd0 0 8
Erase Total 8 Units
Performing Flash Erase of length 131072 at offset 0x60000
MTD Erase failure: Input/output error


Pogoplug:/tmp$ ./nandwrite /dev/mtd0 uboot.2014.07.tld-1.pogo_e02.mtd0.kwb
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Bad block at 60000, 1 block(s) from 60000 will be skipped
Writing data to block 4 at offset 0x80000

From what I gather, this looks better, right?

And there were no pogoplugs harmed by lack of electricity during this work. ;)
Re: Pogoplug E02 Bad Block, with questions about installing the U-Boot software
September 07, 2014 06:02PM
mxhdrm,

Everything is great as planned!

Quote

And there were no pogoplugs harmed by lack of electricity during this work. ;)

Phew :)

Normally, if this were a UART-enable booting box like other Kirkwood boxes, I would say go ahead and download
the latest Debian rootfs and put it n an Ext3 USB thumb drive and reboot.

However, this is Pogo E02, so we can't boot with UART. I would do the verification step (the commands are bold) before declaring it's all good. If you see the output look like below then you're good to go. But don't reboot yet, check your u-boot envs before rebooting!

cd /tmp

nanddump -nof /tmp/uBoot1.dump -l 0x60000 /dev/mtd0

Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00060000...

nanddump -nof /tmp/uBoot2.dump -l 0x20000 -s 0x80000 /dev/mtd0

Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00080000 and ending at 0x000a0000...

cat uBoot1.dump uBoot2.dump > uBoot.dump

diff -s uboot.2014.07.tld-1.pogo_e02.mtd0.kwb  uBoot.dump

Files uboot.2014.07.tld-1.pogo_e02.mtd0.kwb and uBoot.dump are identical

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



Edited 2 time(s). Last edit at 09/07/2014 06:14PM by bodhi.
Re: Pogoplug E02 Bad Block, with questions about installing the U-Boot software
September 07, 2014 07:21PM
Hi bodhi,

Here's the output of those commands.

Pogoplug:/tmp$ ./nanddump -nof /tmp/uBoot1.dump -l 0x60000 /dev/mtd0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00060000...

Pogoplug:/tmp$ ./nanddump -nof /tmp/uBoot2.dump -l 0x20000 -s 0x80000 /dev/mtd0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00080000 and ending at 0x000a0000...


Pogoplug:/tmp$ cat uBoot1.dump uBoot2.dump > uBoot.dump

Pogoplug:/tmp$ diff -s uboot.2014.07.tld-1.pogo_e02.mtd0.kwb uBoot.dump

Files uboot.2014.07.tld-1.pogo_e02.mtd0.kwb and uBoot.dump are identical


Pogoplug:/tmp$ cat /etc/fw_env.config
# Configuration file for fw_(printenv/saveenv) utility.
# Up to two entries are valid, in this case the redundant
# environment sector is assumed present.
# Notice, that the "Number of sectors" is ignored on NOR.

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

Pogoplug:/tmp$ cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00400000 00020000 "uImage"
mtd2: 02000000 00020000 "root"
mtd3: 05b00000 00020000 "data"

So where do I go from here? Should I continue with the directions on http://blog.qnology.com/2013/03/tutorial-pogoplug-e02-with-arch-linux.html , right after this point:

#Partition your USB flash/hard drive
/sbin/fdisk /dev/sda

If that's the case, then I'll continue.

Thanks for all your help. I truly now feel awake, like your namesake.

mxhdrm
Re: Pogoplug E02 Bad Block, with questions about installing the U-Boot software
September 07, 2014 11:41PM
mxhdrm,

Looks good!

However, your original attempt for u-boot installation stopped because of bad block, u-boot environment image was not flashed (CRC error when you do fw_printenv). Do this before continue with the rootfs USB creation. You need to flash a default envs set using the instruction in step 8 (section B) of my U-boot installation instruction:

Below is a simplified section B for the Pogo E02. If you're not sure or encounter error during executing commands, please post back.

Quote

B. Flashing default u-boot envs image

This section describes how to flash a default set of u-boot envs. The bootcmd in this setup is set to boot from USB, MMC, and SATA in this order (USB will be tried first, if unsuccessful then MMC will be tried, and then if unsuccessfull SATA will be tried).

a. Download the default u-boot envs at Dropbox:

uboot.2014.07-tld-1.environment.img.bodhi.tar
md5
c5921e3ea0a07a859878339ffb771088

b. Extract the archive to /tmp
cd /tmp
tar -xf uboot.2014.07-tld-1.environment.img.bodhi.tar

c. Skip.

d. Flash u-boot envs to NAND location 0xC0000.

Be extra careful with the next 2 commands, you should see output that look like below. If there is error, then do not reboot, post your problem here so we can help.

/usr/sbin/flash_erase /dev/mtd0 0xc0000 1
Erase Total 1 Units
Performing Flash Erase of length 131072 at offset 0xc0000 done

/usr/sbin/nandwrite -s 786432 /dev/mtd0 uboot.2014.07-tld-1.environment.img 
Writing data to block 6 at offset 0xc0000

e. Modify the following u-boot variables using fw_setenv:

Warning: arcNumber and/or machid should only be changed if you have a kernel that supports the box you're installing for. If not sure, leave these envs as they are. See the latest kernel & rootfs thread for how to create rootfs or installing kernel that supports these boxes.

for Pogo E02:
fw_setenv arcNumber 3542
fw_setenv machid dd6

Restore the ethaddr (if you don't have this saved somewhere then look on the Pogo case or cardboard box):
fw_setenv ethaddr 'xx:xx:xx:xx:xx:xx'

f. For sanity check, list you envs again
fw_printenv

If there is error in listing u-boot envs, stop here and post your problem so we can help.

g. Done.

> I truly now feel awake,
> like your namesake.
:D

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Pogoplug E02 Bad Block, with questions about installing the U-Boot software
September 08, 2014 08:34AM
Hi bohdi,

I've completed the commands listed and got back the same output as you said I would. Next is the output of the fw_printenv:


Pogoplug:/usr/sbin$ ./fw_printenv
ipaddr=192.168.0.231
serverip=192.168.0.220
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
baudrate=115200
bootcmd=run bootcmd_usb; run bootcmd_mmc; run bootcmd_sata; reset
bootcmd_mmc=run mmc_init; run set_bootargs_mmc; run mmc_boot
bootcmd_sata=run sata_init; run set_bootargs_sata; run sata_boot;
bootcmd_usb=run usb_init; run set_bootargs_usb; run usb_boot;
bootdelay=10
console=ttyS0,115200
device=0:1
ethact=egiga0
if_netconsole=ping $serverip
led_error=orange blinking
led_exit=green off
led_init=green blinking
mainlineLinux=yes
mmc_boot=mw 0x800000 0 1; run mmc_load_uimage; if run mmc_load_uinitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
mmc_init=mmc rescan
mmc_load_uimage=ext2load mmc $device 0x800000 /boot/uImage
mmc_load_uinitrd=ext2load mmc $device 0x1100000 /boot/uInitrd
mmc_root=/dev/mmcblk0p1
mtdids=nand0=orion_nand
partition=nand0,2
preboot_nc=run if_netconsole start_netconsole
rootdelay=10
rootfstype=ext3
sata_boot=mw 0x800000 0 1; run sata_load_uimage; if run sata_load_uinitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
sata_init=ide reset
sata_load_uimage=ext2load ide $device 0x800000 /boot/uImage
sata_load_uinitrd=ext2load ide $device 0x1100000 /boot/uInitrd
sata_root=/dev/sda1
set_bootargs_mmc=setenv bootargs console=$console root=$mmc_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
set_bootargs_sata=setenv bootargs console=$console root=$sata_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
set_bootargs_usb=setenv bootargs console=$console root=$usb_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
usb_boot=mw 0x800000 0 1; run usb_load_uimage; if run usb_load_uinitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
usb_init=usb start
usb_load_uimage=ext2load usb $device 0x800000 /boot/uImage
usb_load_uinitrd=ext2load usb $device 0x1100000 /boot/uInitrd
usb_root=/dev/sda1
arcNumber=3542
machid=dd6
ethaddr=00:25:31:04:82:16

I've included my MAC address, not knowing if it's a faux pas to include the actual one.

It looks good, right?

Thanks,

mxhdrm
Re: Pogoplug E02 Bad Block, with questions about installing the U-Boot software
September 08, 2014 04:16PM
mxhdrm,

Congrats! it looks good!

Now you can setup netconsole ( step 10 in my u-boot installation instruction) before reboot the box with USB attached.

Use a USB thumb drive, formatted is as Ext3. Put either latest Arch or Debian rootfs on it and reboot. If you use Debian rootfs, it really does not matter if you have swap or not, otherwise follow Arch instruction to create rootfs if it does require it.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Pogoplug E02 Bad Block, with questions about installing the U-Boot software
September 08, 2014 04:48PM
deleted.

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



Edited 1 time(s). Last edit at 09/08/2014 04:49PM by bodhi.
Re: Pogoplug E02 Bad Block, with questions about installing the U-Boot software
September 09, 2014 07:15PM
Hi bodhi,

I had a little trouble with getting the rootfs and such on it, but I was able to get it to work. I had unrelated to u-boot trouble, but it's all been worked out now. Thanks for all the help!

mxhdrm
Re: Pogoplug E02 Bad Block, with questions about installing the U-Boot software
September 09, 2014 08:14PM
mxhdrm,

Cool! glad you got it all worked out, and now can enjoy playing ;)

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

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: