m2oTech.com

  • Increase font size
  • Default font size
  • Decrease font size

Installing SHR on Openmoko Freerunner GTA02

Print PDF

In my last post I described how to setup a few things on the Freerunner by using the shipped OM2008 distribution, including USB networking.

This time I set out to install a new distribution, the SHR, by far the most used distro on Freerunner according to the wiki page. It promises to be relatively stable and complete.

I decide to install SHR on a 2GB microSD card which I inserted into the Openmoko, so I follow the instructions on how to install it there. Basically we need to create two partitions, one for the kernel (a small one, either FAT16 or ext2) and a bigger one for the filesystem (ext2 and ext3).

I will not repeat the steps here as I think the guide is clear enough. In order to boot from SD card through the uBoot bootloader we follow this guide. Although some suggest using a different bootloader Qi I stick to uBoot for the time being.

However I decided not to follow the default and install the kernel on a ext2 partition instead of a FAT16 (or vfat). Therefore there was no entry in the bootloader, since the only one available expects a FAT16 as the kernel partition, while I had a ext2. So I needed to access the boot loader shell and create a new entry.

To make changes into the bootloader through USB connection I used the neocon tool, which I really recommend as it saves a lot of hassles you will encounter using a general purpose serial console program like minicom.

Download sources, compile it and run

neocon -t 30 /dev/ttyACM0


The program keeps polling to check whether the device is present so we can start it earlier and then connect the device. To start the Freerunner device and send it to boot loader menu we need to press the power button, keep it pressed, press the AUX button (red button on top), keep both pressed for a couple of seconds. Then use the boot loader entry to set the console to USB.

Before making changes I print the environment variables (GTA02v6 is the bootloader prompt and printenv is the command to type):

GTA02v6 # printenv
boot_menu_timeout=300
int1=0x80
pcf50otfstype=jffs2 root=/dev/mtdblock6 console=ttySAC2,115200 console=tty0 loglevel=8 regular_boot
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel 0x200000; bootm 0x32000000
bootdelay=1
menu_1=Boot from microSD (FAT+ext2): setenv bootargs ${bootargs_base} rootfstype=ext2 root=/dev/mmcblk0p2 rootdelay=5 ${mtdparts} ro; mmcinit; fatload mmc 1 0x32000000 ${sd_image_name}; bootm 0x32000000
menu_2=Set console to USB: setenv stdin usbtty; setenv stdout usbtty; setenv stderr usbtty
menu_3=Set console to serial: setenv stdin serial; setenv stdout serial; setenv stderr serial
menu_4=Set console to USB: setenv stdin usbtty; setenv stdout usbtty; setenv stderr usbtty
menu_5=Set console to serial: setenv stdin serial; setenv stdout serial; setenv stderr serial
menu_6=Reboot: reset
menu_8=Power off: neo1973 power-off
mtdids=nor0=physmap-flash,nand0=neo1973-nand
mtdparts=mtdparts=physmap-flash:-(nor);neo1973-nand:0x00040000(u-boot),0x00040000(u-boot_env),0x00800000(kernel),0x000a0000(splash),0x00040000(factory),0x0f6a0000(rootfs)
quiet=1
sd_image_name=uImage.bin
splashimage=nand read.e 0x32000000 splash 0x5000; unzip 0x32000000 0x8800000 0x96000
stderr=usbtty
stdin=usbtty
stdout=usbtty
usbtty=cdc_acm
partition=nor0,0
mtddevnum=0
mtddevname=nor
pcf50633_int1=0x80
pcf50633_int2=0x02

Environment size: 1374/262140 bytes

Then I change the timeout so that we don't need to keep pressing buttons on the phone to prevent it from shutting down while making changes (this is strictly optional):

setenv boot_menu_timeout=30000

My purpose is to boot SHR from microSD card with the kernel on a ext2 partition and the filesystem on a ext3 (the default boot loader entry expects a fat16 for the kernel, that's why I need to create another entry).

We can add a new menu entry like this (just modify a bit the original one):

NB: needed to add the "sleep 1" instruction (as suggested on the webpage) or else kernel would fail to load

setenv menu_9 Boot from microSD part2 (ext2+ext3): setenv bootargs \${bootargs_base} rootfstype=ext3 root=/dev/mmcblk0p2 rootdelay=5 \${mtdparts}\; mmcinit\; sleep 1\; ext2load mmc 1 0x32000000 \${sd_image_name}\; bootm 0x32000000

Now the environment looks like this:

GTA02v6 # printenv
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock6 console=ttySAC2,115200 console=tty0 loglevel=8 regular_boot
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel 0x200000; bootm 0x32000000
bootdelay=1
menu_1=Boot from microSD (FAT+ext2): setenv bootargs ${bootargs_base} rootfstype=ext2 root=/dev/mmcblk0p2 rootdelay=5 ${mtdparts} ro; mmcinit; fatload mmc 1 0x32000000 ${sd_image_name}; bootm 0x32000000
menu_2=Set console to USB: setenv stdin usbtty; setenv stdout usbtty; setenv stderr usbtty
menu_3=Set console to serial: setenv stdin serial; setenv stdout serial; setenv stderr serial
menu_4=Set console to USB: setenv stdin usbtty; setenv stdout usbtty; setenv stderr usbtty
menu_5=Set console to serial: setenv stdin serial; setenv stdout serial; setenv stderr serial
menu_6=Reboot: reset
menu_8=Power off: neo1973 power-off
mtdids=nor0=physmap-flash,nand0=neo1973-nand
mtdparts=mtdparts=physmap-flash:-(nor);neo1973-nand:0x00040000(u-boot),0x00040000(u-boot_env),0x00800000(kernel),0x000a0000(splash),0x00040000(factory),0x0f6a0000(rootfs)
quiet=1
sd_image_name=uImage.bin
splashimage=nand read.e 0x32000000 splash 0x5000; unzip 0x32000000 0x8800000 0x96000
stderr=usbtty
stdin=usbtty
stdout=usbtty
usbtty=cdc_acm
partition=nor0,0
mtddevnum=0
mtddevname=nor
pcb_rev=0x305
pcf50633_int1=0x80
pcf50633_int2=0x03
boot_menu_timeout=30000
menu_9=Boot from microSD part2 (ext2+ext3): setenv bootargs ${bootargs_base} rootfstype=ext3 root=/dev/mmcblk0p2 rootdelay=5 ${mtdparts}; mmcinit; sleep1; ext2load mmc 1 0x32000000 ${sd_image_name}; bootm 0x32000000
Environment size: 1580/262140 bytes

Reboot the phone and access the boot loader again (press power button, keep it down, press AUX button, keep it down), then choose the newly created entry and SHR should load. It will take some time and when done the welcome screen should appear.

Now I don't seem to be very lucky with this distro so far. The GSM (phone calls, messages, ...) doesn't seem to work, no network is found and the little icon in the upper right corner keeps showing either "None" or "SOS only". An operator scan in the Settings page does not show any operator even though the SIM is recognized. I don't know what could be wrong about that as all bugs found about this seemed to have been fixed. The wi-fi doesn't work either, the phone seems to get stuck when searching wireless networks.

The USB connection works, similarly to what it did in OM2008. The difference is that instead of being recognized as usb0 on Linux desktop it is now shown as eth2 and therefore the commands to connect to it from Linux computer should be something like:

(NB: the eth2 will likely be different on other systems, I have two ethernet cards, therefore eth0 and eth1 are taken, on most systems this could be eth1)

# to set the ip address of usb0 eth2 interface (openmoko)
ip address add 192.168.0.200/24 dev eth2

# to start openmoko connection
ip link set dev eth2 up

# to login into openmoko with ssh (this is the default ip address on openmoko)
ssh This e-mail address is being protected from spambots. You need JavaScript enabled to view it

After connecting to the internet this way (and changing the appropriate settings in the firewall if necessary) I could update the SHR distro:

opkg update

opkg upgrade

Some downloading later the system was happily up to date but my GSM connection problems still not solved. What would be next distro to try? I am thinking about QtMoko. In the meantime I can still boot into the original OM2008 installed in the phone internal memory. All I have to do is let the phone boot by itself without entering the boot loader.

Last Updated on Tuesday, 10 August 2010 10:43  

Add your comment

Your name:
Subject:
Comment:
  The word for verification. Lowercase letters only with no spaces.
Word verification: