NWR04B: Not so easy
12 Feb 2005The continuing saga of the NWR04b, um, continues.
As I mentioned, I was looking at using the rmem
command on the
NWR firmware to read out memory and maybe figure out the checksum
code. I came up with a small expect script (well, grabbed
rddmm.exp and butchered it 'til it did what I wanted) to do just
that, but it seems to be a little buggy: after a while, the output
freezes. If I fire up minicom, I get a whole crapload of memory output
from the serial port -- the stuff the expect script had been reading
all along. It continues until I reset the board, but after that the
characters from the board are all messed up: you can see where the
menu and prompts are, but every other character or so is wrong. If I
exit minicom then start again, letting it reset the serial port in the
process, everything's fine. This makes me think my expect script is
maybe going too fast, or not grabbing the output fast enough, or
something else that just messes up the state of the serial port
temporarily.
I was going to work on it a bit and give it the option of starting at a particular offset (which would've taken a while, since I'm almost completely new to expect), but got distracted when I found the NWR's SEEKRIT MENU! At power-on, you see this prompt:
Got the 6HYNIX_16bits Flash ROM ADM5106
Boot:
Welp, turns out that if you hit the space bar three times right then, you get this menu:
Loader Menu ================
(a) Download POST ...
(b) Exit
Please enter your key :
Woohoo, a quick way to download ARMboot! Or so I hoped. (I did
try UP LEFT UP LEFT RIGHT RIGHT DOWN RIGHT UP LEFT
to see if that
would run Linux automagically, but no.)
First, a cross-compiling toolchain was needed. I found this page, which had both a fully-compiled toolchain ready to download, or a script that would build everything for you and required lots of mysterious patches to be downloaded in advance. Since I'm more manly than smart, I went for the script. (Though obviously I'm not that manly, since I was depending on a script in the first place...) I ran into troubles with uClibc, though -- for some reason, the script would just refuse to build it. Eventually, I just gave up and downloaded the pre-compiled version.
Now, on to the actual compiling of ARMboot. Codeman, the original
hacker, posted a bunch of files that included (I think) a
modified version of ARMboot for the chip on the NWR. A quick make
cx84200_config
and make
CROSS_COMPILE=/path/to/arm-uclinux-tools/bin/arm-uclinux- all
worked,
with a couple hiccups along the way. First off, I got this error:
cc1: error: invalid option `short-load-bytes'
A quick Google turned up this message from the CrossGCC project,
saying that this option had been renamed alignment-traps
. A bit of
script-fu took care of that:
find . -type f -exec grep -l short-load-bytes {} ; | xargs perl -i.bak -pe's/-mshort-load-bytes/-malignment-traps/'
God, I love Unix.
I tried make
again, and came up with this error:
flash.c: 181: error: label at end of compound statement
The code in question looked like this:
default:
printf("Unknown Chip Typen");
goto Done;
break;
}
/* Some stuff I'm leaving out... */
printf ("n");
Done:
}
I moved the Done:
label to before the
last printf
statement, and everything seemed to work fine: ARMboot
compiled, and I had armboot.bin
ready to go. Doubtless there's a
better way of doing that, but this seemed to work well enough for
now.
Now to try uploading:
Loader Menu
================
(a) Download POST ...
(b) Exit
Please enter your key : a
Downloading............PASS
Verifying file......file corrupt -- FAIL
Well, crap: I was able to upload it by Xmodem, as I suspected, but it's still checksumming the thing, which means I was busted again. I'm still not giving up, though. I'm hoping to figure out the checksum; I found this page, which has a lot of pointers on how to do it. I think I'll try some of the things he talks about and see if I can figure out more about the checksum.
3 Comments
From: Hugh Redelmeier
20-February-2005-08:14:07
The error about the placement of the label is due to more recent GCCs being more strict about enforcing C's rules. The fix you used changes the meaning of the program. The simplest change is simply to add a ";" after the label's ":". The idea is that labels go on statements; a closing brace is not a statement; a bare semicolon is a null statement.
BTW, I am reading this in the hope of finding what to do with our out-of-service NWR04b. I cannot even get the current firmware from Linksys; as it is, the router is not reliable. (When it was in service, it was used by UofW Math students -- I infer that you were one once.)
From: Saint Aardvark
20-February-2005-09:28:36
Aha -- thanks for the tip on GCC. It's always good to hear from someone who knows what they're doing. :-)
In case you didn't see them, there are lots of other entries in my blog about the NWR04b. Go to the main page (http://saintaardvarkthecarpeted.com/blog) and look for the NWR04b category. There's the wiki page too (http://saintaardvarkthecarpeted.com/wiki/index.php/Nwr04b) which needs to be updated.
There seems to be a few places to get firmware for this thing; the trick is that a lot of companies (Runtop, Network Everywhere, Repotec) have rebranded the same damn board. I haven't tried the other firmware yet, but it probably works. That said -- if you're not comfortable with the possibility of hosing your board, and having to solder together a serial port adapter, I wouldn't recommend trying them right now.
Eventually I hope to get Linux working on this board. Even better, I hope to have a file that can be uploaded to the board using its web pages, like a firmware upgrade. I'm not there yet, but stay tuned!
From: Saint Aardvark
20-February-2005-15:17:44
Oh, and I meant to mention: I took physics for two years at UW before failing out...my shameful secret is out at last! :-) I hung around a lot in the math building though. Have they still got that big pit full of mainframes on display?
Add a comment:
Name and email required; email is not displayed.
Related Posts
QRP weekend 08 Oct 2018
Open Source Cubesat Workshop 2018 03 Oct 2018
mpd crash? try removing files in /var/lib/mpd/ 11 Aug 2018