[Dockstar] Reflashing to stock with serial cable

Guides written by the community, for the community, and only guides!

[Dockstar] Reflashing to stock with serial cable

Postby crimsonredmk » Sun Jul 03, 2011 12:20 am

If you have somehow corrupted your Pogoplug installation on mtd1 or mtd2 and cannot boot into Arch Linux ARM or the original Pogoplug installation, you can follow these steps to restore mtd1 and mtd2 from U-Boot. You will need to have a serial cable connected to your Dockstar. This guide will not replace or restore your U-Boot.

Requirements

CA-42 cable
A way to connect wires to pins
A DockStar
A Linux machine or virtual machine with a TFTP server installed and running
The "redstone" kernel and latest ramdisk

Downloads
Download the following 2 files to your TFTP directory, then chmod 777 both of them:
http://archlinuxarm.org/mirror/ce/ce_ke ... ne_v63.img
http://archlinuxarm.org/mirror/ce/ce_ramdisk_v2.0b.img

Connecting the Serial Cable

Assuming you have a CA-42 cable, here is something to give you an idea of how and where to connect the cable:

With the ethernet port facing 12-o'clock, north of you, the pins in question are the bottom-right 3. The one on the very far bottom-right is GND, the one directly next to it (to the left) is TX, and the one left of that one (still on the bottom) is RX.

Using PuTTY or screen, connect to /dev/ttyUSB0 with speed 115200 and turn the DockStar on. You should see U-Boot running. If not, try reconnecting the cables.

Reflashing

Download the kernel and ramdisk to your TFTP directory (be sure to chmod 777 them). Grab the server's IP address (with ifconfig).

Reset all the boot variables to defaults on the DockStar in the serial connection:
Code: Select all
resetenv


After it reboots, set the DockStar's IP address (make it anything that is close to your LAN's addresses, e.g. 192.168.1.123), using:
Code: Select all
setenv ipaddr 192.168.1.123


Set the TFTP server's IP address:
Code: Select all
setenv serverip 192.168.1.101


Set the MAC address to match what is on the bottom of the DockStar (replace the zeroes):
Code: Select all
setenv ethaddr 00:00:00:00:00:00


Set the 26-character Pogoplug ID (the biggest number on the bottom):
Code: Select all
setenv cesvcid 00000000000000000000000000


Set the boot command:
Code: Select all
setenv console 'console=ttyS0,115200'
setenv bootargs_root 'root=/dev/mtdblock2 ro'
setenv bootcmd 'nand read.e 0x800000 0x100000 0x300000; setenv bootargs $(console) $(bootargs_root); bootm 0x800000'


Save these values:
Code: Select all
saveenv


Erase the NAND:
Code: Select all
nand erase 0x100000 0x400000


Grab the kernel from the TFTP server:
Code: Select all
tftp 0x800000 ce_kernel_redstone_v63.img
(note transfer-size -- Should be 1978608)


Write the kernel to the proper location:
Code: Select all
nand write.e 0x800000 0x100000 0x1e30f0
(the last number is the kernel size in hex that showed after tftp, change if needed)


Grab the Pogoplug ramdisk from TFTP:
Code: Select all
tftp 0x1000000 ce_ramdisk_v2.0b.img
(note transfer-size -- Should be 11770380)


Set the boot arguments to match the ramdisk size:
Code: Select all
setenv bootargs $(console) root=/dev/mtdblock2 initrd=0x1000000,0xb39a59
(that last number is the ramdisk size in hex that showed after tftp)


Boot it:
Code: Select all
bootm 0x800000


You can install Arch Linux ARM or another operating system again after reflashing.
Remember, Arch Linux ARM is completely donation-supported, and is totally awesome.
crimsonredmk
Site Admin
 
Posts: 433
Joined: Wed Dec 30, 2009 5:17 pm
Location: #archlinux-arm on irc.freenode.net

Re: [Dockstar] Reflashing to stock with serial cable

Postby WarheadsSE » Sun Jul 03, 2011 2:59 am

do you need to write the ram disk to nand?
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6326
Joined: Mon Oct 18, 2010 2:12 pm

Re: [Dockstar] Reflashing to stock with serial cable

Postby crimsonredmk » Sun Jul 03, 2011 3:14 pm

Nope, that is handled in the first boot procedure actually. It's extracted and written at that time, then the device reboots into Pogoplig firmware.
Remember, Arch Linux ARM is completely donation-supported, and is totally awesome.
crimsonredmk
Site Admin
 
Posts: 433
Joined: Wed Dec 30, 2009 5:17 pm
Location: #archlinux-arm on irc.freenode.net

Re: [Dockstar] Reflashing to stock with serial cable

Postby Pheenix » Sun Aug 28, 2011 2:07 pm

Hello,

i've Done a reflash by this Workaround ans now getting this Error while booting. Can someone help me?

Thanks,
Sebastian


Error Output:
U-Boot 2010.09 (Oct 23 2010 - 11:49:22)
Marvell-Dockstar/Pogoplug by Jeff Doozan

SoC: Kirkwood 88F6281_A0
DRAM: 128 MiB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Net: egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot: 0
(Re)start USB...
USB: Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 2 USB Device(s) found
scanning bus for storage devices... 0 Storage Device(s) found
** Block device usb 0 not supported

** Invalid boot device **
Creating 1 MTD partitions on "nand0":
0x000002500000-0x000010000000 : "mtd=3"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 129024 bytes
UBI: smallest flash I/O unit: 2048
UBI: sub-page size: 512
UBI: VID header offset: 512 (aligned 512)
UBI: data offset: 2048
UBI: attached mtd1 to ubi0
UBI: MTD device name: "mtd=3"
UBI: MTD device size: 219 MiB
UBI: number of good PEBs: 1751
UBI: number of bad PEBs: 1
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 0
UBI: available PEBs: 1730
UBI: total number of reserved PEBs: 21
UBI: number of PEBs reserved for bad PEB handling: 17
UBI: max/mean erase counter: 1/1
UBIFS error (pid 0): ubifs_get_sb: cannot open "ubi:rootfs", error -19
Error reading superblock on volume 'ubi:rootfs'!
** Block device usb 0 not supported
** Block device usb 1 not supported
** Block device usb 2 not supported
** Block device usb 3 not supported
** Block device usb 0 not supported
** Block device usb 0 not supported
Wrong Image Format for bootm command
ERROR: can't get kernel image!
stopping USB..
### JFFS2 loading 'uboot-original-mtd0.kwb' to 0x800000
Scanning JFFS2 FS: ....... done.
find_inode failed for name=uboot-original-mtd0.kwb
load: Failed to find inode
### JFFS2 LOAD ERROR<0> for uboot-original-mtd0.kwb!
### JFFS2 loading 'uboot-original-mtd0.kwb' to 0x800000
find_inode failed for name=uboot-original-mtd0.kwb
load: Failed to find inode
### JFFS2 LOAD ERROR<0> for uboot-original-mtd0.kwb!
resetting ...


U-Boot 2010.09 (Oct 23 2010 - 11:49:22)
Marvell-Dockstar/Pogoplug by Jeff Doozan

SoC: Kirkwood 88F6281_A0
DRAM: 128 MiB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Net: egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot: 0
Marvell>>
Pheenix
 
Posts: 2
Joined: Sun Aug 28, 2011 2:02 pm

Re: [Dockstar] Reflashing to stock with serial cable

Postby Pheenix » Tue Aug 30, 2011 8:09 am

Hey,

i've solved the Problem. I loaded the "normal" U-Boot in the RAM and start it from the RAM. After the normal U-Boot work's I installed the normal U-Boot (i know, it sounds a little bit tricky :D) and now everything works fine. I also re-installed Arch-Linux Arm.

If someone have a similiar problem, contact me. (But my english is not the best at all^^)

Sebastian
Pheenix
 
Posts: 2
Joined: Sun Aug 28, 2011 2:02 pm

Re: [Dockstar] Reflashing to stock with serial cable

Postby gunker » Mon Jun 04, 2012 9:27 am

Thanks very much for this very easy to follow guide. One small addition if I may, I didn't realise that I needed to have dockstar connected to the network (as well as the serial connection), and for this reason, the tftp was failing. Once that was done, it worked like clockwork.
gunker
 
Posts: 1
Joined: Sun Jun 03, 2012 2:42 pm

Re: [Dockstar] Reflashing to stock with serial cable

Postby coke » Thu Jul 26, 2012 8:00 am

hello!
i have a problem

Code: Select all
Marvell>> tftp 0x800000 ce_kernel_redstone_v63.img
Using egiga0 device
TFTP from server 192.168.0.1; our IP address is 192.168.0.2
Filename 'ce_kernel_redstone_v63.img'.
Load address: 0x800000
Loading: #################################################################
         #################################################################
         #####
done
Bytes transferred = 1978608 (1e30f0 hex)
Marvell>> nand write.e 0x800000 0x100000 0x1e30f0

NAND write: device 0 offset 0x100000, size 0x1e30f0
Attempt to write non page aligned data
 1978608 bytes written: ERROR

i'm blocked
thank for help me
Last edited by WarheadsSE on Thu Jul 26, 2012 3:12 pm, edited 1 time in total.
Reason: adding code tags.
coke
 
Posts: 1
Joined: Thu Jul 26, 2012 7:58 am

Re: [Dockstar] Reflashing to stock with serial cable

Postby sambul13 » Tue Sep 18, 2012 6:47 pm

Once you get a new Plug, it may be a good idea to backup its NAND internal memory blocks with nanddump, more examples here. While Dockstar uses Uboot for booting, GoFlex Net & Home owners previously replaced original Pogo bootloader with Ubit due to hardware differences. You can try restoring to stock first via Ubit after booting to the Plug by following the linked nanddump thread and keeping in mind that:

