Tom and I have been working on some code to replace msp430-gdbproxy, which is a piece of closed source software that we regularly use to program and debug MSP430 microcontrollers. The atmosphere at 25C3 encouraged the continuation of this effort, and we can now successfully reprogram MSP430s using it. We’ll be releasing it as FOSS as soon as possible once we’ve ascertained that there are no legal issues with us doing so. I’m sure that you can understand the reasons for such caution here.
In the future, we’d like to be able to prove that we had got to this point by this date. Therefore, we’re publishing the SHA1 (160-bit) hash of the source code right now, and will later publish the code that it goes with. That hash is:
And in order to remind myself which git commit this maps to in my repository, it’s commit: 894dde86e14b824e16540908e9138ee944abafcf.
Jeff‘s just finished giving his excellent presentation about the Formica robots at 25C3. We were really surprised by the demand to buy these things. We might be persuaded to sell some robots if the demand is really high enough — either as kits or fully assembled devices.
So, please send an email to firstname.lastname@example.org if you are interested in purchasing some in the future! We’ll get back to you if we receive enough interest.
Edit: Alternatively, register your interest by posting a comment below and leave your email address so we can get back to you.
Tom was in search of a faster way of typing “cd ../../..” and friends. He wrote a bash function that took a numeric argument. So with his script:
which is a reduction from 12 keypresses, including “return”, down to 5.
I felt that there was more to be done here. I had a feeling something could be done with readline. So I had a look around the readline documentation (see “info readline”) and found how to define macros for it. Then I stuck this in my readline inputrc file:
"\C-x1": "cd ../\n" "\C-x2": "cd ../../\n" "\C-x3": "cd ../../../\n" "\C-x4": "cd ../../../../\n" "\C-x5": "cd ../../../../../\n" "\C-x6": "cd ../../../../../../\n" "\C-x7": "cd ../../../../../../../\n" "\C-x8": "cd ../../../../../../../../\n" "\C-x9": "cd ../../../../../../../../../\n"
Looks ugly doesn’t it?! I couldn’t find a way of using a numeric argument within a macro, so I resorted to generating this above list with this Python:
for x in range(1,10): print '"\C-x%i": "cd %s\\n"'% (x, "../" * x)
So now with this, those 12 keypresses are further reduced to 3: Control-x 3. Note that the “enter” key doesn’t get pressed.
How to use
To use that, one needs to get it into an rc file for readline. On Fedora 10, this involves editing your “~/.bashrc” file to contain:
Then sticking the following in “~/.inputrc”:
"\C-x1": "cd ../\n" "\C-x2": "cd ../../\n" "\C-x3": "cd ../../../\n" "\C-x4": "cd ../../../../\n" "\C-x5": "cd ../../../../../\n" "\C-x6": "cd ../../../../../../\n" "\C-x7": "cd ../../../../../../../\n" "\C-x8": "cd ../../../../../../../../\n" "\C-x9": "cd ../../../../../../../../../\n" $include /etc/inputrc
It feels like this should be possible to make this neater by hooking into bash/readline in some way.
I’ve been working on some bits of software that’ll allow the firmware of an MSP430 to be updated via I2C. This will allow us to upgrade the firmware in all of the Student Robotics boards via the web. The firmware updates will be shipped out in the zip archives that our web-based IDE spits out when teams program their robots.
I got this mostly working in early September but I’ve only just got around to cleaning it up and making it usable. I’ve written a utility called “flashb” that, when configured correctly, just takes the name of the board to program and the two binaries necessary for the flashing. Here’s a demonstration screencast of it working:
In that video I’m loading new firmware into the JointIO board. I have an OSIF plugged into my laptop that is in turn connected to the JointIO board. I’ve reflashed this thing at least 50 times today without any failures, which bodes well for deployment.
“Why two binaries?” I hear you say. Each of these binaries only uses half of the MSP430’s flash. The two binaries contain the same code but one is linked to reside in the top half of flash and the other resides in the bottom half. Only one of these is executing at one particular time whilst the other can be overwritten with a later firmware version. I went for this approach for two reasons. Firstly, I’m new to writing bootloaders and so I decided to do something simple that could easily be slotted in with our existing code. Secondly, I had already written some of the code to do this for the Formica robots.
There’s still a lot of room for improvement, but I’ve almost achieved something that’s shippable. The code for the Formica robots was written so that they could gradually receive new firmware whilst still operating. Student Robotics doesn’t place this constraint on the bootloader. The firmware could stop operating and jump to a small bootloader, which would erase all flash except for itself. For now we’re not doing that. The time to consider that will be when we run into code size issues.
As with all of the Student Robotics code, the source for these things can be found in the Student Robotics subversion repository. The JointIO firmware can be grabbed by doing this:
svn co http://svn.srobo.org/boards/jointio/firmware/trunk/
Similarly, the flashb code can be accessed like so:
svn co http://svn.srobo.org/slug/utils/flashb/trunk/
I rebuilt the mspgcc packages for Fedora 10:
- msp430-binutils 2.18
- msp430-gcc 3.2.3
- msp430-libc (from CVS on 2008-08-28)
- msp430-gdb 6.8
- msp430-gdbproxy 0.7 (includes udev rule).
Once again, you’ll find the specfiles and source RPMs in the same directory.
You can install them all by running:
su -c "rpm -Uvh http://users.ecs.soton.ac.uk/rds/rpm/mspgcc/msp430-binutils-2.18-1.fc10.i386.rpm \ http://users.ecs.soton.ac.uk/rds/rpm/mspgcc/msp430-gcc-3.2.3-1.20080827cvs.fc10.i386.rpm \ http://users.ecs.soton.ac.uk/rds/rpm/mspgcc/msp430-libc-0-1.20080828cvs.fc10.noarch.rpm \ http://users.ecs.soton.ac.uk/rds/rpm/mspgcc/msp430-gdb-6.8-1.fc10.i386.rpm \ http://users.ecs.soton.ac.uk/rds/rpm/mspgcc/msp430-gdbproxy-0.7.1-1.fc10.i386.rpm"
Update (13/02/2009): msp430-binutils is now in Fedora (as I wrote in this post).
Site by Rob Gilton. © 2008 - 2019