Welcome! Log In Create A New Profile

Advanced

revive Medion oxnas stg-212

Posted by alexinc 
revive Medion oxnas stg-212
March 14, 2018 05: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 06: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 (buy bodhi a beer)
Re: revive Medion oxnas stg-212
March 14, 2018 07: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 02: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 (buy bodhi a beer)



Edited 1 time(s). Last edit at 03/14/2018 02:07PM by bodhi.
Re: revive Medion oxnas stg-212
March 14, 2018 02: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 03: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 (buy bodhi a beer)
Re: revive Medion oxnas stg-212
March 15, 2018 05: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 06: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 (buy bodhi a beer)
Re: revive Medion oxnas stg-212
March 15, 2018 06: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 07: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 (buy bodhi a beer)
Re: revive Medion oxnas stg-212
March 16, 2018 03: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 (buy bodhi a beer)



Edited 1 time(s). Last edit at 03/16/2018 03:31AM by bodhi.
Re: revive Medion oxnas stg-212
March 16, 2018 03: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 03:40AM by alexinc.
Re: revive Medion oxnas stg-212
March 16, 2018 12:47PM
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 03: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 (buy bodhi a beer)



Edited 1 time(s). Last edit at 03/16/2018 03:46PM by bodhi.
Re: revive Medion oxnas stg-212
March 16, 2018 04: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 05: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 (buy bodhi a beer)
Re: revive Medion oxnas stg-212
March 19, 2018 04: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 09: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 (buy bodhi a beer)
Re: revive Medion oxnas stg-212
April 11, 2018 02: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 10: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 (buy bodhi a beer)
Re: revive Medion oxnas stg-212
November 03, 2022 12:31AM
Wow, 4 more years i came across my still bricked device and this forum with all it's documentation again. quite a lot happened since then and i'm reading reading reading... still feeling the challenge to make it work again one day. anyone up for starting this journey once again?

for now i only can boot to:
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

Loading from device 0: 128MiB 3,3V 8-bit (offset 0x440000)

** Bad Magic Number 0xea0000be **
## Booting image at 60000000 ...
Bad Magic Number
$
or can interrupt boot with having the following commands available:
$ help
?       - alias for 'help'
base    - print or set address offset
bdinfo  - print Board Info structure
bootm   - boot application image from memory
bootp   - boot image via network using BootP/TFTP protocol
cmp     - memory compare
cp      - memory copy
crc32   - checksum calculation
echo    - echo args to console
exit    - exit script
go      - start application at address 'addr'
help    - print online help
iminfo  - print header information for application image
ledfail - Extinguish (0) or light (1) failure LED
loop    - infinite loop on address range
md      - memory display
mm      - memory modify (auto-incrementing)
mtest   - simple RAM test
mw      - memory write (fill)
nand    - NAND sub-system
nboot   - boot from NAND device
nm      - memory modify (constant address)
nwboot          - NAND Write boot information
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
version - print monitor version
$
so no
usb start
or
ext2load usb 0:1 0x64000000 lede-17.01.4-oxnas-stg212-u-boot-initramfs.bin
for now.

bodhi Wrote:
-------------------------------------------------------
> 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
>

many many thanks i.a.!
Re: revive Medion oxnas stg-212
November 03, 2022 12:53PM
alexinc,

Boot with tftp.

Download:

https://downloads.openwrt.org/releases/22.03.0-rc6/targets/oxnas/ox820/openwrt-22.03.0-rc6-oxnas-ox820-mitrastar_stg-212-initramfs-uImage

And place it in the /tftproot

Power up, interrupt serial console and
setenv mtdparts 'mtdparts=41000000.nand:14m(boot),-(ubi)'
setenv bootargs 'console=ttyS0,115200 $mtdparts'
tftpboot 0x64000000 openwrt-22.03.0-rc6-oxnas-ox820-mitrastar_stg-212-initramfs-uImage
bootm 0x64000000

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: revive Medion oxnas stg-212
November 05, 2022 02:31AM
hola bodhi,