Code: Select all
Returning to Pogoplug functionality requires that all the Pogoplug components are installed correctly in their proper locations:

1. Pogoplug U-Boot in the first 512KB of /dev/mtd0
2. Pogoplug U-Boot envrionment at 0xa0000 on /dev/mtd0
3. Pogoplug kernel at addresses 0x000000 to 0x300000 on /dev/mtd1
4. Pogoplug jffs2 root filesystem on /dev/mtd2


Since Ubit doesn't support newest ArcLinux releases, many users updated GFN & GFH to Uboot. If its broken you may want to follow the above Pheenix's success with "normal" Jeff Doozan's Uboot. Here are bzboi's instructions on downloading and reflashing the original DockStar's or Jeff's Uboot with Serial cable, which makes this thread complete. ;) You may want to try reflashing first with Netconsole over LAN, if you added its support earlier to Uboot environment. While Uboot reflash to Pogo bootloader is needed to boot the Pogo stock from NAND, depending on your situation, it may not be required to fix ArcLinux boot or SSH access problems, so it may be enough just to correct Uboot environment via Serial or Netconsole by entering setenv <command> sequence, then saveenv, printenv to verify, and hardware reboot .

bzboi wrote:To restore Pogo uBoot, you can setup a TFTP server on a Linux/Windows PC on the same network (I use SolarWinds on XP) and do the following:-

1) Download http://jeff.doozan.com/debian/uboot/fil ... iginal.kwb and stick it in your TFTP directory.

2) At uBoot prompt, enter:-
Code: Select all
// Set Dockstar IP & netmask
setenv ipaddr xxx.xxx.xxx.xxx
setenv netmask xxx.xxx.xxx.xxx
// Set TFTP server IP
setenv serverip xxx.xxx.xxx.xxx
// Confirm that you can get from Dockstar to TFTP server
ping $(serverip)
// Load uBoot to Dockstar RAM
tftp 0x800000 uboot.mtd0.dockstar.original.kwb
// Erase just enough of NAND to replace uBoot
nand erase 0x0 0x80000
// Write uBoot from RAM to NAND
nand write.e 0x800000 0x0 0x80000


3) When you're absolutely sure you got it right, reboot.
Last edited by sambul13 on Tue Oct 30, 2012 11:31 am, edited 10 times in total.
sambul13
 
Posts: 258
Joined: Sat Aug 18, 2012 10:32 pm

Re: [Dockstar] Reflashing to stock with serial cable

Postby sambul13 » Sun Oct 28, 2012 1:21 pm

If your updated Uboot is intact and works well, you may not need a Serial to reflash a Plug NAND to stock firmware. Instead, correct your Uboot env to add TFTP server address in Netconsole or after booting to ArchLinux, and then reflash the original kernel via TFTP.

To setup and use serial connection with Docstar or GoFlex Net & Home via PuTTy in Windows or Screen package in ArchLinux, follow Varkey's Seagate GoFlex Net : Serial Connection or similar Dockstar Guide. Note, the above linked on Jeff's site original Pogo bootloader uboot.mtd0.dockstar.original.kwb can be flashed via Serial & TFTP as above, or Netconsole via DHCP & TFTP or Fixed IP & TFTP to any of the above device's NAND when needed. Use tftp server like SolarWind on your Windows PC or Tftpd in ArchLinux.

When your Uboot is intact, but ArchLinux installation on a USB Thumb or SATA drive is broken and you can't boot to it, instead of reflashing Uboot to original and booting to Pogo stock on NAND, consider first reinstalling ArchLinux to the Thumb after booting a Linux Distro from CD or in a Virtual Machine on your PC, or simply use DD utility or Rsync to restore it from backup previously made. You can also hook a SATA drive after booting the Plug from a USB Thumb you want to replace with SATA, and install OS to it similar way.

If you brick Uboot beyond repair via Netconsole or Serial Cable, try reflashing it via Serial with installed on your Linux PC kwboot tool. If not successful, its now Jtag time to fix your Plug, with some wiring examples and more advice here. The above gives you an overview of several effective methods to bring your Plug back to life - the choice is yours. :D
Last edited by sambul13 on Sun Nov 04, 2012 2:16 pm, edited 10 times in total.
sambul13
 
Posts: 258
Joined: Sat Aug 18, 2012 10:32 pm

Re: [Dockstar] Reflashing to stock with serial cable

Postby pepedog » Sun Oct 28, 2012 2:58 pm

I thought it time to update 2 dockstars with old uBoot. Using serial
One went sweet following first post.
The other went bad, can't complete with Marvell prompt, only CE.
However following bzboi's instructions then first post, fought my way thru.
Used dnsmasq for tftpd
pepedog
Developer
 
Posts: 2415
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Next

Return to Community Guides

Who is online

Users browsing this forum: No registered users and 1 guest