Wednesday, April 30, 2008

Upcoming Boost::Graph Requirement

Heads up! Beginning with the (not-yet-committed) r58, msp430static will require the Boost::Graph module from CPAN.

Sunday, April 27, 2008

r57 with Standard Library Hashes

R57 includes a major new feature. A hashed function symbol library has been committed to the subversion repository. If I have a copy of a function, and you have that function in an example program, you can now recover it with a single command after initialization!

Consider the following example, wherein a stripped LED blinker is loaded and its symbols recovered.
karen% msp430-objdump -D blink.exe | m4s init
Reading library hashes.
Reading code.
karen% m4s .symbols.recover
karen% m4s .funcs
4000 .text
403a __ctors_end
403e _unexpected_
404c __nesc_atomic_start
4060 __nesc_atomic_end
4068 4068
4084 Msp430TimerCapComP
4094 Msp430TimerCapComP
40a4 Msp430TimerCapComP
40b4 40b4
40fa 40fa
4118 CC2420ControlM
411a 411a
41da SchedulerBasicP
4230 4230
432e TransformCounterC
43a4 Msp430TimerP
43b8 43b8
43dc 43dc
4568 MSP430ClockM
4584 MotePlatformC
459c 459c
45ea 45ea
46a2 46a2
475a TransformAlarmC
4798 AlarmToTimerC
47dc VirtualizeTimerC
482c 482c
48a2 48a2
4910 Msp430ClockP
497c SchedulerBasicP
4994 McuSleepC
4a58 __stop_progExec__
Revision 57 includes hashed symbols for TinyOS, Contiki, GNU's libc, and ImageCraft ICCV7's libc. If you have access to other libraries, please send me the file produced by m4s .contribute.lib after inputing the library.

(Note that msp430static only includes one-way hashes of library functions. This is more spartan than the fingerprint format used for privately-imported libraries, but it's necessary to comply with copyright law.)

--Travis Goodspeed
<travis at>

Saturday, April 26, 2008

r54 insshort()

I've added a sub for shortening assembly code. It contains less information than the long-hand variety, but it's handy for blog postings and diagrams. insflow() and fnflow() now use this by default.

m4s> select insshort(asm) from code limit 20;
4000: mov #23168, &0x0120
4006: mov #19036, r15
400a: mov #4352, r14
400e: mov #4354, r13
4012: cmp r14, r13
4014: jz $+12
4016: mov.b @r15+, 0(r14)
401a: inc r14
401c: cmp r13, r14
401e: jnc $-8
4020: mov #4354, r15
4024: mov #4407, r13
4028: cmp r15, r13
402a: jz $+12
402c: mov.b #0, 0(r15)
4030: inc r15
4032: cmp r13, r15
4034: jnc $-8
4036: br #0x43dc


Wednesday, April 23, 2008

r52 with Flow Diagrams

I've added flow graphs to msp430static, though they can use a bit of work. The following is a flow digram of __nesc_atomic_end from TinyOS 2.x:

This was generated by:
echo "select fnflow(asm) from funcs
where name like '__nesc_atomic_end';" |
m4s sql |
dot -Tps2 -o

Saturday, April 12, 2008

r50 with .contribute.bsl, default shell, and a revised

Revision 50 has been committed. I've added the .contribute.bsl macro, made the "shell" directive default, and added a revised memory mapper macro.

The new memmap macro draws FFFFFFFF areas--which are likely uninitialized flash--as black. '.word ????' code--which I find large expanses of in some ripped images--are grey. This coloring should only be apparent on code which has been dumped from a chip, as most compilers leave such expanses undefined. I also fixed the ragged edge and overlapping pixel bugs. A screenshot of the default programming of the MSP-EXP430FG4618 kit follows.

The shell directive is now default, so typing "m4s shell" can now be shortened to "m4s" if no parameters are necessary.
karen% svn update
At revision 50.
karen% m4s
msp430static r50
from Sat, 12 Apr 2008

Copyright (c) 2008, Travis Goodspeed <travis at>

This program is free software. You can distribute it and/or modify it
under the terms of the GNU General Public License version 2.
m4s sql>

I'm interested in the BSL code of the various msp430 chips. If you use msp430static on a ROM image recovered from a physical device, please run the following script to send me the chip's BSL code:
m4s sql> .contribute.bsl                                                        
BSL found for chipid=f46f.
Please email ./bsl_f46f.txt.gz to <tmgoodspeed at>
with 'CONTRIBUTE_BSL f46f' as the title.
m4s sql>

--Travis Goodspeed
<travis at>

Announcing the MSP430static Blog

Rather than polluting my own blog with msp430static minutia, I've decide to create this site. This will mostly be for announcements, such as feature additions. Long articles will remain on my own blog.

--Travis Goodspeed
<travis at>