and first of all a big thanks for jumping with me on that train again. slowly i'm getting into it all again (tftp, firewall rules, etc...) and managed to transfer initramfs into nand. for now it hangs at "starting kernel..." (guess it's not related to using the latest stable 22.03.2 image?)

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
$ setenv mtdparts 'mtdparts=41000000.nand:14m(boot),-(ubi)'
$ setenv bootargs 'console=ttyS0,115200 $mtdparts'
$ tftpboot 0x64000000 openwrt-22.03.2-oxnas-ox820-mitrastar_stg-212-initramfs-uImage
Wait GMAC to reset
Wait for PHY reset.
PHY is Realtek RTL8211E
Wait for link to come up...........Link up
Wait for auto-negotiation to complete
Link is 1000M
TFTP from server 192.168.50.2; our IP address is 192.168.50.1
Filename 'openwrt-22.03.2-oxnas-ox820-mitrastar_stg-212-initramfs-uImage'.
Load address: 0x64000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###
done
Bytes transferred = 7668789 (750435 hex)
$ bootm 0x64000000
## Booting image at 64000000 ...
   Image Name:   ARM OpenWrt Linux-5.10.146
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    7668725 Bytes =  7.3 MB
   Load Address: 60008000
   Entry Point:  60008000
   Verifying Checksum ... OK
OK

Starting kernel ...
seems like i'm running in circles. even tried to recover with flash-hdd (https://github.com/jedie/NAS7820-Tools) now (like i already tried years before) without success. :-/
$ Stage-1 Bootloader Mon Nov 14 22:17:29 EST 2011
Attempting to set PLLA to 725MHz ...
  plla_ctrl0 : 0x0000011A
  plla_ctrl1 : 0x003A0000
  plla_ctrl2 : 0x007300D0
  plla_ctrl3 : 0x000000B6
PLLA Set

Setup memory, testing
Reading disk 0, Image 0
  Sector : 0x0000009A
  Hdr len: 0x0001F854
  Hdr CRC: 0x55B449B2
 OK
Initialising disks
SATA PHY not ready for device 1
Detecting SATA busses:
Bus 0: Found first device OK
  Device 0: Model: ST1500DL003-9VT16L Firm: CC4A Ser#: 5YD5WQJS
            Type: Hard Disk
            Capacity: 131071.9 MB = 127.9 GB (268435455 x 512)
  Device 1: not available
Failed to read valid environment from disk, using built-in default


U-Boot 1.1.2 (Dec 30 2011 - 14:55:54)

U-Boot code: 60D00000 -> 60D1F854  BSS: -> 60D24074
RAM Configuration:
        Bank #0: 60000000 128 MB
SRAM Configuration:
        64KB at 0x50000000
NAND:128 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Setting Linux mem= boot arg value

IDE read: device 0 block # 288, count 1 ... 1 blocks read: OK
Hit any key to stop autoboot:  0

IDE device 0: Model: ST1500DL003-9VT16L Firm: CC4A Ser#: 5YD5WQJS
            Type: Hard Disk
            Capacity: 131071.9 MB = 127.9 GB (268435455 x 512)
... is now current device

IDE read: device 0 block # 1290, count 10152 ... 10152 blocks read: OK
## Booting image at 60500000 ...
Bad Magic Number

IDE device 0: Model: ST1500DL003-9VT16L Firm: CC4A Ser#: 5YD5WQJS
            Type: Hard Disk
            Capacity: 131071.9 MB = 127.9 GB (268435455 x 512)
... is now current device

IDE read: device 0 block # 58344, count 10152 ... 10152 blocks read: OK
## Booting image at 60500000 ...
Bad Magic Number
Light LED

IDE device 1: not available
Light LED

IDE device 1: not available
Unknown command 'lightled' - try 'help'
$ printenv
bootcmd=run select0 load boot || run select0 load2 boot || run lightled select1 load extinguishled boot || run lightled select1 load2 extinguishled boot || lightled
bootdelay=2
baudrate=115200
ethaddr=00:30:e0:00:00:01
ipaddr=192.168.50.100
serverip=192.168.50.59
autoload=n
netmask=255.255.0.0
bootfile="uImage"
select0=ide dev 0
select1=ide dev 1
load=ide read 0x60500000 50a 27a8
load2=ide read 0x60500000 e3e8 27a8
lightled=ledfail 1
extinguishled=ledfail 0
boot=bootm 60500000
stdin=serial
stdout=serial
stderr=serial
bootargs=root=/dev/sda1 console=ttyS0,115200 elevator=cfq mac_adr=0x00,0x30,0xe0,0x00,0x00,0x01 mem=128M poweroutage=yes

Environment size: 644/8188 bytes
$
first of all i think i have to clean the mess in environment?
$ 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
boot_stage2=nand read 0x64000000 0x440000 0x90000 ; go 64000000
serverip=192.168.50.2
ipaddr=192.168.50.1
bootcmd=nboot 60500000 0 440000; bootm
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: 651/131068 bytes
$
load_nand=nboot 61000000 0 440000
bootcmd=nboot 60500000 0 440000; bootm
boot=bootm 61000000
boot_openwrt=nand read 0x64000000 0x440000 0x90000 ; go 64000000
boot_stage2=nand read 0x64000000 0x440000 0x90000 ; go 64000000
...looks quite messy, although i don't understand when booting from tftp these envs shouldn't matter anyways?



Edited 2 time(s). Last edit at 11/05/2022 06:36AM by alexinc.
Re: revive Medion oxnas stg-212
November 05, 2022 01:21PM
alexinc,

Try booting Debian.

On another Linux box, use the kernel zImage in this tarball linux-5.4.210-oxnas-tld-1.bodhi.tar.bz2 and append the DTB.

cp -a zImage-5.4.210-oxnas-tld-1 zImage.fdt
cat dts/ox820-stg212.dtb >> zImage.fdt
mkimage -A arm -O linux -T kernel -C none -a 0x60008000 -e 0x60008000 -n Linux-5.4.210-oxnas-tld-1 -d zImage.fdt uImage


And boot the same way

setenv mtdparts 'mtdparts=41000000.nand:14m(boot),-(ubi)'
setenv bootargs 'console=ttyS0,115200 $mtdparts'
tftpboot 0x64000000 uImage
bootm 0x64000000

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: revive Medion oxnas stg-212
November 06, 2022 01:36AM
$ setenv mtdparts 'mtdparts=41000000.nand:14m(boot),-(ubi)'
$ setenv bootargs 'console=ttyS0,115200 $mtdparts'
$ tftpboot 0x64000000 uImage
Wait GMAC to reset
Wait for PHY reset.
PHY is Realtek RTL8211E
Wait for link to come up..........Link up
Wait for auto-negotiation to complete
Link is 1000M
TFTP from server 192.168.50.59; our IP address is 192.168.50.100
Filename 'uImage'.
Load address: 0x64000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ######################################################
done
Bytes transferred = 5596715 (55662b hex)
$ bootm 0x64000000
## Booting image at 64000000 ...
   Image Name:   Linux-5.4.210-oxnas-tld-1
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5596651 Bytes =  5.3 MB
   Load Address: 60008000
   Entry Point:  60008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux...

uncompression error

 -- System halted
guess we're a little step further... ;-) not hanging at starting kernel anymore, but at compressing linux? :-D Seems like the error of my very first post? may i need to update u-boot somehow (all tutorials in here start from running systems)?



Edited 3 time(s). Last edit at 11/06/2022 01:12AM by alexinc.
Re: revive Medion oxnas stg-212
November 08, 2022 01:14PM
got a little further, after flashing stg212-u-boot-initramfs.bin from earlier version (https://archive.openwrt.org/chaos_calmer/15.05.1/oxnas/generic/). now i get into 2nd stage u-boot again with way more commands and options:
OX820 # help
?       - alias for 'help'
askenv  - get environment variables from stdin
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootelf - Boot from an ELF image in memory
bootm   - boot application image from memory
bootmenu- ANSI terminal bootmenu
bootp   - boot image via network using BOOTP/TFTP protocol
bootvx  - Boot vxWorks from an ELF image
chpart  - change active partition
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
dhcp    - boot image via network using DHCP/TFTP protocol
diskboot- boot from IDE device
echo    - echo args to console
editenv - edit environment variable
env     - environment handling commands
exit    - exit script
ext2load- load binary file from a Ext2 filesystem
ext2ls  - list files in a directory (default /)
ext4load- load binary file from a Ext4 filesystem
ext4ls  - list files in a directory (default /)
ext4size- determine a file's size
ext4write- create a file in the root directory
false   - do nothing, unsuccessfully
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fatsize - determine a file's size
fatwrite- write file into a dos filesystem
fdt     - flattened device tree utility commands
gettime - get timer val elapsed,

go      - start application at address 'addr'
grepenv - search environment variables
hash    - compute hash message digest
help    - print command description/usage
ide     - IDE sub-system
iminfo  - print header information for application image
imxtract- extract a part of a multi-image
ini     - parse an ini file in memory and merge the specified section into the env
itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loadx   - load binary file over serial line (xmodem mode)
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
md      - memory display
md5sum  - compute MD5 message digest
mdio    - MDIO utility commands
mii     - MII utility commands
mm      - memory modify (auto-incrementing address)
mtdparts- define flash/nand partitions
mw      - memory write (fill)
nand    - NAND sub-system
nboot   - boot from NAND device
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
pxe     - commands to get and boot from pxe files
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
setexpr - set environment variable as the result of eval expression
showvar - print local hushshell variables
sleep   - delay execution for some time
source  - run script from memory
sysboot - command to get and boot from syslinux files
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
time    - run commands and summarize execution time
true    - do nothing, successfully
ubi     - ubi commands
ubifsload- load file from an UBIFS filesystem
ubifsls - list files in a directory
ubifsmount- mount UBIFS volume
ubifsumount- unmount UBIFS volume
unzip   - unzip a memory region
usb     - USB sub-system
usbboot - boot from USB device
version - print monitor, compiler and linker version
zip     - zip a memory region
and following envs:
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;
mtddevname=boot
mtddevnum=0
mtdids=nand0=41000000.nand
mtdparts=mtdparts=41000000.nand:14m(boot),-(data)
normalboot=run boot_ubi; run boot_rescue; run boot_dhcp;
partition=nand0,0
serverip=192.168.50.59
stderr=serial
stdin=serial
stdout=serial

Environment size: 1040/16379 bytes
when trying to saveenv i'm getting:
OX820 #  saveenv
Saving Environment to UBI...
UBI: detaching mtd1 from ubi0
UBI: mtd1 is detached from ubi0
incorrect device type in ubi
Partition ubi not found!

** Cannot find mtd partition "ubi"
seems that back in the days nand was formatted/partitioned with ubi...
OX820 # ubi info
UBI: MTD device name:            "ubi"
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
there may be the culprit that kernels can't be extracted/decompressed?

the closest i'm getting for now by flashing stg212-fit-uImage-initramfs.itb:
OX820 # tftp 0x62000000 uImage-initramfs.itb
dwmac.40400000 Waiting for PHY auto negotiation to complete..... done
dwmac.40400000: No link.
OX820 # tftp 0x62000000 uImage-initramfs.itb
Speed: 1000, full duplex
Using dwmac.40400000 device
TFTP from server 192.168.50.59; our IP address is 192.168.50.100
Filename 'uImage-initramfs.itb'.
Load address: 0x62000000
Loading: #################################################################
         #################################################################
         #################################################################
         ####################
         4.6 MiB/s
done
Bytes transferred = 3151576 (3016d8 hex)
OX820 # bootm
## Loading kernel from FIT Image at 62000000 ...
   Using 'config@1' configuration
   Trying 'kernel@1' kernel subimage
     Description:  ARM OpenWrt Linux-3.18.23
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x620000e4
     Data Size:    3143016 Bytes = 3 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x60008000
     Entry Point:  0x60008000
     Hash algo:    crc32
     Hash value:   5c99867d
     Hash algo:    sha1
     Hash value:   3af23f88b007fb19e48e2e04af79d82689226b6d
   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 stg212 device tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x622ff77c
     Data Size:    7224 Bytes = 7.1 KiB
     Architecture: ARM
     Hash algo:    crc32
     Hash value:   da9a5725
     Hash algo:    sha1
     Hash value:   10938dfaafa6afb63e238032eaa4bdc5db736a0a
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Booting using the fdt blob at 0x622ff77c
   Loading Kernel Image ... OK
   Loading Device Tree to 67e1e000, end 67e22c37 ... OK

Starting kernel ...

Uncompressing Linux...

XZ-compressed data is corrupt

 -- System halted
this leads me to conclusion that something needs to be re-configured with filesystem? help anyone?
Re: revive Medion oxnas stg-212
November 08, 2022 02:46PM
Quote

OX820 # bootm
## Loading kernel from FIT Image at 62000000 ...
Using 'config@1' configuration
Trying 'kernel@1' kernel subimage
Description: ARM OpenWrt Linux-3.18.23
Type: Kernel Image
Compression: uncompressed
Data Start: 0x620000e4
Data Size: 3143016 Bytes = 3 MiB
Architecture: ARM
OS: Linux
Load Address: 0x60008000
Entry Point: 0x60008000
Hash algo: crc32
Hash value: 5c99867d
Hash algo: sha1
Hash value: 3af23f88b007fb19e48e2e04af79d82689226b6d
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 stg212 device tree blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x622ff77c
Data Size: 7224 Bytes = 7.1 KiB
Architecture: ARM
Hash algo: crc32
Hash value: da9a5725
Hash algo: sha1
Hash value: 10938dfaafa6afb63e238032eaa4bdc5db736a0a
Verifying Hash Integrity ... crc32+ sha1+ OK
Booting using the fdt blob at 0x622ff77c
Loading Kernel Image ... OK
Loading Device Tree to 67e1e000, end 67e22c37 ... OK

Which u-boot is running?

Reminder: It is best to post the entire serial boot log so we can see the behavior from begin till the error occurs. printenv and help are also needed (as you posted above).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: revive Medion oxnas stg-212
November 08, 2022 03:06PM
you're right, missed the most important part... ;-) so here the whole deal once again (for having everything in one place)

1st bootloader:
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
ipaddr=192.168.50.100
serverip=192.168.50.59
autoload=n
netmask=255.255.0.0
bootfile=uImage
load_nand=nboot 61000000 0 440000
boot=bootm 61000000
boot_nand=prinrun load_nand boot
MODEL_ID=AB03
PRODUCT_NAME=STG-212
VENDOR_NAME=MitraStar Technology Corp.
ethaddr=00:11:41:30:3a:12
boot_lede=nand read 0x64000000 0x440000 0x90000 ; go 64000000
bootcmd=run boot_lede
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: 538/131068 bytes
$ help
?       - alias for 'help'
base    - print or set address offset
bdinfo  - print Board Info structure
bootm   - boot application image from memory
bootp   - boot image via network using BootP/TFTP protocol
cmp     - memory compare
cp      - memory copy
crc32   - checksum calculation
echo    - echo args to console
exit    - exit script
go      - start application at address 'addr'
help    - print online help
iminfo  - print header information for application image
ledfail - Extinguish (0) or light (1) failure LED
loop    - infinite loop on address range
md      - memory display
mm      - memory modify (auto-incrementing)
mtest   - simple RAM test
mw      - memory write (fill)
nand    - NAND sub-system
nboot   - boot from NAND device
nm      - memory modify (constant address)
nwboot          - NAND Write boot information
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
version - print monitor version
2nd bootloader:
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
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 # help
?       - alias for 'help'
askenv  - get environment variables from stdin
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootelf - Boot from an ELF image in memory
bootm   - boot application image from memory
bootmenu- ANSI terminal bootmenu
bootp   - boot image via network using BOOTP/TFTP protocol
bootvx  - Boot vxWorks from an ELF image
chpart  - change active partition
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
dhcp    - boot image via network using DHCP/TFTP protocol
diskboot- boot from IDE device
echo    - echo args to console
editenv - edit environment variable
env     - environment handling commands
exit    - exit script
ext2load- load binary file from a Ext2 filesystem
ext2ls  - list files in a directory (default /)
ext4load- load binary file from a Ext4 filesystem
ext4ls  - list files in a directory (default /)
ext4size- determine a file's size
ext4write- create a file in the root directory
false   - do nothing, unsuccessfully
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fatsize - determine a file's size
fatwrite- write file into a dos filesystem
fdt     - flattened device tree utility commands
gettime - get timer val elapsed,

go      - start application at address 'addr'
grepenv - search environment variables
hash    - compute hash message digest
help    - print command description/usage
ide     - IDE sub-system
iminfo  - print header information for application image
imxtract- extract a part of a multi-image
ini     - parse an ini file in memory and merge the specified section into the env
itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loadx   - load binary file over serial line (xmodem mode)
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
md      - memory display
md5sum  - compute MD5 message digest
mdio    - MDIO utility commands
mii     - MII utility commands
mm      - memory modify (auto-incrementing address)
mtdparts- define flash/nand partitions
mw      - memory write (fill)
nand    - NAND sub-system
nboot   - boot from NAND device
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
pxe     - commands to get and boot from pxe files
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
setexpr - set environment variable as the result of eval expression
showvar - print local hushshell variables
sleep   - delay execution for some time
source  - run script from memory
sysboot - command to get and boot from syslinux files
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
time    - run commands and summarize execution time
true    - do nothing, successfully
ubi     - ubi commands
ubifsload- load file from an UBIFS filesystem
ubifsls - list files in a directory
ubifsmount- mount UBIFS volume
ubifsumount- unmount UBIFS volume
unzip   - unzip a memory region
usb     - USB sub-system
usbboot - boot from USB device
version - print monitor, compiler and linker version
zip     - zip a memory region
Re: revive Medion oxnas stg-212
November 08, 2022 04:16PM
Quote

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

That makes much more sense.

Not sure about the error though. You are running OpenWrt u-boot, and its envs should be already set to boot this box. If you have changed any envs, then that's probably the reason it does not boot anymore.

========================

And reagarding the ubi partition,

This env needs to be:

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

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: revive Medion oxnas stg-212
November 08, 2022 04:44PM
bodhi Wrote:
-------------------------------------------------------
>
> setenv mtdparts
> 'mtdparts=41000000.nand:14m(boot),-(ubi)'
>
thanks, this helps saving the env in stage2.

for sure, over the years i was also messing with envs, but starting point of all the mess was trying to update a self compiled openwrt (14.x or 15.x) to 17.x which seemed very rare back in the days and turned into this mess. wish i could at least some kind of linux to have it running again. who knows, maybe one day i will succeed? i'm pretty sure it fails extracting/starting kernel, cause somehow mtd partitions got lost. most likely nand erase will play it's part in the whole process, but don't know where yet. well... maybe someone can and will jump in someday. thanks again!
Author:

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: