<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Marcin Juszkiewicz - brick</title><link href="https://marcin.juszkiewicz.com.pl/" rel="alternate"/><link href="https://marcin.juszkiewicz.com.pl/tag/brick/feed/" rel="self"/><id>https://marcin.juszkiewicz.com.pl/</id><updated>2012-07-13T10:25:00+02:00</updated><entry><title>Unbricked my old SheevaPlug</title><link href="https://marcin.juszkiewicz.com.pl/2012/07/13/unbricked-my-old-sheevaplug/" rel="alternate"/><published>2012-07-13T10:25:00+02:00</published><updated>2012-07-13T10:25:00+02:00</updated><author><name>Marcin Juszkiewicz</name></author><id>tag:marcin.juszkiewicz.com.pl,2012-07-13:/2012/07/13/unbricked-my-old-sheevaplug/</id><summary type="html">&lt;p&gt;Few months ago one of my friends borrowed SheevaPlug from me. About two weeks later he gave it back &amp;#8212; &lt;em&gt;bricked&lt;/em&gt;&amp;#8230; I did not had time to play with it so it landed on&amp;nbsp;shelf.&lt;/p&gt;
&lt;p&gt;Yesterday I took it and decided to get it back to live.&amp;nbsp;Requirements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;bricked SheevaPlug (v1 …&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;p&gt;Few months ago one of my friends borrowed SheevaPlug from me. About two weeks later he gave it back &amp;#8212; &lt;em&gt;bricked&lt;/em&gt;&amp;#8230; I did not had time to play with it so it landed on&amp;nbsp;shelf.&lt;/p&gt;
&lt;p&gt;Yesterday I took it and decided to get it back to live.&amp;nbsp;Requirements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;bricked SheevaPlug (v1.0 without &lt;span class="caps"&gt;SATA&lt;/span&gt;)&lt;/li&gt;
&lt;li&gt;power&amp;nbsp;cable&lt;/li&gt;
&lt;li&gt;mini usb&amp;nbsp;cable&lt;/li&gt;
&lt;li&gt;usb thumb&amp;nbsp;drive&lt;/li&gt;
&lt;li&gt;OpenOCD (&amp;#8220;apt-get install&amp;nbsp;openocd&amp;#8221;)&lt;/li&gt;
&lt;li&gt;cross compiler (&amp;#8220;apt-get install gcc-arm-linux-gnueabi&amp;#8221; under&amp;nbsp;Ubuntu)&lt;/li&gt;
&lt;li&gt;U-Boot sources (&lt;span class="caps"&gt;HEAD&lt;/span&gt; of&amp;nbsp;mainline)&lt;/li&gt;
&lt;li&gt;Linux sources (also &lt;span class="caps"&gt;HEAD&lt;/span&gt; of&amp;nbsp;mainline)&lt;/li&gt;
&lt;li&gt;serial terminal (picocom, minicom, screen&amp;nbsp;etc)&lt;/li&gt;
&lt;li&gt;few terminals or terminal multiplexer (I used&amp;nbsp;tmux)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Connected power and mini usb cables to SheevaPlug. Desktop recognized usb-serial device as&amp;nbsp;/dev/ttyUSB1.&lt;/li&gt;
&lt;li&gt;Connected to it with serial terminal. Nothing appeared there of course&amp;nbsp;;)&lt;/li&gt;
&lt;li&gt;Run OpenOCD: &amp;#8220;cd /tmp/;sudo openocd -f /usr/share/openocd/scripts/board/sheevaplug.cfg -s /usr/share/openocd/scripts&amp;#8221;. SheevaPlug was&amp;nbsp;detected.&lt;/li&gt;
&lt;li&gt;Connected to OpenOCD: &amp;#8220;telnet localhost&amp;nbsp;4444&amp;#8221;.&lt;/li&gt;
&lt;li&gt;Built&amp;nbsp;U-boot:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;export CROSS_COMPILE=arm-linux-gnueabi-
make mrproper
make sheevaplug_config
make u-boot.kwb
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Copied &amp;#8220;u-boot&amp;#8221; to &amp;#8220;/tmp/uboot.elf&amp;#8221; and used &amp;#8220;reset;sheevaplug_init;load_image u-boot.elf;resume 0x00600000&amp;#8221; &amp;#8212; landed in U-Boot&amp;nbsp;;)&lt;/li&gt;
&lt;li&gt;There is &amp;#8220;sheevaplug_reflash_uboot&amp;#8221; macro but it was not working for me. So I used U-Boot to flash&amp;nbsp;itself:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Marvell&amp;gt;&amp;gt; usb start
Marvell&amp;gt;&amp;gt; fatload usb 0:1 0x0800000 u-boot.kwb
Marvell&amp;gt;&amp;gt; nand erase 0x0 0xa0000
Marvell&amp;gt;&amp;gt; nand write 0x0800000 0x0 0xa0000
Marvell&amp;gt;&amp;gt; reset
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Went to Ångström online image builder and built small busybox based&amp;nbsp;image.&lt;/li&gt;
&lt;li&gt;Unpacked tarball into /tmp/initfs, added /dev/ttyS0&amp;nbsp;node.&lt;/li&gt;
&lt;li&gt;Built Linux&amp;nbsp;kernel:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;export CROSS_COMPILE=arm-linux-gnueabi-
make mrproper
make kirkwood_config
make menuconfig (set INITRAMFS_SOURCE to /dev/initfs)
make uImage
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Copied &amp;#8220;arch/arm/boot/uImage&amp;#8221; to &lt;span class="caps"&gt;USB&lt;/span&gt; thumb drive and inserted it into&amp;nbsp;SheevaPlug.&lt;/li&gt;
&lt;li&gt;Booted&amp;nbsp;image:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Marvell&amp;gt;&amp;gt; set ethaddr 'c0:ff:ee:c0:ff:ee'
Marvell&amp;gt;&amp;gt; set bootargs 'console /dev/ttyS0,115200 rw'
Marvell&amp;gt;&amp;gt; usb start;fatload usb 0:1 0x800000 /uImage;bootm 0x800000
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Landed in nice and small Ångström distribution image&amp;nbsp;;)&lt;/li&gt;
&lt;li&gt;Went to Ångström online image builder and built console image (task-base&amp;nbsp;based).&lt;/li&gt;
&lt;li&gt;Built Linux kernel (this time without&amp;nbsp;initramfs):&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;export CROSS_COMPILE=arm-linux-gnueabi-
make menuconfig (unset INITRAMFS_SOURCE)
make uImage
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Copied &amp;#8220;arch/arm/boot/uImage&amp;#8221; to &lt;span class="caps"&gt;USB&lt;/span&gt; thumb drive and inserted it into&amp;nbsp;SheevaPlug.&lt;/li&gt;
&lt;li&gt;Prepare &lt;span class="caps"&gt;NAND&lt;/span&gt; for &lt;span class="caps"&gt;UBI&lt;/span&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;# mount none /dev -t devtmpfs
# udhcpc eth0
# opkg-cl update
# opkg-cl install mtd-utils
# ubiformat /dev/mtd2
# ubiattach -p /dev/mtd2
# ubimkvol /dev/ubi0 -N rootfs -s 490MiB
# ubiupdatevol /dev/ubi0_0 /media/sda1/angstrom-task-base.ubifs
# mount -t ubifs ubi0:rootfs /media/rootfs
# chown -R root:root /media/rootfs
# cp /media/sda1/uImage /media/rootfs/boot
# sync
# reboot
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Another reconfiguration in&amp;nbsp;U-Boot:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Marvell&amp;gt;&amp;gt; bootargs 'console=ttyS0,115200 rw ubi.mtd=2 rootfstype=ubifs root=ubi:rootfs'
Marvell&amp;gt;&amp;gt; bootcmd 'ubi part nand0,2; ubifsmount rootfs; ubifsload 0x800000 /boot/uImage;bootm 0x800000'
Marvell&amp;gt;&amp;gt; mtdids 'nand0=orion_nand'
Marvell&amp;gt;&amp;gt; set mtdparts 'mtdparts=orion_nand:512k(uboot),4m@1m(kernel),507m@5m(rootfs)'
Marvell&amp;gt;&amp;gt; save
Marvell&amp;gt;&amp;gt; reset
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And now my SheevaPlug is operational again. Boots from &lt;span class="caps"&gt;NAND&lt;/span&gt; with latest U-Boot and Linux. There is around &lt;span class="caps"&gt;440MB&lt;/span&gt; free still on &lt;span class="caps"&gt;NAND&lt;/span&gt; (not counting &lt;span class="caps"&gt;4MB&lt;/span&gt; partition where kernel was expected to be). I can put it back on shelf&amp;nbsp;now.&lt;/p&gt;
&lt;p&gt;The only parts which I needed to compile were U-Boot and Linux kernel. I could skip bootloader and use binary image from Internet but prefer to know what my machines run (and building U-Boot is really easy). Initramfs support in Linux is real live saver as I did not had to play with initrd etc &amp;#8212; just build image and boot it. The only problem was that devtmpfs was not auto mounted (even if option in kernel was&amp;nbsp;selected).&lt;/p&gt;
&lt;p&gt;I could also use one of those &amp;#8220;easy installers&amp;#8221; made by PlugComputer community but I found such solutions more complicated (fetching binaries, finding requirements etc) than the one I&amp;nbsp;used.&lt;/p&gt;</content><category term="angstrom"/><category term="brick"/><category term="linaro"/><category term="openembedded"/><category term="sheevaplug"/></entry><entry><title>Sharp Zaurus JTAG cable</title><link href="https://marcin.juszkiewicz.com.pl/2006/08/09/sharp-zaurus-jtag-cable/" rel="alternate"/><published>2006-08-09T07:47:00+02:00</published><updated>2006-08-09T07:47:00+02:00</updated><author><name>Marcin Juszkiewicz</name></author><id>tag:marcin.juszkiewicz.com.pl,2006-08-09:/2006/08/09/sharp-zaurus-jtag-cable/</id><summary type="html">&lt;p&gt;From time to time people are asking about schematics of &lt;span class="caps"&gt;JTAG&lt;/span&gt; cable for Zaurus machines. Such cable can be used to restore flash memory content after destroying&amp;nbsp;it.&lt;/p&gt;
&lt;p&gt;For all models newer then collie (&lt;span class="caps"&gt;SL&lt;/span&gt;-5000/5500) there is a hope still as they are much harder to brick. User …&lt;/p&gt;</summary><content type="html">&lt;p&gt;From time to time people are asking about schematics of &lt;span class="caps"&gt;JTAG&lt;/span&gt; cable for Zaurus machines. Such cable can be used to restore flash memory content after destroying&amp;nbsp;it.&lt;/p&gt;
&lt;p&gt;For all models newer then collie (&lt;span class="caps"&gt;SL&lt;/span&gt;-5000/5500) there is a hope still as they are much harder to brick. User can enter &amp;#8220;Diagnostics menu&amp;#8221; via magic keycombo (which usually is holding &amp;#8220;D&amp;#8221; and &amp;#8220;P&amp;#8221; during Power key on boot) and then use &amp;#8220;&lt;span class="caps"&gt;NAND&lt;/span&gt; Restore&amp;#8221; function (&lt;span class="caps"&gt;NAND&lt;/span&gt; Backups are available in few places &amp;#8212; &lt;a href="http://www.trisoft.de/"&gt;TRIsoft&lt;/a&gt; is one of&amp;nbsp;them).&lt;/p&gt;
&lt;p&gt;Anyway below you should see schematics of such cable &amp;#8212; taken from collie service manual. On Zaurus side you have to use Hoshiden &lt;span class="caps"&gt;TCX3106&lt;/span&gt; connector (docs were available on Sharp Deutschland website) and is available for few &lt;span class="caps"&gt;USD&lt;/span&gt; in Five Star Associates. How to use cable? Do not ask me &amp;#8212; I never had to use &lt;span class="caps"&gt;JTAG&lt;/span&gt;.&lt;/p&gt;
&lt;figure id="__yafg-figure-1"&gt;
&lt;img alt="Sharp Zaurus JTAG cable schematics" loading="lazy" src="/files/2006/08/jtag.jpg" title="Sharp Zaurus JTAG cable schematics"&gt;
&lt;figcaption&gt;Sharp Zaurus &lt;span class="caps"&gt;JTAG&lt;/span&gt; cable schematics&lt;/figcaption&gt;
&lt;/figure&gt;</content><category term="brick"/><category term="jtag"/><category term="schematics"/><category term="zaurus"/></entry></feed>