Differences

This shows you the differences between two versions of the page.

toh:iomega:iconnect [2013/02/02 15:10]
pawelw
toh:iomega:iconnect [2013/07/08 11:15] (current)
pawelw
Line 3: Line 3:
===== Supported Versions ===== ===== Supported Versions =====
-^ Version/Model ^ S/N ^ Launch Date ^ OpenWrt Version Supported ^ Model Specific Notes ^ +^ Version/Model ^ S/N ^ OpenWrt Version Supported ^ Model Specific Notes ^ 
-| all | - | trunk,WIP | - | - |+| All | - | Attitude Adjustment 12.09| - |
Line 42: Line 42:
This may be important when you connect USB storage.\\ This may be important when you connect USB storage.\\
If many devices are connected at once then they will be mounted according to numeration of port. If many devices are connected at once then they will be mounted according to numeration of port.
 +===== Flash Layout =====
 +
 +^          OpenWrt FlashLayout          ^^^^^^
 +^ mtd#    | mtd0      | mtd0        | mtd1            | mtd2      | mtd3      |
 +^ Start    | 0x00000  | 0x080000    |0x100000        | 0x0400000 | 0x02400000 |
 +^ End      | 0x80000  | 0x100000    |0x400000        | 0x2400000 | 0x20000000 |
 +^ Size    | 0x80000  | 0x20000      |0x300000        | 0x2000000 | 0x17600000 |
 +^ Size MiB | 800KB    | 200KB        |4                | 32        | 473    |
 +^ Name    | U-Boot    | U-Boot env  |uImage (kernel)  | rootfs    | data      |
 +^ File system  | //none// | //none// | //none//        | JFFS2    |  |
 +
 +===== Installation of OpenWRT from Trunk =====
 +
 +This tutorial assumes that you are using Windows 7 OS.
 +You will need:\\
 +[[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html|PuTTY]]\\
 +[[http://winscp.net/|WinSCP]]\\
 +[[http://tftpd32.jounin.net|tftpd]]\\
 +[[http://downloads.openwrt.org/snapshots/trunk/kirkwood/|Files from Trunk]]
 +==== 1. Connect Serial Cable ====
 +
 +Using description above connect serial cable to board and establish connection with serial console using PuTTY.
 +
 +==== 2. Connecting LAN ====
 +Connect LAN cable between your computer and iConnect.
 +
 +Set computer IP to 192.168.1.5
 +
 +Go to Start -> Control Panel -> Network and Sharing Center -> Local Area connection -> Properties -> Internet Protocol Version 4(TCP/IPv4)
 +
 +Choose "Use the following IP address" and set:
 +<code>
 +IP address: 192.168.1.5
 +Subnet mask: 255.255.255.0
 +</code>
 +
 +Confirm by clicking OK.
 +
 +==== 3. Tftp server configuration ====
 +Extract zip to c:\tftpd, create folder c:\tftpd\files.
 +
 +Download from [[http://downloads.openwrt.org/snapshots/trunk/kirkwood/|trunk repository]] or final version if available:
 +<file>
 +openwrt-kirkwood-uImage
 +openwrt-kirkwood--jffs2-128k.img
 +openwrt-kirkwood-iconnect-u-boot.kwb
 +</file>
 +and copy them to c:\tftpd\files.
 +
 +Run tftpd, click "Settings" button, choose TFTP tab and set "Base Directory" to c:\tftpd\files, click OK button.
 +
 +Check if "Server interface" is 192.168.1.5, if not choose it from the list.
 +
 +==== 4. Updating U-Boot ====
 +<html>
 +<span style="color:red;">!!! This is risky operation which can brick your iConnect.  !!!<br/>
 +Please first skip to next point and continue with you current U-Boot.<br/>
 +If you will be having problems with running OpenWRT then come back here.</span>
 +</html>\\
 +Even when you brick it, you may use JTAG connector to bring it live.\\
 +
 +=== 4.1 Backup your env settings ===
 +
 +Power up iConnect and watch serial console output. When you notice:
 +
 +<code>
 +Hit any key to stop autoboot:  0
 +</code>
 +press enter. Then type:
 +<code>
 +printenv
 +</code>
 +you will see all env variables, copy it and save to text file it will be needed later.
 +
 +=== 4.2 Flashing new U-Boot ===
 +Set tftp server and iConnect IP addresses.
 +<code>
 +setenv serverip 192.168.1.5
 +setenv ipaddr 192.168.1.200
 +</code>
 +
 +Flash new U-Boot
 +<code>
 +mw 0x0800000 0xffff 0x100000
 +tftp 0x0800000 openwrt-kirkwood-iconnect-u-boot.kwb
 +nand erase 0x0 0x100000
 +nand write 0x0800000 0x0 0x100000
 +</code>
 +
 +Result should be similar to this:
 +<code>
 +iconnect => setenv serverip 192.168.1.5
 +iconnect => setenv ipaddr 192.168.1.200
 +iconnect => mw 0x0800000 0xffff 0x100000
 +iconnect => tftp 0x0800000 openwrt-kirkwood-iconnect-u-boot.kwb
 +Using egiga0 device
 +TFTP from server 192.168.1.5; our IP address is 192.168.1.200
 +Filename 'openwrt-kirkwood-iconnect-u-boot.kwb'.
 +Load address: 0x800000
 +Loading: ############################
 +done
 +Bytes transferred = 401136 (61ef0 hex)
 +
 +iconnect => nand erase 0x0 0x100000
 +
 +NAND erase: device 0 offset 0x0, size 0x100000
 +Erasing at 0xe0000 -- 100% complete.
 +OK
 +
 +iconnect => nand write 0x0800000 0x0 0x100000
 +
 +NAND write: device 0 offset 0x0, size 0x100000
 + 1048576 bytes written: OK
 +</code>
 +
 +If there were no errors then type reset.
 +<code>
 +reset
 +</code>
 +
 +If your iConnect does not bring up (blue diode don't blink), something went wrong and it is bricked.
 +Don't be scary there is a way to bring it up, you must use JTAG connector, see article Flashing U-Boot with JTAG.
 +
 +
 +==== 5. Default U-Boot configuration ====
 +
 +To prevent any problems caused by old environment configuration it is best to reset them to default values.
 +
 +Here is a default configuration of first run U-Boot.
 +<code>
 +iconnect => printenv
 +baudrate=115200
 +bootargs_root=noinitrd ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs
 +bootcmd=setenv bootargs ${console} ${mtdparts} ${bootargs_root}; ubi part rootfs; ubifsmount rootfs; ubifsload 0x800000 ${kernel}; bootm 0x800000
 +bootdelay=3
 +console=console=ttyS0,115200
 +ethact=egiga0
 +kernel=/boot/uImage
 +mtdids=nand0=orion_nand
 +mtdparts=mtdparts=orion_nand:0x80000@0x0(uboot),0x20000@0x80000(uboot_env),-@0xa0000(rootfs)
 +stderr=serial
 +stdin=serial
 +stdout=serial
 +
 +Environment size: 487/131068 bytes
 +</code>
 +
 +There are two ways to do that.
 +
 +=== 5.1 Remove unwanted env (safe way) ===
 +To remove env variables use:
 +<code>
 +setenv env_name ''
 +</code>
 +
 +reapeat for each variable to remove.
 +
 +=== 5.2 Erase flash where env is stored (little bit risky) ===
 +To force U-Boot to recreate whole env with basic configuration you may erase this part of flash memory. It can be risky if env storage location is changed with future version and you erase part of U-Boot.
 +
 +Execute:
 +<code>
 +nand erase 0x80000 0x100000
 +reset
 +</code>
 +
 +After reset you will get two errors:
 +<code>
 +*** Warning - bad CRC, using default environment
 +Warning: failed to set MAC address
 +</code>
 +To fix it you must restore MAC address (search for ethaddr in your backup file) and save env values:
 +<code>
 +setenv ethaddr '00:D0:##:##:##:##'
 +saveenv
 +reset
 +</code>
 +
 +After restart you shouldn't see any errors.
 +
 +==== 6. Flash OpenWRT with fresh U-Boot ====
 +
 +=== 6.1 Setting up environment ===
 +
 +Find in your backup file MAC address, variable ethaddr.
 +
 +Now add MAC, set server IP to 1.5, and iConnect IP to 1.200, save and restart:
 +<code>
 +setenv ethaddr '00:D0:##:##:##:##'
 +setenv serverip '192.168.1.5'
 +setenv ipaddr '192.168.1.200'
 +saveenv
 +reset
 +</code>
 +
 +Set boot parameters:
 +<code>
 +setenv machid 'B36'
 +setenv arcNumber '2870'
 +setenv loadaddr '0x6400000'
 +setenv console 'console=ttyS0,115200 panic=20'
 +setenv bootargs_root 'root=/dev/mtdblock2 rootfstype=jffs2'
 +</code>
 +
 +Add scripts which will make flashing easy:
 +<code>
 +setenv kernel_name 'openwrt-kirkwood-uImage'
 +setenv rootfs_name 'openwrt-kirkwood--jffs2-128k.img'
 +
 +setenv download_kernel 'mw $(loadaddr) 0xffff 0x300000; tftp $(loadaddr) $(kernel_name);'
 +setenv flash_kernel 'nand erase 0x100000 0x400000; nand write.e $(loadaddr) 0x100000 0x400000;'
 +
 +setenv download_rootfs 'mw $(loadaddr) 0xffff 0x200000; tftp $(loadaddr) $(rootfs_name);'
 +setenv flash_rootfs 'nand erase 0x500000 0xfb00000; nand write.e $(loadaddr) 0x500000 0x200000;'
 +
 +setenv load_openwrt 'setenv bootargs $(console) $(bootargs_root); nand read $(loadaddr) 0x100000 0x400000; bootm $(loadaddr)'
 +setenv bootcmd 'run load_openwrt'
 +saveenv
 +</code>
 +
 +
 +=== 6.2 Flashing images ====
 +Flash images by executing:
 +<code>
 +run download_kernel
 +run flash_kernel
 +run download_rootfs
 +run flash_rootfs
 +reset
 +</code>
 +
 +Results:
 +<code>
 +iconnect => run download_kernel
 +Using egiga0 device
 +TFTP from server 192.168.1.5; our IP address is 192.168.1.200
 +Filename 'openwrt-kirkwood-uImage'.
 +Load address: 0x6400000
 +Loading: #################################################################
 +        ######################
 +done
 +Bytes transferred = 1264864 (134ce0 hex)
 +
 +iconnect => run flash_kernel
 +
 +NAND erase: device 0 offset 0x100000, size 0x400000
 +Erasing at 0x4e0000 -- 100% complete.
 +OK
 +
 +NAND write: device 0 offset 0x100000, size 0x400000
 + 4194304 bytes written: OK
 +
 +connect => run download_rootfs
 +Using egiga0 device
 +TFTP from server 192.168.1.5; our IP address is 192.168.1.200
 +Filename 'openwrt-kirkwood--jffs2-128k.img'.
 +Load address: 0x6400000
 +Loading: #################################################################
 +        ##################################
 +done
 +Bytes transferred = 1443840 (160800 hex)
 +
 +iconnect => run flash_rootfs
 +
 +NAND erase: device 0 offset 0x500000, size 0xfb00000
 +Skipping bad block at  0x0b5a0000
 +Skipping bad block at  0x0b5e0000
 +Skipping bad block at  0x0b620000
 +Erasing at 0xffe0000 -- 100% complete.
 +OK
 +
 +NAND write: device 0 offset 0x500000, size 0x200000
 + 2097152 bytes written: OK
 +
 +reset
 +</code>
 +
 +=== 6.3 First boot ====
 +This is a bootlog from first start of OpenWRT:
 +<code>
 +U-Boot 2012.10 (Feb 12 2013 - 18:24:56) Iomega iConnect
 +
 +SoC:  Kirkwood 88F6281_A0
 +DRAM:  256 MiB
 +WARNING: Caches not enabled
 +NAND:  512 MiB
 +In:    serial
 +Out:  serial
 +Err:  serial
 +Net:  egiga0
 +Hit any key to stop autoboot:  0
 +
 +NAND read: device 0 offset 0x100000, size 0x400000
 + 4194304 bytes read: OK
 +## Booting kernel from Legacy Image at 06400000 ...
 +  Image Name:  Linux-3.3.8
 +  Image Type:  ARM Linux Kernel Image (uncompressed)
 +  Data Size:    1264640 Bytes = 1.2 MiB
 +  Load Address: 00008000
 +  Entry Point:  00008000
 +  Verifying Checksum ... OK
 +  Loading Kernel Image ... OK
 +OK
 +Using machid 0xb36 from environment
 +
 +Starting kernel ...
 +
 +Uncompressing Linux... done, booting the kernel.
 +[    0.000000] Booting Linux on physical CPU 0
 +[    0.000000] Linux version 3.3.8 (openwrt@OpenWRTBuild) (gcc version 4.6.4 20121210 (prerelease) (Linaro GCC 4.6-2012.12) ) #1 Wed Jan 30 08:21:48 MST 2013
 +[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
 +[    0.000000] CPU: VIVT data cache, VIVT instruction cache
 +[    0.000000] Machine: Iomega iConnect Wireless
 +
 +/* A lot of other lines */
 +
 +[  14.512806] NAND device: Manufacturer ID: 0xad, Chip ID: 0xdc (Hynix NAND 512MiB 3,3V 8-bit)
 +[  14.521316] Scanning device for bad blocks
 +[  14.633823] Bad eraseblock 1453 at 0x00000b5a0000
 +[  14.638673] Bad eraseblock 1455 at 0x00000b5e0000
 +[  14.643509] Bad eraseblock 1457 at 0x00000b620000
 +[  14.768850] Bad eraseblock 3075 at 0x000018060000
 +[  14.773689] Bad eraseblock 3077 at 0x0000180a0000
 +[  14.854509] Creating 4 MTD partitions on "orion_nand":
 +[  14.859696] 0x000000000000-0x000000100000 : "u-boot"
 +[  14.865801] 0x000000100000-0x000000400000 : "uImage"
 +[  14.871789] 0x000000400000-0x000002400000 : "rootfs"
 +[  14.877811] 0x000002400000-0x000020000000 : "data"
 +
 +/* A lot of other lines */
 +
 +[  16.409415] jffs2_scan_eraseblock(): End of filesystem marker found at 0x260000
 +[  16.416814] jffs2_build_filesystem(): unlocking the mtd device... done.
 +[  16.423471] jffs2_build_filesystem(): erasing all blocks after the end marker... done.
 +[  22.954602] JFFS2 notice: (1) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
 +[  22.974126] VFS: Mounted root (jffs2 filesystem) on device 31:2.
 +[  22.980637] Freeing init memory: 124K
 +- preinit -
 +Press the [f] key and hit [enter] to enter failsafe mode
 +- regular preinit -
 +- init -
 +
 +Please press Enter to activate this console.
 +
 +[Enter]
 +
 +BusyBox v1.19.4 (2013-02-12 18:25:46 UTC) built-in shell (ash)
 +Enter 'help' for a list of built-in commands.
 +
 +  _______                    ________        __
 + |      |.-----.-----.-----.|  |  |  |.----.|  |_
 + |  -  ||  _  |  -__|    ||  |  |  ||  _||  _|
 + |_______||  __|_____|__|__||________||__|  |____|
 +          |__| W I R E L E S S  F R E E D O M
 + -----------------------------------------------------
 + BARRIER BREAKER (Bleeding Edge, r35572)
 + -----------------------------------------------------
 +  * 1/2 oz Galliano        Pour all ingredients into
 +  * 4 oz cold Coffee        an irish coffee mug filled
 +  * 1 1/2 oz Dark Rum      with crushed ice. Stir.
 +  * 2 tsp. Creme de Cacao
 + -----------------------------------------------------
 +root@OpenWrt:/#
 +</code>
 +
 +We have working OpenWRT.
 +
 +==== 7. Accesing iConnect with SSH ====
 +To activate SSH you must first login with telnet.
 +
 +In PuTTY set:
 +<code>
 +IP: 192.168.1.1
 +Port: 23
 +Connection type: Telnet
 +</code>
 +
 +when logged in type:
 +<code>
 +passwd root
 +
 +Changing password for root
 +New password:
 +Retype password:
 +Password for root changed by root
 +</code>
 +
 +Telnet access will be disabled, SHH will be enabled.
 +
 +==== 8. Setting up Internet access ====
 +By default in OpenWRT network address is set to static 192.168.1.1 which may cause conflicts if you have router with the same address. We can change it.
 +
 +Using WinSCP (or vi) open file /etc/config/network
 +
 +If you want to keep it static just change ipaddr value.
 +
 +If you want to use DHCP in local network set it to:
 +<code>
 +config interface 'lan'
 +        option ifname 'eth0'
 +        option proto 'dhcp'
 +</code>
 +
 +If you want to use Internet connection from your provider change it to:
 +<code>
 +config interface 'wan'
 +        option ifname 'eth0'
 +        option proto 'dhcp'
 +        #option macaddr '00:30:##:##:##:##' #Optional
 +</code>
 +
 +WAN or LAN names make different from firewall point of view.
 +
 +Save it and reset iConnect.
 +
 +More about network configuration: [[http://wiki.openwrt.org/doc/uci/network|Network Wiki]]
 +
 +===== Flashing U-Boot with JTAG (unbricking bootloader) =====
 +
 +==== 1. Introduction ====
 +This tutorial will show how to flash U-Boot on Iomega iConnect using JTAG.\\
 +It is based on my own experience as I broke U-Boot by improper flashing using serial cable and tftp server.\\
 +\\
 +You might found already one tutorial here http://hardsoftmix.blogspot.com/2011/07/jtag-on-iconnect.html, it is written for OpenOCD 0.40
 + and works fine if you will use this version and your JTAG interface is working with it like [[http://www.amontec.com/jtagkey-tiny.shtml|Amontec JTAGkey-Tiny]].\\
 +\\
 +Since I bought my own JTAG interface [[http://www.distortec.com/jtag-lock-pick-tiny-2|JTAG-lock-pick Tiny 2]], which support is included since OpenOCD 0.61 and this version has some
 +changes in command names which makes it incompatible with old scripts, I decided to write my own tutorial. Additionally I will use
 +OpenOCD on Windows.
 +
 +==== 2. Hardware and software used ====
 +
 +Serial Interface based on board PL-2303 which originally was an USB cable for some old Nokia phone.\\
 +\\
 +JTAG interface used:\\
 +- [[http://www.distortec.com/jtag-lock-pick-tiny-2|JTAG-lock-pick Tiny 2]] ([[http://www.freddiechopin.pl/pl/download/category/5-jtag-lock-pick|manual, drivers, eeprom]]) - based on latest high speed version of [[http://www.ftdichip.com/Products/ICs/FT232H.htm|FT232HL]] chip, works with OpenOCD 0.61 and higher\\
 +- [[http://www.amontec.com/jtagkey-tiny.shtml|Amontec JTAGkey-Tiny]] - based on [[http://www.ftdichip.com/Products/ICs/FT2232D.htm|FT2232L]], works with OpenOCD 0.40 and higher\\
 +- [[http://www.kamami.pl/index.php?ukey=product&productID=68017|ZL30PRG]] (copy of ST-Link v1) - works with OpenOCD 0.61 and higher but only with ST ARMs so it is useless for iConnect (checked)\\
 +- see also [[http://openocd.sourceforge.net/doc/html/Debug-Adapter-Hardware.html#Debug-Adapter-Hardware|supported hardware list]] on OpenOCD page\\
 +\\
 +Software: OpenOCD [[http://openocd.sourceforge.net/|Linux]] / [[http://www.freddiechopin.pl/pl/download/category/4-openocd|Windows]]\\
 +
 +==== 3. Installing JTAG inteface in Windows ====
 +For FTDI chips there are at least four drivers avaliable. You may use:\\
 +\\
 +- FTDI [[http://www.ftdichip.com/Drivers/D2XX.htm|D2XX Direct drivers]]\\
 +- FTDI [[http://www.ftdichip.com/Drivers/VCP.htm|Virtual COM Port (VCP) drivers]]\\
 +- [[http://libusbx.org/|WinUSB]] (libusbx.org)\\
 +- [[http://sourceforge.net/apps/trac/libusb-win32/|libusb-win32]]\\
 +\\
 +It is quite confusing which one to choose.\\
 +As I read in manual for JTAG-lock-pick Tiny 2 best option is to use WinUSB drivers so I will use that one.\\
 +Amontec JTAGkey-Tiny works with libusb-win32.\\
 +\\
 +Instalation is simple, just connect JTAG to usb wait till system inform you that cannot find a drivers, then install it manually by device manager providing a patch to WinUSB drivers.\\
 +\\
 +In case that you have a problems with installing drivers or want to replace it use [[http://sourceforge.net/projects/libwdi/files/zadig/|Zadig]].\\
 +
 +==== 4. Installing OpenOCD in Windows ====
 +
 +Get latest stable version from [[http://www.freddiechopin.pl/pl/download/category/4-openocd|www.freddiechopin.pl]] page, 0.61 is current at this moment (February 2013) and will be used in this article.\\
 +Unzip it to C: and open openocd-0.6.1 folder.\\
 +Download {{:media:toh:iomega:iconnect:openocd.config.files.zip|board configuration files}} for OpenOCD:\\
 +- copy iconnect.cfg  to openocd\scripts\board\\
 +- copy iconnect_connection.cfg to openocd\bin or \openocd\bin-x64\\
 +
 +I have 64bit Windows 7 and will use bin-x64 since now.\\
 +
 +==== 5. Configuration ====
 +
 +Open openocd_iconnect.cfg find the line:\\
 +<code>
 +# Specify JTAG interface configuration file
 +source [find interface/ftdi/jtag-lock-pick_tiny_2.cfg]
 +</code>
 +browse C:\openocd-0.6.1\scripts\interface and find a cfg file whch describes yours interface and replace name.\\
 +
 +==== 6. Connecting with OpenOCD to board ====
 +
 +Hold "Shift" button and right click on bin-x64 folder and choose "Open command line here".\\
 +\\
 +Run:\\
 +<code>
 +openocd-x64-0.6.1.exe -f openocd_iconnect.cfg
 +</code>
 +You should see output similar to this:
 +
 +<code>
 +C:\openocd-0.6.1\bin-x64>openocd-x64-0.6.1.exe -f openocd_iconnect.cfg
 +Open On-Chip Debugger 0.6.1 (2012-10-07-10:39)
 +Licensed under GNU GPL v2
 +For bug reports, read
 +        http://openocd.sourceforge.net/doc/doxygen/bugs.html
 +Info : only one transport option; autoselect 'jtag'
 +trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
 +adapter_nsrst_delay: 200
 +jtag_ntrst_delay: 200
 +adapter speed: 6000 kHz
 +adapter_nsrst_assert_width: 1000
 +adapter_nsrst_delay: 200
 +debug_level: 1
 +    TargetName        Type      Endian TapName            State
 +--  ------------------ ---------- ------ ------------------ ------------
 + 0* feroceon.cpu      feroceon  little feroceon.cpu      running
 +target state: halted
 +target halted in ARM state due to debug-request, current mode: Supervisor
 +cpsr: 0x000000d3 pc: 0xffff0000
 +MMU: disabled, D-Cache: disabled, I-Cache: disabled
 +background polling: on
 +TAP: feroceon.cpu (enabled)
 +target state: halted
 +target halted in ARM state due to debug-request, current mode: Supervisor
 +cpsr: 0x000000d3 pc: 0xffff0000
 +MMU: disabled, D-Cache: disabled, I-Cache: disabled
 +</code>
 +
 +in case that you have got an error like this below, try again.
 +<code>
 +TARGET: feroceon.cpu - Not halted
 +
 +Runtime Error: openocd_iconnect.cfg:40:
 +in procedure 'script'
 +at file "embedded:startup.tcl", line 58
 +in procedure 'reset' called at file "openocd_iconnect.cfg", line 40
 +</code>
 +
 +If still not working go to //openocd_iconnect.cfg// and comment line //reset halt//, uncomment //reset run// and //soft_reset_halt//.\\
 +In case of further problems refer to OpenOCD manual section Reset Configuration.
 +
 +==== 7. Connect to OpenOCD telnet interface. ====
 +
 +You may use [[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html|PuTTY]] for that.\\
 +\\
 +Configure as follow:
 +<code>
 +Host Name: 127.0.0.1
 +Port: 4444
 +Connection type: Telnet
 +</code>
 +You may want to save configuration for future usage.\\
 +\\
 +Now click "Open" button, you should see welcome message:\\
 +<code>
 +Open On-Chip Debugger
 +>
 +</code>
 +
 +==== 8. First method - direct flash U-Boot ====
 +
 +Download U-Boot image openwrt-kirkwood-iconnect-u-boot.kwb from:\\
 +- OpenWRT trunk http://downloads.openwrt.org/snapshots/trunk/kirkwood/uboot-kirkwood-iconnect/\\
 +- or from stable branch http://downloads.openwrt.org/attitude_adjustment/ if already relased.\\
 +\\
 +Save it to C:\openocd-0.6.1\bin-x64\\
 +\\
 +Go to PuTTY session and execute:\\
 +<code>
 +iconnect_reflash_uboot
 +</code>
 +
 +If it works you are lucky, unfortunately it does not work for me. I keep getting error:
 +<code>
 +nand write 0 openwrt-kirkwood-iconnect-u-boot.kwb 0 oob_softecc_kw
 +timed out while waiting for target halted
 +error executing hosted NAND write
 +Unable to write data to NAND device
 +failed writing file openwrt-kirkwood-iconnect-u-boot.kwb to NAND flash 0 at offset 0x00000000
 +</code>
 +So I found second option.
 +
 +==== 9. Second method - booting U-Boot in RAM and flashing image using it. ====
 +
 +Download U-Boot image openwrt-kirkwood-iconnect-u-boot.kwb from:\\
 +- OpenWRT trunk http://downloads.openwrt.org/snapshots/trunk/kirkwood/uboot-kirkwood-iconnect/\\
 +- or from stable branch http://downloads.openwrt.org/attitude_adjustment/ if already relased.\\
 +\\
 +This is alternative to direct flashing which is not working in my case.\\
 +We will run U-Boot in RAM and flash it's image using U-Boot itself and tftp server.\\
 +\\
 +You need:\\
 +- serial cable installed and connected to board serial port\\
 +- download tftpd server ZIP file from here http://tftpd32.jounin.net/\\
 +
 +=== 9.1 Prepare network card settings ===
 +
 +Go to Start -> Control Pannel -> Network and Sharing Center -> Local Area connection -> Properties -> Internet Protocol Version 4(TCP/IPv4)
 +
 +Choose "Use the following IP address" and set:
 +
 +IP address: 192.168.1.5
 +Sybnet mask: 255.255.255.0
 +
 +Confirm by clicking OK.
 +
 +=== 9.2 Prepare tftpd server ===
 +
 +Extract tftpd zip to //c:\tftpd//, create folder //c:\tftpd\files//.
 +
 +Copy downloaded //openwrt-kirkwood-iconnect-u-boot.kwb// to //c:\tftpd\files//.
 +
 +Run tftpd, click "Settings" button, choose TFTP tab and set "Base Directory" to //c:\tftpd\files//, click OK button.
 +
 +Check if Server interface is 192.168.1.5, if not choose it from the list.
 +
 +=== 9.3 Runing U-Boot from RAM. ===
 +
 +Establish Connection with board as described in point 6 and 7.
 +
 +Using PuTTY connect to your serial cable, put window in visible area and monitor it.
 +
 +In OpenOCD telnet connection (established in point 7) run:
 +<code>
 +Open On-Chip Debugger
 +> iconnect_load_uboot_bin
 +</code>
 +
 +you should see this:
 +<code>
 +target state: halted
 +target halted in ARM state due to debug-request, current mode: Supervisor
 +cpsr: 0x000000d3 pc: 0xffff0000
 +MMU: disabled, D-Cache: disabled, I-Cache: disabled
 +use of EmbeddedICE dbgrq instead of breakpoint for target halt disabled
 +400620 bytes written at address 0x00600000
 +downloaded 400620 bytes in 18.702635s (20.918 KiB/s)
 +>
 +</code>
 +Then on serial console you will see booting U-Boot:
 +<code>
 +U-Boot 2012.10 (Feb 12 2013 - 18:24:56) Iomega iConnect
 +
 +SoC:  Kirkwood 88F6281_A0
 +DRAM:  128 MiB
 +WARNING: Caches not enabled
 +NAND:  512 MiB
 +*** Warning - bad CRC, using default environment
 +
 +In:    serial
 +Out:  serial
 +Err:  serial
 +Net:  egiga0
 +Warning: failed to set MAC address
 +
 +Hit any key to stop autoboot:  0
 +iconnect =>
 +</code>
 +Press enter key as soon as you will see "Hit any key to stop autoboot".
 +
 +=== 9.4 Configure basic env variables ===
 +
 +We need to set server address and iConnect address to establish communication.
 +
 +In Serial console execute:
 +<code>
 +setenv ethaddr '00:D0:01:01:01:01'
 +setenv serverip 192.168.1.5
 +setenv ipaddr 192.168.1.200
 +</code>
 +then:
 +<code>
 +mw 0x0800000 0xffff 0x100000
 +nand erase 0x0 0x100000
 +tftp 0x0800000 openwrt-kirkwood-iconnect-u-boot.kwb
 +nand write 0x0800000 0x0 0x100000
 +</code>
 +Here is an output which you will see:
 +<code>
 +iconnect => setenv ethaddr '00:D0:01:01:01:01'
 +iconnect => setenv serverip 192.168.1.5
 +iconnect => setenv ipaddr 192.168.1.200
 +iconnect => mw 0x0800000 0xffff 0x100000
 +iconnect => nand erase 0x0 0x100000
 +
 +NAND erase: device 0 offset 0x0, size 0x100000
 +Erasing at 0xe0000 -- 100% complete.
 +OK
 +
 +iconnect => tftp 0x0800000 openwrt-kirkwood-iconnect-u-boot.kwb
 +Using egiga0 device
 +TFTP from server 192.168.1.5; our IP address is 192.168.1.200
 +Filename 'openwrt-kirkwood-iconnect-u-boot.kwb'.
 +Load address: 0x800000
 +Loading: ############################
 +done
 +Bytes transferred = 401136 (61ef0 hex)
 +
 +iconnect => nand write 0x0800000 0x0 0x100000
 +
 +NAND write: device 0 offset 0x0, size 0x100000
 + 1048576 bytes written: OK
 +</code>
 +Now reset it by executing:
 +<code>
 +reset
 +</code>
 +After reset the blue LED should start blinking and on serial console you will see U-Boot boot messages.
 +
 +That's all your iConnect is unbricked.
 +
 +==== 10. Post rescue procedure. ====
 +
 +You should set basic env settings by executing:
 +<code>
 +setenv ethaddr '00:D0:##:##:##:##' #Put here your real MAC address
 +setenv serverip 192.168.1.5
 +setenv ipaddr 192.168.1.200
 +saveenv
 +</code>
 +For OpenWRT installation instructions see above.

Back to top

toh/iomega/iconnect.1359814217.txt.bz2 · Last modified: 2013/02/02 15:10 by pawelw