Updating Ben NanoNote software

From Qi-Hardware
Revision as of 17:40, 27 April 2010 by Vegyraupe (Talk | contribs)
Jump to: navigation, search

Contents

xburst-tools

install

First, download and install usbboot from the xburst-tools package: go here to download the package you need.

deb package:

$ dpkg -i xburst-tools_0.0+201002-1_i386.deb

bin tarball:

$ sudo tar jxvf xburst-tools_0.0+201002-1_i386.bin.tar.bz2 -C /

uninstall

deb package:

$  sudo aptitude remove xburst-tools 

bin tarball:

$  sudo rm -f  /usr/local/bin/usbboot
$  sudo rm -f  /usr/local/man/man1/usbboot.1.gz
$  sudo rm -rf /usr/local/etc/xburst-tools/
$  sudo rm -rf /usr/local/share/xburst-tools/

usage

  • usbboot [options] ... (must run as root)
 -h --help            Print this help message
 -v --version         Print the version number
 -c --command         Direct run the commands, split by ';'
 -f --configure       configure file path
 <run without options to enter commands via usbboot prompt>

sub-command:

  • boot
before run nprog and nerase. we should upload xburst_stage1 and xburst_stage2 to device.
  • nprog (1) (2) (3) (4) (5)
(1)    start page number 
(2)    image file name 
(3)    device index number 
(4)    flash index number 
(5)    image type must be:
    -n:    no oob
    -o:    with oob no ecc
    -e:    with oob and ecc
  • nerase (1) (2) (3) (4)
(1)    start block number 
(2)    block length 
(3)    device index number
(4)    flash chip index number

Example

  • Erase the whole nand with the command:
$ sudo usbboot -c "boot;nerase 0 4096 0  0"
  • Reflash just the u-boot:
$ sudo usbboot -c "boot;nprog 0 openwrt-xburst-u-boot.bin 0 0 -n"
  • Reflash just the kernel partition with
$ sudo usbboot -c "boot;nprog 1024  openwrt-xburst-uImage 0 0  -n"
  • Reflash just the rootfs partition with
$ sudo usbboot -c "boot;nprog 2048  openwrt-xburst-qi_lb60.ubi 0 0 -n"

How to reflash

DO NOT USE A USB HUB. Make sure your NanoNote is directly connected to a Linux PC

DO NOT USE LINUX VIRTUAL MACHINE running in your Windows or MacOS pc


Get the reflash_ben.sh script and make it executable (you only need to do this once per system you want to reflash from, unless the reflash script changes) via the following commands:

$ wget http://downloads.qi-hardware.com/software/images/Ben_NanoNote_2GB_NAND/reflash_ben.sh
$ chmod +x reflash_ben.sh

Boot your NanoNote into USB BOOT mode. As soon as lsusb (on your Linux PC) lists a new device, run reflash_ben.sh. This will download some pre-built images and (re)flash the NanoNote.

$ sudo  ./reflash_ben.sh

Afterwards, reboot your NanoNote. First, you will see

- preinit -                                                                     
Press CTRL-C for failsafe

After a while, you will see Please press Enter to activate this console. on the console of your NanoNote.

Alternative to using the reflash_ben.sh script

Situation

I had tried to use the reflash script a number of times without a lot of success. I found myself having to run "reflash_ben.sh -b" to install the boot, then "reflash_ben.sh -k" to install the kernel, separately. One day even that didn't work.

Solution

Before beginning the following steps, ensure that you've downloaded the latest files into a working directory and that you execute the commands from that directory

  1. Take the battery out, unplug the USB cable, keep your NanoNote totally disconnected for a minute or so
  2. Use the carbonized rubber button to connect the usb boot pins in the battery compartment
  3. On your Linux machine, run 'watch lsusb'.
  4. Short the USB boot pins, connect the USB cable (don't use a hub)
  5. The numbers 601a:4740 should show up. if not, press the power button (still holding the USB boot pins closed/shorting)
  6. Now, from the working directory on the host, run 'usbboot'
  7. Next, type "boot"
  8. Then "nerase 0 4096 0 0" This will erase your device. you only need to do this once
  9. Next, we will flash u-boot Run "nprog 0 openwrt-xburst-u-boot.bin 0 0 -n" (u-boot goes to page 0, Linux kernel to page 1024, rootfs to page 2048)
  10. Next, we will flash the kernel Run "nprog 1024 openwrt-xburst-uImage.bin 0 0 -n"
  11. Finally, the rootfs Run "nprog 2048 openwrt-xburst-qi_lb60-root.ubi 0 0 -n" This will take a while, up to 15 minutes. As it is working, you will see usbboot's loooong output scrolling down, some numbers slowly increasing.

Notes

Usbboot is not very robust. Neither on the side of the code that is running on the NanoNote, nor how it implements the USB protocol, nor on how it handles NAND. It's much better to let the Linux kernel do this. Unless there is a real new feature in u-boot, leave u-boot unchanged on your NanoNote now

Future Options

In the future, instead of following these instructions, you could buy a microSD card and try these steps.

  1. When a new kernel+rootfs comes out, flash it onto a microSD card, 2 partitions: partition1 = vfat = uImage, partition2 = ext2 = rootfs
  2. Then turn on your NanoNote, press 'm' to tell u-boot to boot from the microSD card. You only need a functioning u-boot in NAND for this to work. It will take the Linux kernel + rootfs from the microSD

You first boot from microSD, and you have the uImage.bin and .ubi files on the microSD. Then you use one of the several Linux NAND tools (I always use ubiformat but some people say mtd is better).

Known Errors

Personal tools
Namespaces
Variants
Actions
Navigation
interactive
Toolbox
Print/export