Differences

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

toh:iomega:iconnect [2013/02/16 17:26]
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 83: Line 83:
Extract zip to c:\tftpd, create folder c:\tftpd\files. Extract zip to c:\tftpd, create folder c:\tftpd\files.
-Download from trunk repository:+Download from [[http://downloads.openwrt.org/snapshots/trunk/kirkwood/|trunk repository]] or final version if available:
<file> <file>
openwrt-kirkwood-uImage openwrt-kirkwood-uImage
Line 97: Line 97:
==== 4. Updating U-Boot ==== ==== 4. Updating U-Boot ====
<html> <html>
-<span style="color:red;">!!! This is risky operation which can brick your iConnect.  !!!</span>+<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>\\ </html>\\
-Please first skip to next point and continue with you current U-Boot.\\ 
-If you will be having problems with running OpenWRT then come back here.\\ 
Even when you brick it, you may use JTAG connector to bring it live.\\ Even when you brick it, you may use JTAG connector to bring it live.\\
Line 114: Line 114:
printenv printenv
</code> </code>
-you will see all env variables copy it and save to text file it will be needed later.+you will see all env variables, copy it and save to text file it will be needed later.
=== 4.2 Flashing new U-Boot === === 4.2 Flashing new U-Boot ===
Line 126: Line 126:
<code> <code>
mw 0x0800000 0xffff 0x100000 mw 0x0800000 0xffff 0x100000
-nand erase 0x0 0x100000 
tftp 0x0800000 openwrt-kirkwood-iconnect-u-boot.kwb tftp 0x0800000 openwrt-kirkwood-iconnect-u-boot.kwb
 +nand erase 0x0 0x100000
nand write 0x0800000 0x0 0x100000 nand write 0x0800000 0x0 0x100000
</code> </code>
Line 136: Line 136:
iconnect => setenv ipaddr 192.168.1.200 iconnect => setenv ipaddr 192.168.1.200
iconnect => mw 0x0800000 0xffff 0x100000 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 iconnect => tftp 0x0800000 openwrt-kirkwood-iconnect-u-boot.kwb
Using egiga0 device Using egiga0 device
Line 150: Line 144:
done done
Bytes transferred = 401136 (61ef0 hex) 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 iconnect => nand write 0x0800000 0x0 0x100000
Line 240: Line 240:
<code> <code>
setenv machid 'B36' setenv machid 'B36'
 +setenv arcNumber '2870'
setenv loadaddr '0x6400000' setenv loadaddr '0x6400000'
setenv console 'console=ttyS0,115200 panic=20' setenv console 'console=ttyS0,115200 panic=20'
Line 256: Line 257:
setenv flash_rootfs 'nand erase 0x500000 0xfb00000; nand write.e $(loadaddr) 0x500000 0x200000;' setenv flash_rootfs 'nand erase 0x500000 0xfb00000; nand write.e $(loadaddr) 0x500000 0x200000;'
-setenv bootcmd 'setenv bootargs $(console) $(bootargs_root); nand read $(loadaddr) 0x100000 0x400000; bootm $(loadaddr)'+setenv load_openwrt 'setenv bootargs $(console) $(bootargs_root); nand read $(loadaddr) 0x100000 0x400000; bootm $(loadaddr)
 +setenv bootcmd 'run load_openwrt'
saveenv saveenv
</code> </code>
Line 456: Line 458:
More about network configuration: [[http://wiki.openwrt.org/doc/uci/network|Network Wiki]] 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.1361031985.txt.bz2 · Last modified: 2013/02/16 17:26 by pawelw