Welcome! Log In Create A New Profile

Advanced

revive Medion oxnas stg-212

Posted by alexinc 
revive Medion oxnas stg-212
March 14, 2018 04:01AM
Hey guys, as i didn't succeed on openwrt-forums for now and you really seem familiar to my device, maybe someone is able to help me reviving my Medion NAS? :-) For now i think my problem could be mtd-related and there is no place to uncompress Linux?

I tried to "factory reset" my Medion NAS running OpenWrt for oxnas by re-flashing openwrt-oxnas-stg212-squashfs-ubinized.bin. Device didn't come up again, so i checked with serial and got:

Starting kernel ...

Uncompressing Linux...

XZ-compressed data is corrupt

 -- System halted


After digging for 48 hours now i managed to update u-boot, but didn't manage to get any further booting at least into rescue or something else. Guess it's a pretty easy task for someone who knows what to do, but i'm simply failing starting kernel from 0x62000000 - at least that's what i'm thinking... My logs so far:

Stage-1 Bootloader Thu Nov 24 19:20:59 CST 2011
Attempting to set PLLA to 750MHz ...
  plla_ctrl0 : 0x0000000A
  plla_ctrl1 : 0x000F0000
  plla_ctrl2 : 0x001D01A0
  plla_ctrl3 : 0x00000017
PLLA Set

Setup memory, testing, Image 0
  Hdr len: 0x0001A94C
  Hdr CRC: 0xF0019DAC
 OK


U-Boot 1.1.2 (Jun 24 2011 - 09:41:57)

U-Boot code: 60D00000 -> 60D1A94C  BSS: -> 60D1F004
RAM Configuration:
        Bank #0: 60000000 128 MB
SRAM Configuration:
        64KB at 0x50000000
NAND:128 MiB
In:    serial
Out:   serial
Err:   serial
Setting Linux mem= boot arg value
Hit any key to stop autoboot:  0


$ printenv
bootdelay=2
baudrate=115200
autoload=n
bootfile="uImage"
load_nand=nboot 61000000 0 440000
boot=bootm 61000000
boot_nand=run load_nand boot
MODEL_ID=AB03
PRODUCT_NAME=STG-212
VENDOR_NAME=MitraStar Technology Corp.
ethaddr=00:11:41:30:3A:12
boot_openwrt=nand read 0x64000000 0x440000 0x90000 ; go 64000000
filesize=85390
fileaddr=64000000
netmask=255.255.0.0
ipaddr=192.168.50.100
serverip=192.168.50.59
boot_stage2=nand read 0x64000000 0x440000 0x90000 ; go 64000000
bootcmd=run boot_stage2
stdin=serial
stdout=serial
stderr=serial
bootargs= console=ttyS0,115200 elevator=cfq mac_adr=0x00,0x30,0xe0,0x00,0x00,0x01 mem=128M poweroutage=yes

Environment size: 639/131068 bytes


$ run boot_stage2

NAND read: device 0 offset 0x440000, size 0x90000
 589824 bytes read: OK
## Starting application at 0x64000000 ...


U-Boot 2014.10 (Dec 08 2017 - 09:01:13) for OXNAS

