Welcome! Log In Create A New Profile

Advanced

Can boot, but cannot reboot

Posted by Sherman 
Can boot, but cannot reboot
November 17, 2013 04:30PM
Hi Everyone!

First of all thanks for the great work, Jeff!

I have a weird problem: I could install debian on my dockstar and I can also boot it, but everytime I reboot it, i can't connect and I get the orange led blinking.

These are my netcat logs:

Normal boot (when I plug the power in):
U-Boot 2011.12 (Feb 12 2012 - 21:33:07)
Seagate FreeAgent DockStar
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q3-67) 4.4.1
GNU ld (Sourcery G++ Lite 2009q3-67) 2.19.51.20090709
Hit any key to stop autoboot:  0 
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 3 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
Loading file "/rescueme" from usb device 0:1 (usbda1)
** File not found /rescueme
reading /rescueme.txt

** Unable to read "/rescueme.txt" from usb 0:1 **
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:        1752
UBI: number of bad PEBs:         0
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:             1731
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'!
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
1 bytes read
Found bootable drive on usb 0:1
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
1608496 bytes read
Loading file "/boot/uInitrd" from usb device 0:1 (usbda1)
6881824 bytes read
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   kernel 3.2.0-4-kirkwood
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1608432 Bytes = 1.5 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   ramdisk 3.2.0-4-kirkwood
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    6881760 Bytes = 6.6 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...


When I get the orange blinking after reboot:
U-Boot 2011.12 (Feb 12 2012 - 21:33:07)
Seagate FreeAgent DockStar
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q3-67) 4.4.1
GNU ld (Sourcery G++ Lite 2009q3-67) 2.19.51.20090709
Hit any key to stop autoboot:  0 
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... EHCI timed out on TD - token=0x80008c80
3 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:        1752
UBI: number of bad PEBs:         0
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:             1731
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..

NAND read: device 0 offset 0x100000, size 0x400000
 4194304 bytes read: OK
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-2.6.32.18-dockstar
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3236180 Bytes = 3.1 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Any Ideas?

Thanks,

Sherm
Re: Can boot, but cannot reboot
November 17, 2013 05:35PM
Sherman,

It's likely that the brand of your USB stick. Some takes longer to be reset. In the past, people have discovered this problem, some sticks are OK with cold boot, but have problem with warm boot. The most reliable brand is Sandisk (based on my own experience, and other reports). Your log showed that in the warm boot, the USB stick was timed out during "usb start".

However, there is a work around to try and see it will get around this USB stick slow reset. You can try it before resorting to switching to a different USB thumb.

In your uBoot envs:
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run sata_bootcmd; run rescue_bootcmd; run pogo_bootcmd; reset
the workaround is to change it to have 3 "usb start"
bootcmd=usb start; usb start; usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run sata_bootcmd; run rescue_bootcmd; run pogo_bootcmd; reset

Be careful when you set this in Debian (typo would prevent booting) using the fw_setenv command:
fw_setenv bootcmd 'usb start; usb start; usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run sata_bootcmd; run rescue_bootcmd; run pogo_bootcmd; reset'

I should note that: adjust your current bootcmd to have 3 "usb start". Yours might be different than my bootcmd above.


You should make sure that you can interrupt netconsole and issue commands before trying this (in case any unforseen problem occur then you can fix it in uBoot command prompt)

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



Edited 1 time(s). Last edit at 11/17/2013 05:59PM by bodhi.
Re: Can boot, but cannot reboot
November 18, 2013 01:57PM
Just a quick question, out of curiosity:
Why run "usb start" more than once, instead of using a wait/sleep command to insert a break of a few seconds before running usb start once?
Re: Can boot, but cannot reboot
November 18, 2013 04:01PM
Ingmar_k,
I have not tried that. But my thinking was during warm start, the scan timeout period is set too short in uBoot code. Iirc, the reset excutes different code during cold start.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Can boot, but cannot reboot
November 19, 2013 03:54AM
The reason I am asking is the following:
You will have to wait anyway for all the "usb start" calls to finish. And I don't know the exact code, so I don't know if it's a good idea, bad idea, or if it doesn't matter how often you run it.
So my reasoning would be: Better run it once a wait a few seconds before. But in the end it probably doesn't matter, and is more likely just a matter of taste, in a way.
I just thought I'd ask, in case you knew something I don't.
Re: Can boot, but cannot reboot
November 19, 2013 04:27AM
Agreed. It does not matter, which ever way works to get around the problem is good enough :)

My observation from reading uBoot code:
- the time out value for starting either MMC or USB in uBoot code is 5ms max. This duration might be too short for certain USB thumbs or SD cards, they certainly have different build quality.

My observation from uBoot serial console behavior:
- the warm start happens so much quicker regarding USB drives (i.e. the USB drive did not seem to go through the long init sequence as in cold start, but was shorted circuit because the USB device was already up). So the sleep period might not make a difference. But I have not looked deep enough to be confident one way or the other.

Also, another observation:
- the timeout value for hard drives is 10ms. So this short duration might also be the cause for errors such as (I'm guessing):
"scanning usb for storage devices... EHCI timed out on TD - token=…."

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



Edited 2 time(s). Last edit at 11/19/2013 04:37AM by bodhi.
Re: Can boot, but cannot reboot
November 21, 2013 03:38PM
Bodhi thanks for the quick repsonse!

I had a few troubles getting into the uboot console first.. Under Ubuntu I had to use this command nc -up 6666 192.168.178.20 6666 and instead of using any key, I had to press Ctrl - J... No idea why.. But I finally got there and so i tried your commands! Unfortunately it still does not work..

This is what I get:
U-Boot 2011.12 (Feb 12 2012 - 21:33:07)
Seagate FreeAgent DockStar
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q3-67) 4.4.1
GNU ld (Sourcery G++ Lite 2009q3-67) 2.19.51.20090709
Hit any key to stop autoboot:  0 
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... EHCI timed out on TD - token=0x80008c80
3 USB Device(s) found
       scanning bus for storage devices... 0 Storage Device(s) found
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... EHCI timed out on TD - token=0x80008c80
3 USB Device(s) found
       scanning bus for storage devices... 0 Storage Device(s) found
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... EHCI timed out on TD - token=0x80008c80
3 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:        1752
UBI: number of bad PEBs:         0
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:             1731
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..

NAND read: device 0 offset 0x100000, size 0x400000
 4194304 bytes read: OK
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-2.6.32.18-dockstar
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3236180 Bytes = 3.1 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

It is actually a san disk usb stick and it worked without my old setup (I used the installer about a year ago). Did I maybe format the usb stick wrong? Should I install the old uboot again?

Thanks for your help!

Edit: I tried reformatting the stick using gparted instead of cfdisk -> no luck. Weird thing though: Wenn the installer finishes and reboots, the ehci error was not there.. When I tried to reboot again, the error came back.

I also tried setting fw_setenv usb_init 'usb stop; usb start; run usb_scan'. Did not help either.



Edited 1 time(s). Last edit at 11/21/2013 05:08PM by Sherman.
Re: Can boot, but cannot reboot
November 25, 2013 09:33PM
Sheman,

Which port did you plug in the USB thumb? Have you tried the back port next to the Ethernet?

Also, if trying different port did not wok, then try this: reboot, interrupt netconsole, and manuall run "usb start" a few times to see how many tries you need before it is successfuly started.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Can boot, but cannot reboot
December 08, 2013 08:13AM
Hi guys,

I am wondering if you found a solution to this problem. I am facing the same issue, but I am using an external SATA HDD in SATA to USB enclosure. Drive has his own power supply, not powered from the Dockstar.

The Dockstar woud boot without any issues from cold start, but would not boot after reboot.

When I say cold start it must be completelly cold start, both the Dockstar as well as drive must be powered down completelly.

I tried all suggestions given above, but non of them worked, the drive is either not found at all or I am getting "EHCI timed out on TD - token=" messages, which would eventualy time out themself and Dockstar would boot in to recovery system.

With the USB stick it boots reliably from cold or warm start, every time.
Here are my boout environment variables (as they stand at the moment):
root@MOON:~# fw_printenv
ethact=egiga0
bootdelay=3
baudrate=115200
mainlineLinux=yes
console=ttyS0,115200
led_init=green blinking
led_exit=green off
led_error=orange blinking
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
mtdids=nand0=orion_nand
partition=nand0,2
stdin=serial
stdout=serial
stderr=serial
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
rescue_bootcmd=if test $rescue_installed -eq 1; then run rescue_set_bootargs; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000; else run pogo_bootcmd; fi
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
force_rescue=0
force_rescue_bootcmd=if test $force_rescue -eq 1 || ext2load usb 0:1 0x1700000 /rescueme 1 || fatload usb 0:1 0x1700000 /rescueme.txt 1; then run rescue_bootcmd; fi
ubifs_mtd=3
ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params
ubifs_bootcmd=run ubifs_set_bootargs; if ubi part data && ubifsmount rootfs && ubifsload 0x800000 /boot/uImage && ubifsload 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; fi
usb_scan=usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb $usb 0x800000 /boot/uImage 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done
usb_scan_list=1 2 3 4
usb_scan_1=usb=0:1 dev=sda1
usb_scan_2=usb=1:1 dev=sdb1
usb_scan_3=usb=2:1 dev=sdc1
usb_scan_4=usb=3:1 dev=sdd1
usb_device=0:1
usb_root=/dev/sda1
usb_rootfstype=ext2
usb_rootdelay=10
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
usb_boot=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage; if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
ethaddr=XX:XX:XX:XX:XX:XX
arcNumber=2998
rescue_installed=1
serverip=192.168.0.77
if_netconsole=ping $serverip
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
preboot=run if_netconsole start_netconsole
ipaddr=192.168.0.11
usb_init=usb stop; usb start; run usb_scan
bootcmd=usb start; usb start; usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset

Any suggestion is highly appreciated.

Thanks,
Roman



Edited 1 time(s). Last edit at 12/08/2013 01:20PM by RomanG.
Re: Can boot, but cannot reboot
December 08, 2013 04:03PM
RomanG,

I have another idea to work around this problem. I have not scripted a nice sequence of commands to test it. But perhaps you can try it manually in serial or net console.

Reboot, interrupt your console and change the bootcmd to take out the run pogo_bootcmd part:

setenv bootcmd 'usb start; usb start; usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; reset'

And then let it boot
boot

I think chance is that it will boot right away, or if not then the next reset will recognize the HDD. If this works, we could script a countdown so that it will try only a few times and then if not successful will boot into Pogo OS.

Warning: Please try this only if you have netconsole or serial console working. Do not try in Linux command line.

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



Edited 2 time(s). Last edit at 12/08/2013 04:13PM by bodhi.
Re: Can boot, but cannot reboot
December 08, 2013 08:04PM
Bodhi,

Thanks for the suggestion. I do have netconsole as well as serial console working on this one so no big worry if something goes south. And the buspirate in the drawer if something goes really bad.

I tried different things today and did some reading on uboot. It looks like this behaviour is not that uncommon. I was also carefully watching what my HDD is doing (or not doing) during warm reboot.
After reboot it would spin down during 10 second count down and then would not come back when USB scan begins.
So what I did was to reduce bootdelay variable from 10 sec to 2 sec and now t seems to be booting consistently.

I will try your suggestion as well and will report back.

Roman
Re: Can boot, but cannot reboot
December 09, 2013 01:03PM
Hi bohdi,

I had a bit of time to play with it today.

I changed back the bootdelay variable to 10 seconds and did warm reboot just to confirm the behaviour. And indeed, I got "EHCI timed out on TD - token=" messages and the Dockstar eventually (after about 1-2 minutes of EHCI timed out...messages) booted in to the rescue system.

Then I rebooted, interupted the boot sequence, changed the bootcmd variable as you suggested above, removing run pogo_bootcmd instruction and issued the boot command.
It booted fine in to the Debian.

But when I issued reboot command from Debian, I would again receive "EHCI timed out on TD - token=" messages and the Dockstar would eventually boot in to the rescue system.

Then I tried to interupt boot proces again from netconsole, wait a bit and then issue the boot command, but it would fail to boot to Debian and again booted to the rescue system.

So I again reduced bootdelay variable from 10 sec to 2 sec and now it boots consistently from either cold reboot or warm reboot.

I left the run pogo_bootcmd instruction removed.

Roman
Re: Can boot, but cannot reboot
December 10, 2013 12:46AM
Roman,

I've overlooked that you have rescue system installed! so to really test the reset, the command would have to be:
setenv bootcmd 'usb start; usb start; usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; reset'

In any case, it is just to see if we have more one alternative workaround. Try only if you feel like testing it!

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

Your Email:


Subject:


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