Updating Ben with usbboot

From Qi-Hardware
Jump to: navigation, search


The usbboot tool is an alternative to using the reflash_ben.sh script.

Contents


In case you have trouble with the reflash_ben.sh script, manually executing the steps below is going to give you more insight in what is happening. You could also run reflash_ben.sh -b to install the boot-loader, then reflash_ben.sh -k to install the kernel, separately.

In case you're not able to enter USB BOOT mode by pressing [POWER]+[U] when the device is switched off, have a look at the hardware usb-boot mode.

[edit] Preparations on the Host

[edit] Obtaining the Tools

The usbboot tool is part of the xburst-tools and should be installed before proceeding.

[edit] Obtaining the Images

Before starting, obtain a set of software images from the download site. From the 2010-12-14 release onwards, the openwrt-xburst-qi_lb60-root.ubi file is compressed as openwrt-xburst-qi_lb60-root.ubi.bz2, so when you download this file manually you should uncompress it as follows:

bunzip2 openwrt-xburst-qi_lb60-root.ubi.bz2

[edit] Performing the Boot Process

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. Make sure NanoNote is booted in USB BOOT mode
  2. Now, from the working directory on the host at a shell prompt (typically $), run the following command:
    usbboot
    
    This should change the prompt to usbboot#.
  3. Boot the device
    boot
    
  4. Erase it (this will erase the entire NAND storage area; you only need to do this once theoretically if don’t want to lose all data in the NAND storage):
    nerase 0 4096 0 0
    

    If you wish to only erase rootfs-related blocks (caution still required!), you must do the following instead:

    nerase 16 1024 0 0
    

    If you wish to only erase bootloader-related blocks:

    nerase 0 8 0 0
    

    It appears that erasure of the NAND before programming is necessary, so make sure that you erase the appropriate regions before flashing.

  5. Next, we will flash u-boot (u-boot goes to page 0, Linux kernel to page 1024, rootfs to page 2048):
    nprog 0 openwrt-xburst-qi_lb60-u-boot.bin 0 0 -n
    
  6. Next, we will flash the kernel:
    nprog 1024 openwrt-xburst-qi_lb60-uImage.bin 0 0 -n
    
  7. Finally, the rootfs. This will take a while, up to 15 minutes. I, Jane, always run 'bunzip2' on the downloaded file before flashing it. As it is working, you will see usbboot's long output scrolling down, some numbers slowly increasing.
    nprog 2048 openwrt-xburst-qi_lb60-root.ubi 0 0 -n
    
  8. For a sense of finality, quit usbboot with 'exit'
    exit
    

[edit] Notes

  • usbboot is not very robust, neither 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. To look at how the Ben can be updated from within Linux, see Updating_Ben_with_an_SD.
  • Unless there is a real new feature in u-boot, it is safer not to update it.
  • If one of the nprog steps doesn't work right away, just try again; or exit and restart usbboot, then issue the same nprog command again.

[edit] Known Errors

 Error - no XBurst device found

This means that usbboot cannot find an XBurst device (such as the Ben NanoNote) attached to USB. At this point, disconnect your device and restart the device in USB BOOT mode and check with lsusb if you can find the device. The following should appear in place of the above error if usbboot successfully found the device:

 Now checking whether all configure args valid: YES
 Current device information:
 CPU type is Ingenic XBurst Jz4740
Personal tools
Namespaces
Variants
Actions
Navigation
interactive
Toolbox
Print/export