DRAM:  128 MiB
NAND:  128 MiB
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI: attached mtd1 (name "mtd=1", size 114 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: 911, bad PEBs: 1, corrupted PEBs: 0
UBI: user volume: 5, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 76/43, WL threshold: 4096, image sequence number: 1342704460
UBI: available PEBs: 0, total reserved PEBs: 911, PEBs reserved for bad PEB handling: 19
In:    serial
Out:   serial
Err:   serial
Net:   dwmac.40400000
IDE:   SATA PHY not ready for device 0
SATA PHY not ready for device 1
ide_preinit failed
Hit any key to stop autoboot:  0


OX820 # printenv
autoload=no
baudrate=115200
boot_dhcp=run load_kernel_dhcp && run boot_kernel;
boot_kernel=bootm 0x62000000;
boot_openwrt=nand read 0x62000000 0x42000000 0x90000 ; go 62000000
boot_rescue=run load_kernel_rescue && run boot_kernel;
boot_stage2=nand read 64000000 440000 90000; go 64000000
boot_ubi=run load_kernel_ubi && run boot_kernel;
bootargs=console=ttyS0,115200n8 earlyprintk=serial
bootcmd=run boot_stage2
bootdelay=1
console=console=ttyS0,115200n8 earlyprintk=serial
ethact=dwmac.40400000
ethaddr=00:25:31:01:66:5F
fileaddr=64000000
filesize=420000
ipaddr=192.168.50.100
load_kernel_dhcp=dhcp 0x62000000 oxnas-rescue.bin;
load_kernel_rescue=nand read 0x62000000 0x4e0000 0x400000;
load_kernel_ubi=ubi readvol 0x62000000 kernel;
mtdids=nand0=41000000.nand
mtdparts=mtdparts=41000000.nand:14m(boot),-(data)
normalboot=run boot_ubi; run boot_rescue; run boot_dhcp;
serverip=192.168.50.59
stderr=serial
stdin=serial
stdout=serial

Environment size: 988/16379 bytes


OX820 # run boot_ubi
Read 0 bytes from volume kernel to 62000000
No size specified -> Using max size (1806336)
## Loading kernel from FIT Image at 62000000 ...
   Using 'config@1' configuration
   Trying 'kernel@1' kernel subimage
     Description:  ARM OpenWrt Linux-3.14.26
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x620000e4
     Data Size:    1722608 Bytes = 1.6 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x60008000
     Entry Point:  0x60008000
     Hash algo:    crc32
     Hash value:   6611a8c8
     Hash algo:    sha1
     Hash value:   490849128e3c6fafd1fc54d5284bd978e626bcbc
   Verifying Hash Integrity ... crc32+ sha1+ OK
## Loading fdt from FIT Image at 62000000 ...
   Using 'config@1' configuration
   Trying 'fdt@1' fdt subimage
     Description:  ARM OpenWrt pogoplug-pro device tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x621a4b0c
     Data Size:    6993 Bytes = 6.8 KiB
     Architecture: ARM
     Hash algo:    crc32
     Hash value:   15dce0d6
     Hash algo:    sha1
     Hash value:   08c70cb4db38f437b6000b26305b49052be3345a
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Booting using the fdt blob at 0x621a4b0c
   Loading Kernel Image ... OK
   Loading Device Tree to 67e1d000, end 67e21b50 ... OK

Starting kernel ...

Uncompressing Linux...

XZ-compressed data is corrupt

 -- System halted

Any help much appreciated! I'm able to tftp via LAN and already managed to flash and rescue like 4 years ago after compiling my own openwrt for that device, but almost forgot everything in the last 4 years... :-/ THX i.a.!
Re: revive Medion oxnas stg-212
March 14, 2018 05:40AM
alexinc,

I am familiar with OXNAS. But we are only dealing with Debian here. Your problem is OpenWRT related.

If you are looking for new uboot, you might want to take a look to see if you can use it:
https://forum.doozan.com/read.php?3,16017

However, I dont recall your box was specifically tested or has been proven to work. So keep that in mind. I dont know if it will work.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: revive Medion oxnas stg-212
March 14, 2018 06:27AM
First of all thanks for replying.

Yeah, i was was studying this thread about new u-boot too, but i guess the problem isn't u-boot related, as i can "work" in original u-boot (stage1) and updated u-boot (stage2) as expected, but then my knowledge exceeds. I fear my problem may be related to partitioning nand the correct way as if i recall rightly, cat /proc/mtd doesn't result in showing any mtds which was the case before (i have to check that again tonight). And if i'm not wrong kernel and linux stuff needs to be uncompressed in it's pre-defined mountings? That's why i hoped you could somehow advice me how to structure nand the way linux may need to start in first place (well, i'm still hoping that initializing linux may be distro-independent!?)... ;-)

All tutorials i found were starting from working mount points and folder structures, i guess i'm at that point of having to adress that mountings first? As even booting from tftp is working but fails on uncompressing too... I somehow have to find the correct env and nand write parameters. (thats what i hope for, can't imagine to have a fully bricked device yet).
Re: revive Medion oxnas stg-212
March 14, 2018 01:05PM
alexinc,

As I said, we are basically a Debian forum, so I can't be certain what's wrong. But I could answer some of your questions.

> I fear my problem
> may be related to partitioning nand the correct
> way as if i recall rightly, cat /proc/mtd doesn't
> result in showing any mtds which was the case
> before (i have to check that again tonight).

You might be right. It seems either your image was corrupted, or you are loading it from the wrong location.

Quote

Read 0 bytes from volume kernel to 62000000

> And
> if i'm not wrong kernel and linux stuff needs to
> be uncompressed in it's pre-defined mountings?
> That's why i hoped you could somehow advice me how
> to structure nand the way linux may need to start
> in first place (well, i'm still hoping that
> initializing linux may be distro-independent!?)

Not independent. For many Linux distros such as Debian, Ubuntu, Arch, the loading and starting are very similar.

However, OpenWrt is quite different. It has setup in its own way and starting kernel from NAND. The problem you have is not even related to Linux starting. The image was simply not usable, so the initialization has not happened yet.


> (thats what i hope for, can't imagine to have a
> fully bricked device yet).

Not bricked at all :) as long as you can boot to the u-boot prompt, it is fully operational. Just the kernel image is the problem.

Let see if I can tell more. Please do the folowing,

Stop u-boot at the countdown in the 2nd stage:
U-Boot 2014.10 (Dec 08 2017 - 09:01:13) for OXNAS

DRAM:  128 MiB
NAND:  128 MiB
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI: attached mtd1 (name "mtd=1", size 114 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: 911, bad PEBs: 1, corrupted PEBs: 0
UBI: user volume: 5, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 76/43, WL threshold: 4096, image sequence number: 1342704460
UBI: available PEBs: 0, total reserved PEBs: 911, PEBs reserved for bad PEB handling: 19
In:    serial
Out:   serial
Err:   serial
Net:   dwmac.40400000
IDE:   SATA PHY not ready for device 0
SATA PHY not ready for device 1
ide_preinit failed
Hit any key to stop autoboot:  0
and

printenv bootargs
printenv
mtdparts
boot

And post the entire serial console log here.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 03/14/2018 01:07PM by bodhi.
Re: revive Medion oxnas stg-212
March 14, 2018 01:32PM
once again a really BIG THX for spending your time on this!

OX820 # printenv bootargs
bootargs=console=ttyS0,115200n8 earlyprintk=serial

OX820 # printenv
/proc/mtd=exit
autoload=no
baudrate=115200
boot_dhcp=run load_kernel_dhcp && run boot_kernel;
boot_kernel=bootm 0x62000000;
boot_openwrt=nand read 0x62000000 0x42000000 0x90000 ; go 62000000
boot_rescue=run load_kernel_rescue && run boot_kernel;
boot_stage2=nand read 64000000 440000 90000; go 64000000
boot_ubi=run load_kernel_ubi && run boot_kernel;
bootargs=console=ttyS0,115200n8 earlyprintk=serial
bootcmd=run boot_stage2
bootdelay=1
console=console=ttyS0,115200n8 earlyprintk=serial
ethact=dwmac.40400000
ethaddr=00:25:31:01:66:5F
fileaddr=64000000
filesize=420000
ipaddr=192.168.50.100
load_kernel_dhcp=dhcp 0x62000000 oxnas-rescue.bin;
load_kernel_rescue=nand read 0x62000000 0x4e0000 0x400000;
load_kernel_ubi=ubi readvol 0x62000000 kernel;
mtdids=nand0=41000000.nand
mtdparts=mtdparts=41000000.nand:14m(boot),-(data)
nand_erasesize=20000
nand_oobsize=40
nand_writesize=800
normalboot=run boot_ubi; run boot_rescue; run boot_dhcp;
serverip=192.168.50.59
stderr=serial
stdin=serial
stdout=serial

Environment size: 1067/16379 bytes

OX820 # mtdparts

device nand0 <41000000.nand>, # parts = 2
 #: name                size            offset          mask_flags
 0: boot                0x00e00000      0x00000000      0
 1: data                0x07200000      0x00e00000      0

active partition: nand0,0 - (boot) 0x00e00000 @ 0x00000000

defaults:
mtdids  : nand0=41000000.nand
mtdparts: mtdparts=41000000.nand:14m(boot),-(ubi)

OX820 # boot

NAND read: device 0 offset 0x440000, size 0x90000
 589824 bytes read: OK
## Starting application at 0x64000000 ...


U-Boot 2014.10 (Dec 08 2017 - 09:01:13) for OXNAS

DRAM:  128 MiB
NAND:  128 MiB
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI: attached mtd1 (name "mtd=1", size 114 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: 911, bad PEBs: 1, corrupted PEBs: 0
UBI: user volume: 5, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 76/43, WL threshold: 4096, image sequence number: 1342704460
UBI: available PEBs: 0, total reserved PEBs: 911, PEBs reserved for bad PEB handling: 19
In:    serial
Out:   serial
Err:   serial
Net:   dwmac.40400000
IDE:   SATA PHY not ready for device 0
SATA PHY not ready for device 1
ide_preinit failed
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x440000, size 0x90000
 589824 bytes read: OK

"boot" runs into bootloop of boot_stage2...

:-)
Re: revive Medion oxnas stg-212
March 15, 2018 02:13PM
alexinc.

Sorry I had used the wrong command! please try again:

printenv bootargs
printenv
mtdparts
run boot_ubi

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: revive Medion oxnas stg-212
March 15, 2018 04:15PM
No problem! :-) Whatever you are asking for... ;-)

Stage-1 Bootloader Thu Nov 24 19:20:59 CST 2011
Attempting to set PLLA to 750MHz ...
  plla_ctrl0 : 0x0000000A
  plla_ctrl1 : 0x000F0000
  plla_ctrl2 : 0x001D01A0
  plla_ctrl3 : 0x00000017
PLLA Set

Setup memory, testing, Image 0
  Hdr len: 0x0001A94C
  Hdr CRC: 0xF0019DAC
 OK


U-Boot 1.1.2 (Jun 24 2011 - 09:41:57)

U-Boot code: 60D00000 -> 60D1A94C  BSS: -> 60D1F004
RAM Configuration:
        Bank #0: 60000000 128 MB
SRAM Configuration:
        64KB at 0x50000000
NAND:128 MiB
In:    serial
Out:   serial
Err:   serial
Setting Linux mem= boot arg value
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x440000, size 0x90000
 589824 bytes read: OK
## Starting application at 0x64000000 ...


U-Boot 2014.10 (Dec 08 2017 - 09:01:13) for OXNAS

DRAM:  128 MiB
NAND:  128 MiB
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI: attached mtd1 (name "mtd=1", size 114 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: 911, bad PEBs: 1, corrupted PEBs: 0
UBI: user volume: 5, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 76/43, WL threshold: 4096, image sequence number: 1342704460
UBI: available PEBs: 0, total reserved PEBs: 911, PEBs reserved for bad PEB handling: 19
In:    serial
Out:   serial
Err:   serial
Net:   dwmac.40400000
IDE:   SATA PHY not ready for device 0
SATA PHY not ready for device 1
ide_preinit failed
Hit any key to stop autoboot:  0
OX820 # printenv bootargs
bootargs=console=ttyS0,115200n8 earlyprintk=serial
OX820 # printenv
autoload=no
baudrate=115200
boot_dhcp=run load_kernel_dhcp && run boot_kernel;
boot_kernel=bootm 0x62000000;
boot_openwrt=nand read 0x62000000 0x42000000 0x90000 ; go 62000000
boot_rescue=run load_kernel_rescue && run boot_kernel;
boot_stage2=nand read 64000000 440000 90000; go 64000000
boot_ubi=run load_kernel_ubi && run boot_kernel;
bootargs=console=ttyS0,115200n8 earlyprintk=serial
bootcmd=run boot_stage2
bootdelay=1
console=console=ttyS0,115200n8 earlyprintk=serial
ethact=dwmac.40400000
ethaddr=00:25:31:01:66:5F
fileaddr=64000000
filesize=420000
ipaddr=192.168.50.100
load_kernel_dhcp=dhcp 0x62000000 oxnas-rescue.bin;
load_kernel_rescue=nand read 0x62000000 0x4e0000 0x400000;
load_kernel_ubi=ubi readvol 0x62000000 kernel;
mtdids=nand0=41000000.nand
mtdparts=mtdparts=41000000.nand:14m(boot),-(data)
normalboot=run boot_ubi; run boot_rescue; run boot_dhcp;
serverip=192.168.50.59
stderr=serial
stdin=serial
stdout=serial

Environment size: 988/16379 bytes
OX820 # mtdparts

device nand0 <41000000.nand>, # parts = 2
 #: name                size            offset          mask_flags
 0: boot                0x00e00000      0x00000000      0
 1: data                0x07200000      0x00e00000      0

active partition: nand0,0 - (boot) 0x00e00000 @ 0x00000000

defaults:
mtdids  : nand0=41000000.nand
mtdparts: mtdparts=41000000.nand:14m(boot),-(ubi)
OX820 # run boot_ubi
Read 0 bytes from volume kernel to 62000000
No size specified -> Using max size (1806336)
## Loading kernel from FIT Image at 62000000 ...
   Using 'config@1' configuration
   Trying 'kernel@1' kernel subimage
     Description:  ARM OpenWrt Linux-3.14.26
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x620000e4
     Data Size:    1722608 Bytes = 1.6 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x60008000
     Entry Point:  0x60008000
     Hash algo:    crc32
     Hash value:   6611a8c8
     Hash algo:    sha1
     Hash value:   490849128e3c6fafd1fc54d5284bd978e626bcbc
   Verifying Hash Integrity ... crc32+ sha1+ OK
## Loading fdt from FIT Image at 62000000 ...
   Using 'config@1' configuration
   Trying 'fdt@1' fdt subimage
     Description:  ARM OpenWrt pogoplug-pro device tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x621a4b0c
     Data Size:    6993 Bytes = 6.8 KiB
     Architecture: ARM
     Hash algo:    crc32
     Hash value:   15dce0d6
     Hash algo:    sha1
     Hash value:   08c70cb4db38f437b6000b26305b49052be3345a
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Booting using the fdt blob at 0x621a4b0c
   Loading Kernel Image ... OK
   Loading Device Tree to 67e1d000, end 67e21b50 ... OK

Starting kernel ...

Uncompressing Linux...

XZ-compressed data is corrupt

 -- System halted

Re: revive Medion oxnas stg-212
March 15, 2018 05:02PM
alexinc,

Repeat the same boot with these commands.

printenv bootargs
printenv
mtdparts
ubi part ubi
ubi info
ubi check kernel

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: revive Medion oxnas stg-212
March 15, 2018 05:15PM
Stage-1 Bootloader Thu Nov 24 19:20:59 CST 2011
Attempting to set PLLA to 750MHz ...
  plla_ctrl0 : 0x0000000A
  plla_ctrl1 : 0x000F0000
  plla_ctrl2 : 0x001D01A0
  plla_ctrl3 : 0x00000017
PLLA Set

Setup memory, testing, Image 0
  Hdr len: 0x0001A94C
  Hdr CRC: 0xF0019DAC
 OK


U-Boot 1.1.2 (Jun 24 2011 - 09:41:57)

U-Boot code: 60D00000 -> 60D1A94C  BSS: -> 60D1F004
RAM Configuration:
        Bank #0: 60000000 128 MB
SRAM Configuration:
        64KB at 0x50000000
NAND:128 MiB
In:    serial
Out:   serial
Err:   serial
Setting Linux mem= boot arg value
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x440000, size 0x90000
 589824 bytes read: OK
## Starting application at 0x64000000 ...


U-Boot 2014.10 (Dec 08 2017 - 09:01:13) for OXNAS

DRAM:  128 MiB
NAND:  128 MiB
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI: attached mtd1 (name "mtd=1", size 114 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: 911, bad PEBs: 1, corrupted PEBs: 0
UBI: user volume: 5, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 76/43, WL threshold: 4096, image sequence number: 1342704460
UBI: available PEBs: 0, total reserved PEBs: 911, PEBs reserved for bad PEB handling: 19
In:    serial
Out:   serial
Err:   serial
Net:   dwmac.40400000
IDE:   SATA PHY not ready for device 0
SATA PHY not ready for device 1
ide_preinit failed
Hit any key to stop autoboot:  0
OX820 #
reset
resetting ...
Stage-1 Bootloader Thu Nov 24 19:20:59 CST 2011
Attempting to set PLLA to 750MHz ...
  plla_ctrl0 : 0x0000000A
  plla_ctrl1 : 0x000F0000
  plla_ctrl2 : 0x001D01A0
  plla_ctrl3 : 0x00000017
PLLA Set

Setup memory, testing, Image 0
  Hdr len: 0x0001A94C
  Hdr CRC: 0xF0019DAC
 OK


U-Boot 1.1.2 (Jun 24 2011 - 09:41:57)

U-Boot code: 60D00000 -> 60D1A94C  BSS: -> 60D1F004
RAM Configuration:
        Bank #0: 60000000 128 MB
SRAM Configuration:
        64KB at 0x50000000
NAND:128 MiB
In:    serial
Out:   serial
Err:   serial
Setting Linux mem= boot arg value
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x440000, size 0x90000
 589824 bytes read: OK
## Starting application at 0x64000000 ...


U-Boot 2014.10 (Dec 08 2017 - 09:01:13) for OXNAS

DRAM:  128 MiB
NAND:  128 MiB
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI: attached mtd1 (name "mtd=1", size 114 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: 911, bad PEBs: 1, corrupted PEBs: 0
UBI: user volume: 5, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 76/43, WL threshold: 4096, image sequence number: 1342704460
UBI: available PEBs: 0, total reserved PEBs: 911, PEBs reserved for bad PEB handling: 19
In:    serial
Out:   serial
Err:   serial
Net:   dwmac.40400000
IDE:   SATA PHY not ready for device 0
SATA PHY not ready for device 1
ide_preinit failed
Hit any key to stop autoboot:  0
OX820 # printenv bootargs
bootargs=console=ttyS0,115200n8 earlyprintk=serial
OX820 # printenv
autoload=no
baudrate=115200
boot_dhcp=run load_kernel_dhcp && run boot_kernel;
boot_kernel=bootm 0x62000000;
boot_openwrt=nand read 0x62000000 0x42000000 0x90000 ; go 62000000
boot_rescue=run load_kernel_rescue && run boot_kernel;
boot_stage2=nand read 64000000 440000 90000; go 64000000
boot_ubi=run load_kernel_ubi && run boot_kernel;
bootargs=console=ttyS0,115200n8 earlyprintk=serial
bootcmd=run boot_stage2
bootdelay=1
console=console=ttyS0,115200n8 earlyprintk=serial
ethact=dwmac.40400000
ethaddr=00:25:31:01:66:5F
fileaddr=64000000
filesize=420000
ipaddr=192.168.50.100
load_kernel_dhcp=dhcp 0x62000000 oxnas-rescue.bin;
load_kernel_rescue=nand read 0x62000000 0x4e0000 0x400000;
load_kernel_ubi=ubi readvol 0x62000000 kernel;
mtdids=nand0=41000000.nand
mtdparts=mtdparts=41000000.nand:14m(boot),-(data)
normalboot=run boot_ubi; run boot_rescue; run boot_dhcp;
serverip=192.168.50.59
stderr=serial
stdin=serial
stdout=serial

Environment size: 988/16379 bytes
OX820 # mtdparts

device nand0 <41000000.nand>, # parts = 2
 #: name                size            offset          mask_flags
 0: boot                0x00e00000      0x00000000      0
 1: data                0x07200000      0x00e00000      0

active partition: nand0,0 - (boot) 0x00e00000 @ 0x00000000

defaults:
mtdids  : nand0=41000000.nand
mtdparts: mtdparts=41000000.nand:14m(boot),-(ubi)
OX820 # ubi part ubi
UBI: detaching mtd1 from ubi0
UBI: mtd1 is detached from ubi0
incorrect device type in ubi
Partition ubi not found!
OX820 # ubi info
UBI: MTD device name:            ""
UBI: MTD device size:            114 MiB
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: number of good PEBs:        911
UBI: number of bad PEBs:         1
UBI: smallest flash I/O unit:    2048
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     5
UBI: available PEBs:             0
UBI: total number of reserved PEBs: 911
UBI: number of PEBs reserved for bad PEB handling: 19
UBI: max/mean erase counter: 76/43
OX820 # ubi check kernel
exit not allowed from main input shell.
OX820 #

Re: revive Medion oxnas stg-212
March 15, 2018 06:38PM
alexinc,

So your mtdparts env is wrong at the time the kernel is loaded:

OX820 # printenv
...
mtdparts=mtdparts=41000000.nand:14m(boot),-(data)

....

OX820 # mtdparts

device nand0 <41000000.nand>, # parts = 2
 #: name                size            offset          mask_flags
 0: boot                0x00e00000      0x00000000      0
 1: data                0x07200000      0x00e00000      0
.......

It should look like this:
mtdparts: mtdparts=41000000.nand:14m(boot),-(ubi)

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: revive Medion oxnas stg-212
March 16, 2018 02:28AM
So at 2nd stage boot,

U-Boot 2014.10 (Dec 08 2017 - 09:01:13) for OXNAS

DRAM:  128 MiB
NAND:  128 MiB
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI: attached mtd1 (name "mtd=1", size 114 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: 911, bad PEBs: 1, corrupted PEBs: 0
UBI: user volume: 5, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 76/43, WL threshold: 4096, image sequence number: 1342704460
UBI: available PEBs: 0, total reserved PEBs: 911, PEBs reserved for bad PEB handling: 19
In:    serial
Out:   serial
Err:   serial
Net:   dwmac.40400000
IDE:   SATA PHY not ready for device 0
SATA PHY not ready for device 1
ide_preinit failed
Hit any key to stop autoboot:  0

You could try to set that mtdparts to

setenv mtdparts 'mtdparts=41000000.nand:14m(boot),-(ubi)'

and then

boot
To see if it boots normally to LEDE.

However, this is suspected. That's what caused to boot loop.

bootcmd=run boot_stage2

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 03/16/2018 02:31AM by bodhi.
Re: revive Medion oxnas stg-212
March 16, 2018 02:34AM
That may answer my next question, i was already googling on how to do that. ;-) Will try ASAP after work and get back to you. Thanks again so far. :-)

So bootcmd should be set to
bootcmd=run boot_ubi
then?



Edited 1 time(s). Last edit at 03/16/2018 02:40AM by alexinc.
Re: revive Medion oxnas stg-212
March 16, 2018 11:47AM
Still no success (or as expected)...

OX820 # setenv mtdparts 'mtdparts=41000000.nand:14m(boot),-(ubi)'
OX820 # boot
leads to bootloop of stage2 and
OX820 # setenv mtdparts 'mtdparts=41000000.nand:14m(boot),-(ubi)'
OX820 # run boot_ubi
to
Read 0 bytes from volume kernel to 62000000
No size specified -> Using max size (1806336)
## Loading kernel from FIT Image at 62000000 ...
   Using 'config@1' configuration
   Trying 'kernel@1' kernel subimage
     Description:  ARM OpenWrt Linux-3.14.26
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x620000e4
     Data Size:    1722608 Bytes = 1.6 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x60008000
     Entry Point:  0x60008000
     Hash algo:    crc32
     Hash value:   6611a8c8
     Hash algo:    sha1
     Hash value:   490849128e3c6fafd1fc54d5284bd978e626bcbc
   Verifying Hash Integrity ... crc32+ sha1+ OK
## Loading fdt from FIT Image at 62000000 ...
   Using 'config@1' configuration
   Trying 'fdt@1' fdt subimage
     Description:  ARM OpenWrt pogoplug-pro device tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x621a4b0c
     Data Size:    6993 Bytes = 6.8 KiB
     Architecture: ARM
     Hash algo:    crc32
     Hash value:   15dce0d6
     Hash algo:    sha1
     Hash value:   08c70cb4db38f437b6000b26305b49052be3345a
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Booting using the fdt blob at 0x621a4b0c
   Loading Kernel Image ... OK
   Loading Device Tree to 67e1d000, end 67e21b50 ... OK

Starting kernel ...

Uncompressing Linux...

XZ-compressed data is corrupt

 -- System halted
again. :-(

i guess the answer may be somewhere in between comparing the original and openwrt env found here: https://openwrt.org/toh/medion/md86587 ? As i can see working openwrt bootlog has
Read 0 bytes from volume kernel to 62000000
in it too!? The following may be the way i setup the oxnas like 4 years ago, but how to get /dev/mtd4 and temporary folder for storing the itb back also cat command doesn't seem to work?

"After logging in, download the OpenWRT image to /tmp/tmpfs. Look in /proc/mtd and make sure kernel is in /dev/mtd4. Write the image to /dev/mtd4, tell U-Boot to boot from it, and reboot.

cd /tmp/tmpfs wget http://(server IP)/openwrt-oxnas-stg212-u-boot-initramfs.itb
cat /proc/mtd 
nandwrite /dev/mtd4 openwrt-oxnas-stg212-u-boot-initramfs.itb 
fw_setenv boot_stage2 nand read 64000000 440000 90000\\; go 64000000
fw_setenv bootcmd run boot_stage2 reboot
This is where the serial connection comes in handy, for watching the boot process. If everything went well LUCI, OpenWRT's web interface should be available on the NAS on address 192.168.1.1. When you have compiled a new OpenWRT image you can flash it, by using LUCI."
Re: revive Medion oxnas stg-212
March 16, 2018 02:44PM
alexinc,

We should move your thread to the Rescue subforum. It is now a OpenWrt problem (not a u-boot problem).

I do think you need to reinstall OpenWrt. Do you have any data on its rootfs that you want to save?

In the Rescue subforum, there are different OpenWrt/LEDE threads that discuss this topic (no Medion OXNAS topic yet). You could look and see how others install their Kirkwood boxes.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 03/16/2018 02:46PM by bodhi.
Re: revive Medion oxnas stg-212
March 16, 2018 03:22PM
I'm up for everything, as i wanted to reinstall OpenWRT anyways. ;-) All important data is stored on HDD which isn't installed now anyways for security reasons... I already tried to read everything i could, but still didn't find a working path to start from. I expected starting a boot-image from tftp would solve my problems and re-partitioning or re-mount everything the way it needs to be for a new install, till now i didn't succeed. :-/
Re: revive Medion oxnas stg-212
March 16, 2018 04:25PM
I think what I want to do here is to setup the installation the same way for OXNAS as for Kirkwood. I know habibie has been asking about this issue.

Perhaps habibie can tell us how it was installed on Pogo Pro?

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: revive Medion oxnas stg-212
March 19, 2018 03:08AM
I'm up for everything, nothing to loose. ;-) Hopefully habibie somehow jumps on the train and wants to contribute a bit!? :-)
Re: revive Medion oxnas stg-212
April 10, 2018 08:42PM
alexinc,

Let see if I can test the installation on the Pogo Pro when I have time, in a few days.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: revive Medion oxnas stg-212
April 11, 2018 01:28AM
Hey bodhi,

let me know if i can provide anything. Did have some other projects, so time is our friend, but at openwrt forum no one replied yet...

thanks again!

alex
Re: revive Medion oxnas stg-212
April 13, 2018 09:47PM
alexinc,

Let see if you can boot with RAM version and then you decide how to go from there.

Download this file to the top folder of a USB drive (formatted as Ext3):

lede-17.01.4-oxnas-stg212-u-boot-initramfs.bin

Power up, interrupt serial console at the 1st stage u-boot (I think the 2nd stage is also work). And then setenv to boot.

usb start
setenv mtdparts 'mtdparts=41000000.nand:14m(boot),-(ubi)'
setenv bootargs 'console=ttyS0,115200 $mtdparts'
ext2load usb 0:1 0x64000000 lede-17.01.4-oxnas-stg212-u-boot-initramfs.bin
go 0x64000000

-bodhi
===========================
Forum Wiki
bodhi's corner
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: