Welcome! Log In Create A New Profile

Advanced

[Pogoplug Mobile/Series 4] Install uBoot/Debian

Posted by bodhi 
[Pogoplug Mobile/Series 4] Install uBoot/Debian
March 02, 2013 06:34PM
Notice: this thread is now obsolete! Please use the new U-boot and Debian rootfs/kernel threads.

Background:

The installation starting point should be one of these 3 environments:
1. From inside Pogo OS with a brand new, unhacked Pogo Mobile/Series4. SSH into Pogo OS and start from there.
2. From Arch Linux command line.
3. From Debian command line.

To install, you must have NAND tools and fw_env tools installed first. See here:
http://forum.doozan.com/read.php?2,11663,11713#msg-11713


Installation:

- Download Davy's uBoot image (April 8th 2012)
uboot.nandpogoV4-MMC-mtdparts-noSATA.kwb

Warning: This uBoot image uboot.nandpogoV4-MMC-mtdparts-noSATA.kwb does not support SATA (neither booting or in Debian).

See this thread for uBoot image: http://forum.doozan.com/read.php?3,7477,page=1

- Download Jeff's uBoot envs image
http://download.doozan.com/uboot/files/environment/uboot.environment

- Make sure the tools are in place and the uBoot enviroment definition is at the right place:

# which flash_erase
/usr/sbin/flash_erase
# which nandwrite
/usr/sbin/nandwrite

# cat /etc/fw_env.config 
# MTD device name	Device offset	Env. size	Flash sector size	Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000


- Flash uBoot

# flash_erase /dev/mtd0 0 4
Erase Total 4 Units
Performing Flash Erase of length 131072 at offset 0x60000 done

# nandwrite /dev/mtd0 uboot.nandpogoV4-MMC-mtdparts-noSATA.kwb 
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000

- At this point, I believe you can boot with SD card. Because Davy's uBoot is set up for that.
However, for me to get a warm and fuzzy feeling, I'd like to be a little bit more sure, so I flashed the uBoot envs image from Jeff's script.

- Flash uboot.environment to 0xC0000

# /usr/sbin/flash_erase /dev/mtd0 0xc0000 1
Erase Total 1 Units
Performing Flash Erase of length 131072 at offset 0xc0000 done

# /usr/sbin/nandwrite -s 786432 /dev/mtd0 uboot.environment 
Writing data to block 6 at offset 0xc0000

- Confirm that all envs are shown without error:

# fw_printenv
ethact=egiga0
bootdelay=3
baudrate=115200
arcNumber=2097
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_installed=0
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_init=run usb_scan
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
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset


- Adjust MTD parts

# fw_setenv mtdparts 'mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)'
# fw_printenv mtdparts
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)

- Set up netconsole (change serverip and ipaddr to appropriate numbers in your network)

# fw_setenv serverip 192.168.0.220
# fw_setenv ipaddr 192.168.0.230
# fw_setenv if_netconsole 'ping $serverip'
# fw_setenv start_netconsole 'setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;'
# fw_setenv preboot 'run if_netconsole start_netconsole'

- At this point you can only boot with a USB rootfs, since Jeff's uBoot env image did not have MMC boot.

- To boot with SD card, set uBoot envs:

# fw_setenv bootcmd 'usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run mmc_bootcmd'
# fw_setenv mmc_bootcmd 'mmc init; mmc init;ext2load mmc 0:1 0x00800000 /boot/uImage; if ext2load mmc 0:1 0x01100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi'


- If you have a kernel that supportsPogoplug V4 then set arcNumber and machid.
Warning: don't do this if you're not sure, because it won't boot with a vanilla kernel after the arcNumber changed from 2097.
A vanilla Debian or Arch should boot fine with arcNumber 2097.

# fw_setenv arcNumber 3960
# fw_setenv machid F78

- Shutdown and cold start with Debian or Arch rootfs


Addendum:
Thanks to dhead for pointing out that the mmc_init does not seem to work the first time, so the work around in mmc_bootcmd is to include it twice:

# fw_setenv mmc_bootcmd 'mmc init; mmc init;ext2load mmc 0:1 0x00800000 /boot/uImage; if ext2load mmc 0:1 0x01100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi'

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



Edited 8 time(s). Last edit at 08/04/2014 06:19PM by bodhi.
Re: [Pogoplug Mobile] Install uBoot/Debian
March 02, 2013 07:44PM
Hi, Budhi,
Thank you for reply my post and for putting this guidance together. As I said, I haven't touch this type of devices for some time, I have a few questions. Sorry if this shows I am uninitialted but this is the way is. Appreciate you can help me to start faster.
(1) The main question is which environment you are operated in. In dockstar days, I use Putty to log into the dockstar linux environment and go from there. Is this the same way for Pogo Mobile? When you say you use "Debian wheezy," is it already installed in Pogo Mobile or it is in an external computer? If the formal, how can install wheezy into Pogo Mobile in the first place? I thought that is what I want to do in the first place. I am just confused.
(2) When people talked about UART, is it the same as serial interface or something different?
(3) For SSH into the unit, do I need to register first to enable SSH service through my.pogoplug.com? or I can do that directly like Dockstar.
I might have more questions when I receive the unit. Thanks in advance for your help.
Re: [Pogoplug Mobile] Install uBoot/Debian
March 02, 2013 11:15PM
Hi Twinclouds,

Sorry I was a little too vague about the starting point! that was because post was copied from another thread, i.e. context:) I will update it to be a little more elaborate.

1. The goal is to flash this uBoot from Linux environment. Davy's instruction for this uBoot was written to show how he installed it from serial console. See here:
http://forum.doozan.com/read.php?3,7477

So the starting point for this installation could be from either these 3 different environments: Pogo stock OS, Debian, or Arch Linux ARM. For Pogo stock OS, we will need to install fw_env tools and NAND tools first.

2. When people talk about UART booting, it's different than connecting a serial console and then load uBoot image to boot. Even though serial console is needed to run, you won't run uBoot on mtd0. It goes straight from UART to a uBoot image that was loaded into memory (because of handshake from the booting tool). See this thread: http://forum.doozan.com/read.php?3,7852

Basically a way to unbrick a device without JTAG, but it only works on certain Kirwood devices. Or a way to test a new uBoot build without flashing.

3. To SSH into the unit, you do need to register at my.pogoplug.com and enable SSH access. As described at ArchLinux ARM site:
http://archlinuxarm.org/platforms/armv5/pogoplug-series-4
Re: [Pogoplug Mobile] Install uBoot/Debian
March 03, 2013 12:25AM
Bodhi:
Thanks. Now I understand what you suggested to do. Thank you for your detailed explaination. I will let you know the result once I received the unit and tried it out. Thanks again!
Re: [Pogoplug Mobile] Install uBoot/Debian
March 04, 2013 01:10PM
Bodhi:
While I am still waiting for device to arrive, I read yours and others' posts a little more. UART booting is pretty interesting, I will certainly try that out. As for flashing uBoot using the Pogo Native OS, can you tell me a little more detail about how to install to install fw_env tools and NAND tools? Thanks in advance, as always.
Re: [Pogoplug Mobile] Install uBoot/Debian
March 04, 2013 03:54PM
Twinclouds,

You can download these tools from Jeff's site:

cd /tmp
wget http://download.doozan.com/uboot/nanddump
wget http://download.doozan.com/uboot/nandwrite
wget http://download.doozan.com/uboot/flash_erase
wget http://download.doozan.com/uboot/fw_printenv
wget http://download.doozan.com/uboot/fw_env.config
wget http://download.doozan.com/uboot/files/environment/uboot.environment

After that do chmod +x for all these files. And note that fw_printenv can only be used correctly after flashing uBoot and uBoot envs (as described in the how-to steps).



Edited 2 time(s). Last edit at 07/21/2014 04:15PM by bodhi.
Re: [Pogoplug Mobile] Install uBoot/Debian
March 04, 2013 05:36PM
Re: [Pogoplug Mobile] Install uBoot/Debian
March 04, 2013 05:51PM
Thanks syong!
Re: [Pogoplug Mobile] Install uBoot/Debian
March 04, 2013 07:16PM
Thanks for your kernel to turn my LED green!
Re: [Pogoplug Mobile] Install uBoot/Debian
March 04, 2013 07:31PM
Bodhi:
Thank you for your quick response!
Re: [Pogoplug Mobile] Install uBoot/Debian
March 09, 2013 07:37PM
Hi, Budhi:
I received this Pogoplug mobile today. I registered on line and enabled ssh. Then I have a couple of issues. Nothing is serious but I would appreciate if you can shed some lights for me. First, it appears the wireless link is not enabled. What should I do to enable it? Secondly, since I have not intention to install Arch linux to it, I disabled the online update after I established ssh connect as for dockstar by comment out "/etc/init.d/hbmgr.sh start" in '/etc/init.d/rcS". However, after reboot, I cannot ssh into it anymore. It always give the response say "Connect refused". I know I can always to uncomment it by using the serial connection but is there any way to fix that without to do the serial connection? Thanks in advance, as always.
Re: [Pogoplug Mobile] Install uBoot/Debian
March 10, 2013 01:46AM
Hi twinclouds,

Yes, commenting out "/etc/init.d/hbmgr.sh start" in '/etc/init.d/rcS" is a common mistake for those of us who have been familiar with the Dockstar procedure (we do that and it works fine). What we should do here is to just kill Pogoplug processes every time you ssh into the box before doing any installation.

The Pogo Mobile original uBoot does not have netconsole, and its uBoot envs force the bootcmd to NAND, so really the only way to change /etc/init.d/rcS is to use a serial console.

I think even though you've enabled ssh, during booting the box tries to make a connection to pogoplug.com and can't because hbmgr.sh is no longer activated. So rc.local never finishes executing.

AFAIK, there is no button reset mechanism for the Pogo Mobile so that you can restore the original FW.

If you have serial cable or module converter, you can temporarily use small pins to push into the solder lead buttons on the board. Just enough to get serial console working, and then interrupt uBoot to change the uBoot envs to boot USB. You can use the procedure in the my 1st post to install new uBoot , or use the procedure in the Pogoplug Series 4 here: http://forum.doozan.com/read.php?3,11538 to use the original uBoot, and boot USB.

-bodhi
Re: [Pogoplug Mobile] Install uBoot/Debian
March 10, 2013 06:12AM
bodhi Wrote:
-------------------------------------------------------
... snip ...
>
> Yes, commenting out "/etc/init.d/hbmgr.sh start"
> in '/etc/init.d/rcS" is a common mistake for those
> of us who have been familiar with the Dockstar
> procedure (we do that and it works fine). What we
> should do here is to just kill Pogoplug processes
> every time you ssh into the box before doing any
> installation.
>
... snip ...
> -bodhi

This actually happended to me the other day also and I had to set up a serial cable. Once the mistake is made, I think there is only serial to get access to the box. However, I believe you can avoid the mistake by commenting out the hbmgr.sh line, AND instead entering another line namely
/etc/init.d/dropbear.sh start
This starts the dropbear ssh server and you should be able to access your machine the same way it used to be possible with the dockstar. At least in my case it worked. So this is something to keep in mind for future purchases, maybe.

Cheers,

chessplayer

---
Standart ist der Standardfehler
Re: [Pogoplug Mobile] Install uBoot/Debian
March 10, 2013 12:39PM
Bodhi, Chessplayer:
I have hooked up the serial port and fixed the problem. I then tried chessplayer's suggestion of add the dropbear line. It also works. Thank you both for comments and suggestions.
I don't do much much experience of flashing uBoot. If I flash the uBoot as Bodhi outlined, but made a mistake and cannot boot into linux anymore, can I still access it from the serial port and use Davy's method to flash again? or I will need to use UART method?
Re: [Pogoplug Mobile] Install uBoot/Debian
March 10, 2013 03:57PM
Twinclouds,

As long as you get uBoot flashed to mtd0 successfully with commands:
# flash_erase /dev/mtd0 0 4
Erase Total 4 Units
Performing Flash Erase of length 131072 at offset 0x60000 done

# nandwrite /dev/mtd0 uboot.nandpogoV4-MMC-mtdparts-noSATA.kwb 
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000

then you can access the box with serial console. Even if the environments messed up. But, for example, if uBoot image was corrupted then UART method is needed. To ensure you will have no problem with these 2 commands, make sure there are no bad blocks showing in dmesg.

-bodhi
Re: [Pogoplug Mobile] Install uBoot/Debian
March 10, 2013 06:03PM
Bodhi:
Everything seems installed without error.
A couple more questions:
(1) If I want still boot the default pogo linux or Arch Linux, do I need to set
"# fw_setenv arcNumber 3960
# fw_setenv machid F78"
as you said in previous post?
(2) Which script should I use to install Debian on USB drive or SD/MMC card?
Thanks.
Re: [Pogoplug Mobile] Install uBoot/Debian
March 10, 2013 06:29PM
Twinclouds,

I've never booted back to Pogo OS so I'm not sure. You can boot with Arch, there should be no problem.

After you've installed Debian and booted it, or have verified that you can boot with Arch. You can try to remove the USB or SD drive, see if it will boot into Pogo OS (it's much easier to have something working first).

If you have another Debian rootfs, then just clone it. But if you don't then you can use Davy's rootfs:
http://forum.doozan.com/read.php?2,7806
Re: [Pogoplug Mobile] Install uBoot/Debian
March 10, 2013 06:54PM
Bodhi:
Good suggestions. Thanks.
I have USBs that can boot into Dockstar. Will that work?
Edit:
Yes, it does. I plugged in a Dockstar USB and it booted fine. Thank you and others for your patiant guidance.
The LED doesn't light. Any information on the LED setting?



Edited 2 time(s). Last edit at 03/12/2013 01:50PM by twinclouds.
Re: [Pogoplug Mobile] Install uBoot/Debian
March 11, 2013 12:06AM
Great!

If you can boot with the Dockstar USB, then your arcNumber is set at 2097. To be able to control the LEDs correctly, you'll need a kernel that supports arch number 3960 (and machid F78). See here: http://forum.doozan.com/read.php?2,11601.

Once you have the appropriate kernel installed, then you can set arcNumber and machid:

fw_setenv arcNumber 3960
fw_setenv machid F78

- bodhi
Re: [Pogoplug Mobile] Install uBoot/Debian
March 11, 2013 04:06PM
Bodhi:
The USB always booted fine. However, I cannot make the SD card work. I tried to use serial console to see what's things going on, then I found that at some stage of booting, the output become random characters. It then stoped somewhere and hit return didn't do anything. I tried the good booting USB, the results were the same (random ouput) even though it still worked. I tried to install Davy's rootfs as you suggested previously (NSA320quickstart.tar.gz?). it didn't have the random character problem but stopped booting because it couldn't read some files there. Have you tried it before on Pogo Mobile or do you can suggest another rootfs that I can try?
Re: [Pogoplug Mobile] Install uBoot/Debian
March 11, 2013 05:36PM
Twinclouds,

what do you mean by "random characters"? Does that happen with the serial connected? If so, what you probably have to do is kill the terminal where you are running screen, unplug the serial cable from the master computer, plug it back in and start screen again in a new terminal.

I am saying this, because something similar happened to me, it looked like "random" characters but was obviously just every nth character of what the pogo (in my case an e02) was writing. After the above procedure, everything was back to normal.

So, in short, disconnect, reconnect and start a new screen-session for every boot!

Cheers,

chessplayer

---
Standart ist der Standardfehler
Re: [Pogoplug Mobile] Install uBoot/Debian
March 11, 2013 05:54PM
Chessplayer:
Yes, it was the serial connection.
As for what you suggested, I did that already but no joy. What happened was that, after some short time, the output stopped. I hit the return and no response. If I disconnect and then connect, there's no responce anyway.
The funny thing is it only happen for pogo mobile. Connecting to Dockstar and anything else, e.g., TP-Link routers, using the same cable was alway fine.
Re: [Pogoplug Mobile] Install uBoot/Debian
March 11, 2013 08:50PM
Twinclouds, did you try swapping Tx and Rx?
Re: [Pogoplug Mobile] Install uBoot/Debian
March 11, 2013 09:32PM
I generated a new wheezy installation on Dockstar and then used on Pogo Mobile. The serial interface works fine now. I will try to see if it will work on SD card and let you guys know. Thank you all for your help.

I tried the SD card boot. It still didn't work. This is what I tried. First, I use a microSD card in a USB adapter and put the wheezy rootfs on it. I plugged USB adapter with the microsd card into Pogo Mobile's USB connector, it worked fine. Then I put the microsd card in and microsd to sd converter and put it into the sd slot. The boot process then stopped.
Here is the booting log:

[Edit] I have made it work eventually (see below). I deleted the print out to save other people's time.

It stopped here.
Looks like the booter cannot find the root device. Looks like it tried to find it at the USB port but not the SD card slot? Anybody know how to fix this problem?



Edited 5 time(s). Last edit at 03/12/2013 01:47PM by twinclouds.
Re: [Pogoplug Mobile] Install uBoot/Debian
March 11, 2013 10:43PM
Let's see your output of fw_printenv!
Re: [Pogoplug Mobile] Install uBoot/Debian
March 11, 2013 11:05PM
bodhi Wrote:
-------------------------------------------------------
> Let's see your output of fw_printenv!

Here it is the fw_printenv output:

[Edit] Again, I don't these are needed anymore.



Edited 1 time(s). Last edit at 03/12/2013 01:48PM by twinclouds.
Re: [Pogoplug Mobile] Install uBoot/Debian
March 12, 2013 01:29AM
O.K. Eventually, I made it work after I modified the envs given by dhead666 in here: http://archlinuxarm.org/forum/viewtopic.php?f=18&t=4987!

Specifically, I added some envs related to mmc and changed mmc_bootcmd according dhead666 by doing the following:
fw_setenv mmc_root /dev/mmcblk0p1
fw_setenv mmc_set_bootargs 'setenv bootargs console=$console root=$mmc_root'
fw_setenv mmc_boot 'mw 0x800000 0 1; ext2load mmc 0:1 0x00800000 /boot/uImage; if ext2load mmc 0:1 0x01100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi'
fw_setenv mmc_bootcmd 'mmc init; mmc init; run mmc_set_bootargs; run mmc_boot'
Next, I would like to see if I make the LED work according to what Bodhi said.



Edited 1 time(s). Last edit at 03/12/2013 12:36PM by twinclouds.
Re: [Pogoplug Mobile] Install uBoot/Debian
March 12, 2013 02:14PM
bodhi Wrote:
-------------------------------------------------------
> Great!
>
> If you can boot with the Dockstar USB, then your
> arcNumber is set at 2097. To be able to control
> the LEDs correctly, you'll need a kernel that
> supports arch number 3960 (and machid F78). See
> here: http://forum.doozan.com/read.php?2,11601.
>
> Once you have the appropriate kernel installed,
> then you can set arcNumber and machid:
>
> fw_setenv arcNumber 3960
> fw_setenv machid F78
>
> - bodhi
Bodhi:
I tried to install the deb file (refered in your another post) on my Pogo Mobile to make the LED work. I put it in the root directly (/) and did dpkg - ....deb. However, at the end, I got the following error:
"..........
Processing triggers for flash-kernel ...
Kernel suffix tld does not match any of the expected flavors (kirkwood), therefore not writing it to flash."
Do you know why and how to fix it?
Re: [Pogoplug Mobile] Install uBoot/Debian
March 12, 2013 08:38PM
Re: [Pogoplug Mobile] Install uBoot/Debian
March 12, 2013 09:27PM
bodhi,

Thank you for your kernel as it works perfectly on my two e02s for a while now.

I just wonder why symlink vmlinuz and initird.img in the last step as I removed them on one of my e02 and seems does not make any difference.

Cheers,

Yong
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: