David Kalnischkieshttps://david.kalnischkies.de/blog/tags/reminderstaticsite2011-07-29T06:44:46Zapt-get a life: posts tagged reminderReturn of the Shiva IIhttps://david.kalnischkies.de/blog/2011/Return_of_the_Shiva_22011-07-29T06:44:46Z2011-07-29T06:44:46Z
<p>(this is just a fancy reminder for myself for the next time I trash my sheeva)</p>
<p><a
href="http://www.cyrius.com/debian/kirkwood/sheevaplug/uboot-upgrade.html">Upgrading
the u-boot of the sheevaplug is super easy.</a></p>
<p>In the unlikely event that something goes wrong and you trashed the u-boot, so
that the sheeva doesn't respond to anything anymore, don't panic! It's not to
hard to flash u-boot again without a working instance on the device itself.</p>
<p>First of all, install <a href="https://tracker.debian.org/pkg/openocd">openocd</a> on whatever you have
left working (e.g. your laptop), ensure that the usb cable is still
well-connected and open three shells, one root (#) and two users ($).</p>
<div class="codehilite"><pre><span></span><code>$ screen /dev/ttyUSB0 <span class="m">115200</span>
<span class="c1"># openocd -f /usr/share/openocd/scripts/board/sheevaplug.cfg</span>
$ telnet localhost <span class="m">4444</span>
Trying <span class="m">127</span>.0.0.1...
Connected to localhost.
Escape character is <span class="s1">'^]'</span>.
Open On-Chip Debugger
> sheevaplug_init
target state: halted
target halted <span class="k">in</span> ARM state due to debug-request, current mode: Supervisor
cpsr: 0x000000d3 pc: 0xffff0000
MMU: disabled, D-Cache: disabled, I-Cache: disabled
> nand probe <span class="m">0</span>
NAND flash device <span class="s1">'NAND 512MiB 3.3V 8-bit (Hynix)'</span> found
> nand erase <span class="m">0</span> 0x0 0xa0000
erased blocks <span class="m">0</span> to <span class="m">5</span> on NAND flash device <span class="c1">#0 'NAND 512MiB 3.3V 8-bit'</span>
> nand write <span class="m">0</span> /tmp/u-boot.kwb <span class="m">0</span> oob_softecc_kw
> resume
</code></pre></div>
<p>(especially the 'nand write' needs a bit of time and produces no output, so
calm down, that's okay)</p>
<p>In the first shell with the tty connection we should see now our lovely u-boot
again!</p>
<p>Watch out, for me on this try, u-boot claimed that my configuration was broken
and used its default. Not a problem for me, i just redid what is described on
the install page above: (I would have needed to anyway, as 'mmcinit' changed to
'mmc init')</p>
<div class="codehilite"><pre><span></span><code><span class="o">>></span><span class="w"> </span><span class="n">setenv</span><span class="w"> </span><span class="n">bootargs_console</span><span class="w"> </span><span class="n">console</span><span class="o">=</span><span class="n">ttyS0</span><span class="p">,</span><span class="mi">115200</span><span class="w"></span>
<span class="o">>></span><span class="w"> </span><span class="n">setenv</span><span class="w"> </span><span class="n">bootcmd_mmc</span><span class="w"> </span><span class="s1">'mmc init; ext2load mmc 0:1 0x00800000 /uImage; ext2load mmc 0:1 0x01100000 /uInitrd'</span><span class="w"></span>
<span class="o">>></span><span class="w"> </span><span class="n">setenv</span><span class="w"> </span><span class="n">bootcmd</span><span class="w"> </span><span class="s1">'setenv bootargs $(bootargs_console); run bootcmd_mmc; bootm 0x00800000 0x01100000; reset'</span><span class="w"></span>
<span class="o">>></span><span class="w"> </span><span class="n">saveenv</span><span class="w"></span>
</code></pre></div>
<p>'reset' is added by me to restart the sheeva in case the bootcmd failed.
'mmcinit' used to fail sometimes with the old u-boot, now it seems to be
better, but you can never be sure…</p>
<p>So, relatively easy: Welcome back sheeva!</p>
<p>Let's see then I am able to trash it again…</p>
<p>Disclaimer: Yes, the upgrade description linked above is completely correct and
should work flawless for everyone. Seems like I overlooked a 'FAT entry
invalid' message or something like that so I flashed nothing to the place
u-boot belongs to…</p>
<p>P.S.: New posts related to APT changes? Mhhh. Not too soon, but i will try…</p>
<p><small><a rel="canonical" href="https://david.kalnischkies.de/blog/2011/Return_of_the_Shiva_2">This article</a> was written by David Kalnischkies on <a href="https://david.kalnischkies.de">apt-get a life</a> and republished here by pulling it from a syndication feed. You should check there for updates and more articles about hardware and reminder.</small></p>