Welcome! Log In Create A New Profile

Advanced

Bricked Pogo E02 after attempting OpenWRT install

Posted by Tom Cooper 
Tom Cooper
Bricked Pogo E02 after attempting OpenWRT install
February 27, 2019 04:56PM
A few years back, I attempted to install OpenWRT on my Pink PogoPlug E02. Something went wrong and it wouldn't boot again. I tossed it in a box and threatened to get back to it one day.

That day has come.
I hooked up the serial console and this is what I get:
U-Boot 2014.10 (Jul 24 2015 - 20:11:30)
Pogo E02

SoC:   Kirkwood 88F6281_A0
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Hit any key to stop autoboot:  3  2  1  0 
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI: attached mtd1 (name "mtd=3", size 126 MiB) to ubi0
UBI: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512
UBI: VID header offset: 512 (aligned 512), data offset: 2048
UBI: good PEBs: 1006, bad PEBs: 2, corrupted PEBs: 0
UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0
UBI: available PEBs: 0, total reserved PEBs: 1006, PEBs reserved for bad PEB handling: 18
** File not found /boot/zImage **
** File not found /boot/pogo_e02.dtb **
Unmounting UBIFS volume rootfs!
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
Bad Linux ARM zImage magic!
PogoE02>
The current environment is:
printenv
baudrate=115200
bootargs=console=ttyS0,115200 mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100000@0x100000(second_stage_uboot),-@0x200000(root) ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs rw
bootargs_root=ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs rw
bootcmd=setenv bootargs ${console} ${mtdparts} ${bootargs_root}; ubi part root; ubifsmount ubi:rootfs; ubifsload 0x800000 ${kernel}; ubifsload 0x700000 ${fdt}; ubifsumount; fdt addr 0x700000; fdt resize; fdt chosen; bootz 0x800000 - 0x700000
bootdelay=3
cesvcid=xxxxxx
console=console=ttyS0,115200
ethact=egiga0
ethaddr=00:25:31:00:96:75
fdt=/boot/pogo_e02.dtb
ipaddr=192.168.1.43
kernel=/boot/zImage
mtddevname=uboot
mtddevnum=0
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100000@0x100000(second_stage_uboot),-@0x200000(root)
nand_erasesize=20000
nand_oobsize=40
nand_writesize=800
partition=nand0,0
serverip=192.168.1.117
stderr=serial
stdin=serial
stdout=serial

Environment size: 1066/131068 bytes
PogoE02>

I remember that some bad spots in the nand caused my problems...
PogoE02> nand info

Device 0: nand0, sector size 128 KiB
  Page size      2048 b
  OOB size         64 b
  Erase size   131072 b
PogoE02> nand bad

Device 0 bad blocks:
  01840000
  06520000
PogoE02>

I would like to install a current version of OpenWRT, if possible.
It seems like I'm not too far away from getting this back up.

I have the tftp server up and running. It seems I just need to flash the current stuff, but somehow deal with the bad blocks.

Can anyone point me in the right direction?
Thanks for any help.
Tom
Re: Bricked Pogo E02 after attempting OpenWRT install
February 28, 2019 03:14AM
Tom,

The problem with your box right now is you are running OpenWrt version of u-boot. That makes it a little bit more difficult for me to help you.

You have these bad blocks

0x01840000  at about 24MB
0x06520000 at about 101 MB

Those are in the rootfs area. So it is likely that's why you see

** File not found /boot/zImage **
** File not found /boot/pogo_e02.dtb **

So to recover, you need to try to boot into Debian on USB, and then reinstall OpenWrt from there. Duringthe installation, UBIFS will manage the bad blocks correctly, and you will end up with a good UBIFS volume (with the bad blocks hidden away from the file system). Does that sound like something you want to do?

You could also try to install OpenWrt rootfs in serial console. But that will be quite cumbersome and you are going to jump through many hoops to get there.

-bodhi
===========================
Forum Wiki
bodhi's corner
Tom Cooper
Re: Bricked Pogo E02 after attempting OpenWRT install
March 01, 2019 11:26AM
Thanks for your offer of help.
I would like to try to install rootfs using the serial console. I'm starting to get a feel for this, so I'm probably real dangerous now!
My ultimate goal is to get this box into a state where I can run SMB, HTTP and a webcam. I thought that OpenWRT might be the easiest way to acheive that.
Not sure if that is misguided or not.

I flashed the latest uBoot, available from here: https://forum.doozan.com/read.php?3,12381
by using:
  tftpboot 0x800000 uboot.2017.07-tld-1.pogo_e02.mtd0.kwb 
  nand erase 0x0 0x80000
  nand write.e 0x800000 0x0 0x80000
Now when I boot, this is what I see on the serial console:
(still missing the same files, ultimately)
U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:13:18 -0700)
Pogo E02

SoC:   Kirkwood 88F6281_A0
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Hit any key to stop autoboot:  3  2  1  0 
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
** Bad device usb 0 **
** Bad device usb 0 **
ubi0: attaching mtd1
ubi0: scanning is finished
UBI init error 22
** Bad device usb 0 **
** Bad device usb 1 **
** Bad device usb 2 **
** Bad device usb 3 **
** Bad device usb 0 **
** Bad device usb 0 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
stopping USB..

NAND read: device 0 offset 0x100000, size 0x400000
 4194304 bytes read: OK
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   OpenWrt Das U-Boot uImage
   Created:      2015-07-24  18:12:43 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    454856 Bytes = 444.2 KiB
   Load Address: 00600000
   Entry Point:  00600000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...



U-Boot 2014.10 (Jul 24 2015 - 20:12:13)
Pogo E02

SoC:   Kirkwood 88F6281_A0
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Error: egiga0 address not set.

Hit any key to stop autoboot:  3  2  1  0 
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI: attached mtd1 (name "mtd=3", size 126 MiB) to ubi0
UBI: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512
UBI: VID header offset: 512 (aligned 512), data offset: 2048
UBI: good PEBs: 1006, bad PEBs: 2, corrupted PEBs: 0
UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0
UBI: available PEBs: 0, total reserved PEBs: 1006, PEBs reserved for bad PEB handling: 18
** File not found /boot/zImage **
** File not found /boot/pogo_e02.dtb **
Unmounting UBIFS volume rootfs!
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
Bad Linux ARM zImage magic!
PogoE02>
It seems like I should be able to get this to work from here.
If I understand correctly, the chained boot is not necessary, so it could be eliminated to simplify things.

My current environment settings are:
PogoE02> printenv
arcNumber=2097
baudrate=115200
bootargs_root=root=/dev/mtdblock2 ro
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset
bootdelay=3
ceboardver=PPV2
cesvcid=xxxxxx-xxxxxx-xx-xxxxxx-xxxxxx
console=console=ttyS0,115200
ethact=egiga0
ethaddr=00:25:31:00:96:75
fileaddr=800000
filesize=B3B7EB
force_rescue=0
force_rescue_bootcmd=if test $force_rescue -eq 1 || ext2load usb 0:1 0x1700000 /rescueme 1 || fatload usb 0:1 0x1700000 /rescueme.txt 1; then run rescue_bootcmd; fi
ipaddr=192.168.1.14
led_error=orange blinking
led_exit=green off
led_init=green blinking
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
partition=nand0,2
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
rescue_bootcmd=if test $rescue_installed -eq 1; then run rescue_set_bootargs; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000; else run pogo_bootcmd; fi
rescue_installed=1
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
serverip=192.168.1.13
stderr=serial
stdin=serial
stdout=serial
tec=$bootcmd
ubifs_bootcmd=run ubifs_set_bootargs; if ubi part data && ubifsmount rootfs && ubifsload 0x800000 /boot/uImage && ubifsload 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; fi
ubifs_mtd=3
ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params
usb_boot=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage; if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
usb_device=0:1
usb_init=run usb_scan
usb_root=/dev/sda1
usb_rootdelay=10
usb_rootfstype=ext2
usb_scan=usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb $usb 0x800000 /boot/uImage 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done
usb_scan_1=usb=0:1 dev=sda1
usb_scan_2=usb=1:1 dev=sdb1
usb_scan_3=usb=2:1 dev=sdc1
usb_scan_4=usb=3:1 dev=sdd1
usb_scan_list=1 2 3 4
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params

Environment size: 2545/131068 bytes
I still have the bad blocks
PogoE02> nand bad

Device 0 bad blocks:
  01840000
  06520000

PogoE02> mtdparts

device nand0 <orion_nand>, # parts = 4
 #: name		size		offset		mask_flags
 0: u-boot              0x00100000	0x00000000	0
 1: uImage              0x00400000	0x00100000	0
 2: rootfs              0x02000000	0x00500000	0
 3: data                0x05b00000	0x02500000	0

active partition: nand0,2 - (rootfs) 0x02000000 @ 0x00500000

defaults:
mtdids  : none
mtdparts: none
So, where do I go from here?

Assuming I want to stay in the serial console for a bit longer. :-)

Thanks for your wise council.
Re: Bricked Pogo E02 after attempting OpenWRT install
March 01, 2019 03:08PM
Tom,

> My ultimate goal is to get this box into a state
> where I can run SMB, HTTP and a webcam. I thought
> that OpenWRT might be the easiest way to acheive
> that.
> Not sure if that is misguided or not.

Not misguided! a lot of people like to run OpenWRT, because it is popular and a very good distro. But if you like to update your system regularly to get latest security pacthes then Debian is safer. Also better fit your needs because your rootfs is on USB or HDD.

> U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:13:18
> -0700)
> Pogo E02

Excellent!

> It seems like I should be able to get this to work
> from here.
> If I understand correctly, the chained boot is not
> necessary, so it could be eliminated to simplify
> things.

Right. Chainload is not necessary anymore. You have installed newer u-boot and it can boot Debian/Arch on USB.

Your envs are old, they were from the previous u-boot.

So to load the correct default envs for uboot.2017.07-tld-1.pogo_e02

See this post:
https://forum.doozan.com/read.php?3,29362,29390#msg-29390

Note the adjustment of a few envs in that post.

setenv devices 'usb ide'
setenv ethaddr xx:xx:xx:xx:xx:xx
setenv dtb_file '/boot/dts/kirkwood-goflexnet.dtb'

For your box it should be:
setenv devices usb
setenv dtb_file '/boot/dts/kirkwood-pogo_e02.dtb'
ethaddr can be set later, or right away in serial console if you like.

After loading the default envs script and adjust the envs, you are ready to boot rootfs Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 on USB.

-bodhi
===========================
Forum Wiki
bodhi's corner
Tom Cooper
Re: Bricked Pogo E02 after attempting OpenWRT install
March 03, 2019 08:21PM
I went ahead and created the bootable USB drive to help me along, but first, I did a few more things from the serial console.
I loaded in the default environment:
# install default uBoot environment variables, offset 0xc0000, length 0x20000
nand erase 0xc0000 0x20000
mw 0x800000 00 0x20000
tftpboot 0x800000 uboot.2016.05-tld-1.environment.img
nand write 0x800000 0xc0000 0x20000
I changed the variables specific to my environment:
setenv ipaddr '192.168.1.43'
setenv serverip '192.168.1.41'
setenv ethaddr '00:25:31:00:96:75'
setenv arcNumber '3542'
setenv machid 'dd6'
saveenv
Just for reference, my mtd defs
PogoE02> mtdparts

device nand0 <orion_nand>, # parts = 4
 #: name		size		offset		mask_flags
 0: u-boot              0x00100000	0x00000000	0
 1: uImage              0x00400000	0x00100000	0
 2: rootfs              0x02000000	0x00500000	0
 3: data                0x05b00000	0x02500000	0

active partition: nand0,2 - (rootfs) 0x02000000 @ 0x00500000

defaults:
mtdids  : none
mtdparts: none
PogoE02>
I downloaded the OpenWrt 18.06.2 initramfs & uImage and rootfs files and put them in my TFTP server.
I then (attempted) to load them into NAND.
The first part went OK.
PogoE02> # Install Kernel & initramfs in uImage
PogoE02> nand erase 0x00100000 0x00400000

NAND erase: device 0 offset 0x100000, size 0x400000

Erasing at 0x100000 --   3% complete.
Erasing at 0x120000 --   6% complete.
Erasing at 0x140000 --   9% complete.
Erasing at 0x160000 --  12% complete.
Erasing at 0x180000 --  15% complete.
Erasing at 0x1a0000 --  18% complete.
Erasing at 0x1c0000 --  21% complete.
Erasing at 0x1e0000 --  25% complete.
Erasing at 0x200000 --  28% complete.
Erasing at 0x220000 --  31% complete.
Erasing at 0x240000 --  34% complete.
Erasing at 0x260000 --  37% complete.
Erasing at 0x280000 --  40% complete.
Erasing at 0x2a0000 --  43% complete.
Erasing at 0x2c0000 --  46% complete.
Erasing at 0x2e0000 --  50% complete.
Erasing at 0x300000 --  53% complete.
Erasing at 0x320000 --  56% complete.
Erasing at 0x340000 --  59% complete.
Erasing at 0x360000 --  62% complete.
Erasing at 0x380000 --  65% complete.
Erasing at 0x3a0000 --  68% complete.
Erasing at 0x3c0000 --  71% complete.
Erasing at 0x3e0000 --  75% complete.
Erasing at 0x400000 --  78% complete.
Erasing at 0x420000 --  81% complete.
Erasing at 0x440000 --  84% complete.
Erasing at 0x460000 --  87% complete.
Erasing at 0x480000 --  90% complete.
Erasing at 0x4a0000 --  93% complete.
Erasing at 0x4c0000 --  96% complete.
Erasing at 0x4e0000 -- 100% complete.
OK
PogoE02> mw 0x800000 00 0x00400000
PogoE02> tftpboot 0x800000 openwrt-18.06.2-kirkwood-cloudengines_pogoe02-initramfs-uImage
Using egiga0 device
TFTP from server 192.168.1.41; our IP address is 192.168.1.43
Filename 'openwrt-18.06.2-kirkwood-cloudengines_pogoe02-initramfs-uImage'.
Load address: 0x800000
Loading: *#################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 ###############################
	 536.1 KiB/s
done
Bytes transferred = 3481730 (352082 hex)
PogoE02> nand write 0x800000 0x00100000 0x00400000

NAND write: device 0 offset 0x100000, size 0x400000
 4194304 bytes written: OK
When I attempted to write the rootfs, things didn't go so well (also, remember, there is a bad block in here)
PogoE02> # Install rootfs
PogoE02> nand erase 0x00500000 0x02000000

NAND erase: device 0 offset 0x500000, size 0x2000000

Erasing at 0x500000 --   0% complete.
Erasing at 0x540000 --   1% complete.
Erasing at 0x5a0000 --   2% complete.
Erasing at 0x5e0000 --   3% complete.
Erasing at 0x640000 --   4% complete.
Erasing at 0x680000 --   5% complete.
Erasing at 0x6e0000 --   6% complete.
Erasing at 0x720000 --   7% complete.
Erasing at 0x780000 --   8% complete.
Erasing at 0x7e0000 --   9% complete.
Erasing at 0x820000 --  10% complete.
Erasing at 0x880000 --  11% complete.
Erasing at 0x8c0000 --  12% complete.
Erasing at 0x920000 --  13% complete.
Erasing at 0x960000 --  14% complete.
Erasing at 0x9c0000 --  15% complete.
Erasing at 0xa00000 --  16% complete.
Erasing at 0xa60000 --  17% complete.
Erasing at 0xac0000 --  18% complete.
Erasing at 0xb00000 --  19% complete.
Erasing at 0xb60000 --  20% complete.
Erasing at 0xba0000 --  21% complete.
Erasing at 0xc00000 --  22% complete.
Erasing at 0xc40000 --  23% complete.
Erasing at 0xca0000 --  24% complete.
Erasing at 0xce0000 --  25% complete.
Erasing at 0xd40000 --  26% complete.
Erasing at 0xda0000 --  27% complete.
Erasing at 0xde0000 --  28% complete.
Erasing at 0xe40000 --  29% complete.
Erasing at 0xe80000 --  30% complete.
Erasing at 0xee0000 --  31% complete.
Erasing at 0xf20000 --  32% complete.
Erasing at 0xf80000 --  33% complete.
Erasing at 0xfe0000 --  34% complete.
Erasing at 0x1020000 --  35% complete.
Erasing at 0x1080000 --  36% complete.
Erasing at 0x10c0000 --  37% complete.
Erasing at 0x1120000 --  38% complete.
Erasing at 0x1160000 --  39% complete.
Erasing at 0x11c0000 --  40% complete.
Erasing at 0x1200000 --  41% complete.
Erasing at 0x1260000 --  42% complete.
Erasing at 0x12c0000 --  43% complete.
Erasing at 0x1300000 --  44% complete.
Erasing at 0x1360000 --  45% complete.
Erasing at 0x13a0000 --  46% complete.
Erasing at 0x1400000 --  47% complete.
Erasing at 0x1440000 --  48% complete.
Erasing at 0x14a0000 --  49% complete.
Erasing at 0x14e0000 --  50% complete.
Erasing at 0x1540000 --  51% complete.
Erasing at 0x15a0000 --  52% complete.
Erasing at 0x15e0000 --  53% complete.
Erasing at 0x1640000 --  54% complete.
Erasing at 0x1680000 --  55% complete.
Erasing at 0x16e0000 --  56% complete.
Erasing at 0x1720000 --  57% complete.
Erasing at 0x1780000 --  58% complete.
Erasing at 0x17e0000 --  59% complete.
Erasing at 0x1820000 --  60% complete.
Skipping bad block at  0x01840000                                          

Erasing at 0x1880000 --  61% complete.
Erasing at 0x18c0000 --  62% complete.
Erasing at 0x1920000 --  63% complete.
Erasing at 0x1960000 --  64% complete.
Erasing at 0x19c0000 --  65% complete.
Erasing at 0x1a00000 --  66% complete.
Erasing at 0x1a60000 --  67% complete.
Erasing at 0x1ac0000 --  68% complete.
Erasing at 0x1b00000 --  69% complete.
Erasing at 0x1b60000 --  70% complete.
Erasing at 0x1ba0000 --  71% complete.
Erasing at 0x1c00000 --  72% complete.
Erasing at 0x1c40000 --  73% complete.
Erasing at 0x1ca0000 --  74% complete.
Erasing at 0x1ce0000 --  75% complete.
Erasing at 0x1d40000 --  76% complete.
Erasing at 0x1da0000 --  77% complete.
Erasing at 0x1de0000 --  78% complete.
Erasing at 0x1e40000 --  79% complete.
Erasing at 0x1e80000 --  80% complete.
Erasing at 0x1ee0000 --  81% complete.
Erasing at 0x1f20000 --  82% complete.
Erasing at 0x1f80000 --  83% complete.
Erasing at 0x1fe0000 --  84% complete.
Erasing at 0x2020000 --  85% complete.
Erasing at 0x2080000 --  86% complete.
Erasing at 0x20c0000 --  87% complete.
Erasing at 0x2120000 --  88% complete.
Erasing at 0x2160000 --  89% complete.
Erasing at 0x21c0000 --  90% complete.
Erasing at 0x2200000 --  91% complete.
Erasing at 0x2260000 --  92% complete.
Erasing at 0x22c0000 --  93% complete.
Erasing at 0x2300000 --  94% complete.
Erasing at 0x2360000 --  95% complete.
Erasing at 0x23a0000 --  96% complete.
Erasing at 0x2400000 --  97% complete.
Erasing at 0x2440000 --  98% complete.
Erasing at 0x24a0000 --  99% complete.
Erasing at 0x24e0000 -- 100% complete.
OK
PogoE02> tftpboot 0x800000 openwrt-18.06.2-kirkwood-cloudengines_pogoe02-squashfs-factory.bin
Using egiga0 device
TFTP from server 192.168.1.41; our IP address is 192.168.1.43
Filename 'openwrt-18.06.2-kirkwood-cloudengines_pogoe02-squashfs-factory.bin'.
Load address: 0x800000
Loading: *#################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 ##############
	 490.2 KiB/s
done
Bytes transferred = 4063232 (3e0000 hex)
PogoE02> nand write 0x800000 0x00100000 0x003e0000

NAND write: device 0 offset 0x100000, size 0x3e0000
NAND write to offset 100000 failed -5
 0 bytes written: ERROR
PogoE02>
I had read somewhere in one of these forums where someone else had encountered this error and was able to write the same data from the bootable Debian system. I had created one, just in case...
I booted it up and gave it a shot:
Debian GNU/Linux 9 PogoPlug1 ttyS0

PogoPlug1 login: root

Password: 
Last login: Wed Dec 31 16:00:48 PST 1969 on ttyS0
Linux PogoPlug1 4.12.1-kirkwood-tld-1 #1 PREEMPT Sat Jul 15 21:40:50 PDT 2017 armv5tel
root@PogoPlug1:/# wget http://192.168.1.30/openwrt-18.06.2-kirkwood-cloudengines_
_pogoe02-squashfs-factory.bin
--2019-03-03 18:29:30--  http://192.168.1.30/openwrt-18.06.2-kirkwood-cloudengines_pogoe02-squashfs-factory.bin
Connecting to 192.168.1.30:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4063232 (3.9M) [application/octet-stream]
Saving to: 'openwrt-18.06.2-kirkwood-cloudengines_pogoe02-squashfs-factory.bin'


          openwrt-1   0%[                    ]       0  --.-KB/s               
         openwrt-18  54%[=========>          ]   2.09M  10.5MB/s               
openwrt-18.06.2-kir 100%[===================>]   3.88M  10.8MB/s    in 0.4s    

2019-03-03 18:29:30 (10.8 MB/s) - 'openwrt-18.06.2-kirkwood-cloudengines_pogoe02-squashfs-factory.bin' saved [4063232/4063232]

root@PogoPlug1:/# nandwrite /dev/mtd2 /openwrt-18.06.2-kirkwood-cloudengines_pogoe02-squashfs-factory.bin
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
Writing data to block 4 at offset 0x80000
Writing data to block 5 at offset 0xa0000
Writing data to block 6 at offset 0xc0000
Writing data to block 7 at offset 0xe0000
Writing data to block 8 at offset 0x100000
Writing data to block 9 at offset 0x120000
Writing data to block 10 at offset 0x140000
Writing data to block 11 at offset 0x160000
Writing data to block 12 at offset 0x180000
Writing data to block 13 at offset 0x1a0000
Writing data to block 14 at offset 0x1c0000
Writing data to block 15 at offset 0x1e0000
Writing data to block 16 at offset 0x200000
Writing data to block 17 at offset 0x220000
Writing data to block 18 at offset 0x240000
Writing data to block 19 at offset 0x260000
Writing data to block 20 at offset 0x280000
Writing data to block 21 at offset 0x2a0000
Writing data to block 22 at offset 0x2c0000
Writing data to block 23 at offset 0x2e0000
Writing data to block 24 at offset 0x300000
Writing data to block 25 at offset 0x320000
Writing data to block 26 at offset 0x340000
Writing data to block 27 at offset 0x360000
Writing data to block 28 at offset 0x380000
Writing data to block 29 at offset 0x3a0000
Writing data to block 30 at offset 0x3c0000
root@PogoPlug1:/# mtdinfo
Count of MTD devices:           4
Present MTD devices:            mtd0, mtd1, mtd2, mtd3
Sysfs interface supported:      yes
root@PogoPlug1:/#
This write succeeded. From what I've read, this is how it should have worked... just ignored/skipped the bad block.
Not sure why the uBoot environment didn't work that way.

Anyway, it seems I'm real close now... I'm pretty sure that I just need to change one of the environment variables to tell uBoot to boot the uImage partition.

I need a few more clues to get there.
Thanks.
Re: Bricked Pogo E02 after attempting OpenWRT install
March 03, 2019 10:15PM
Tom,

Quote

> root@PogoPlug1:/# nandwrite /dev/mtd2
> /openwrt-18.06.2-kirkwood-cloudengines_pogoe02-squashfs-factory.bin
...
...
> Writing data to block 30 at offset 0x3c0000

> This write succeeded. From what I've read, this is
> how it should have worked... just ignored/skipped
> the bad block.
> Not sure why the uBoot environment didn't work
> that way.

Note your bad blocks are at ~24M, ~101 MB

Device 0 bad blocks:
  01840000
  06520000

> Writing data to block 30 at offset 0x3c0000

The write was less than 4MB.

So the bad blocks were not skipped, because it was never accessed.

What I think the difference is:

1. Note your original installation use UBIFS

bootcmd=setenv bootargs ${console} ${mtdparts} ${bootargs_root}; ubi part root; ubifsmount ubi:rootfs; ubifsload 0x800000 ${kernel}; ubifsload 0x700000 ${fdt}; ubifsumount; fdt addr 0x700000; fdt resize; fdt chosen; bootz 0x800000 - 0x700000

2. Now your new installation used Squasfs.

openwrt-18.06.2-kirkwood-cloudengines_pogoe02-squashfs-factory.bin

=====

At this point, I think you should follow this instruction in the Wiki thread. And install OpenWrt from u-boot console:

Quote

Rescue Systems

Rescue System V2 (Original)
MacPlug & SMBPLug
Rescue System Pogo V3
Rescue System V4, using a custom LEDE firmware (BETA)
Rescue System for Pogo E02 using LEDE

Rescue System for Pogo E02 using LEDE

=====

Ignore the official installation using Squashfs. The instruction above in the Wiki is much simpler and also should take care of your bad blocks. Previously, I thought there a Linux shell installtion procedure that let you format the UBI partition, hence the suggestion to boot Debian. In any case, it is still good that you can boot Debian as a fallback.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bricked Pogo E02 after attempting OpenWRT install
June 29, 2019 02:38PM
Im building a UBI file system and then writing it to nand (but only write the size of the file)

https://forum.doozan.com/read.php?4,86219,87064#msg-87064



Edited 2 time(s). Last edit at 06/29/2019 03:09PM by markbirss@gmail.com.
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: