1 |
50 |
olivier.gi |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2 |
|
|
<html>
|
3 |
|
|
<head>
|
4 |
|
|
<title>openMSP430 Software Development Tools</title>
|
5 |
|
|
</head>
|
6 |
|
|
<body>
|
7 |
|
|
<h3>Table of content</h3>
|
8 |
|
|
<ul>
|
9 |
|
|
<li><a href="#1. Introduction"> 1. Introduction</a></li>
|
10 |
|
|
<li><a href="#2. openmsp430-loader"> 2. openmsp430-loader</a></li>
|
11 |
|
|
<li><a href="#3. openmsp430-minidebug"> 3. openmsp430-minidebug</a></li>
|
12 |
|
|
<li><a href="#4. openmsp430-gdbproxy"> 4. openmsp430-gdbproxy</a></li>
|
13 |
|
|
<li><a href="#5. MSPGCC Toolchain"> 5. MSPGCC Toolchain</a>
|
14 |
|
|
<ul>
|
15 |
|
|
<li><a href="#5.1 Some notes regarding msp430-gdb"> 5.1 Some notes regarding msp430-gdb</a></li>
|
16 |
|
|
<li><a href="#5.2 CPU selection for msp430-gcc"> 5.2 CPU selection for msp430-gcc</a></li>
|
17 |
|
|
</ul>
|
18 |
|
|
</li>
|
19 |
|
|
</ul>
|
20 |
|
|
|
21 |
|
|
<a name="1. Introduction"></a>
|
22 |
|
|
<h1>1. Introduction</h1>
|
23 |
|
|
|
24 |
|
|
Building on the serial debug interface capabilities provided by the openMSP430, three small utility programs are provided:
|
25 |
|
|
<ul>
|
26 |
|
|
<li><b>openmsp430-loader:</b> a simple command line boot loader.</li>
|
27 |
|
|
<li><b>openmsp430-minidebug:</b> a minimalistic debugger with simple GUI.</li>
|
28 |
|
|
<li><b>openmsp430-gdbproxy:</b> GDB Proxy server to be used together with MSP430-GDB and the Eclipse, DDD, or Insight graphical front-ends.</li>
|
29 |
|
|
</ul>
|
30 |
|
|
|
31 |
|
|
All these software development tools have been developed in TCL/TK and were successfully tested on both Linux and Windows XP.
|
32 |
|
|
<br /><br />
|
33 |
|
|
<b>Note:</b> in order to be able to directly execute the scripts, <a href="http://www.tcl.tk/software/tcltk/">TCL/TK</a> needs to be installed on your system. Optionally for Windows users, the scripts have been turned into single-file binary executable programs using <a href="http://freewrap.sourceforge.net/">freeWrap</a>.
|
34 |
|
|
|
35 |
|
|
|
36 |
|
|
<a name="2. openmsp430-loader"></a>
|
37 |
|
|
<h1>2. openmsp430-loader</h1>
|
38 |
|
|
|
39 |
|
|
This simple program allows the user to load the openMSP430 program memory with an executable file (ELF format) provided as argument.<br />
|
40 |
|
|
It is typically used in conjunction with '<b><i>make</i></b>' in order to automatically load the program after the compile step (see '<b><i>Makefile</i></b>' from software examples provided with the project's FPGA implementation).<br />
|
41 |
|
|
The program can be called with the following syntax:
|
42 |
|
|
<br /><br />
|
43 |
|
|
<table border="0" cellspacing="4" cellpadding="0">
|
44 |
|
|
<tr>
|
45 |
|
|
<td width="35"></td>
|
46 |
|
|
<td bgcolor="#d0d0d0" width="3"></td>
|
47 |
|
|
<td width="15"></td>
|
48 |
|
|
<td>
|
49 |
|
|
<code>openmsp430-loader.tcl [-device <communication device>] [-baudrate <communication speed>] <elf-file>
|
50 |
|
|
<br /><br />
|
51 |
|
|
Examples: openmsp430-loader.tcl -device /dev/ttyUSB0 -baudrate 9600 leds.elf<br />
|
52 |
|
|
openmsp430-loader.tcl -device COM2: -baudrate 38400 ta_uart.elf
|
53 |
|
|
</code>
|
54 |
|
|
</td>
|
55 |
|
|
</tr>
|
56 |
|
|
</table>
|
57 |
|
|
<br />
|
58 |
|
|
These screenshots show the script in action under Linux and Windows:
|
59 |
|
|
<br /><br />
|
60 |
|
|
<img src="getimg.php?1248897300" width="75%" alt="openmsp430-loader Linux" title="openmsp430-loader Linux" />
|
61 |
|
|
<br /><br />
|
62 |
|
|
<img src="getimg.php?1249244501" width="75%" alt="openmsp430-loader Windows" title="openmsp430-loader Windows" />
|
63 |
|
|
<br />
|
64 |
|
|
<a name="3. openmsp430-minidebug"></a>
|
65 |
|
|
<h1>3. openmsp430-minidebug</h1>
|
66 |
|
|
This small program provides a minimalistic graphical interface enabling simple interaction with the openMSP430:
|
67 |
|
|
<br /><br />
|
68 |
|
|
<img src="getimg.php?1248897416" width="65%" alt="openmsp430-minidebug" title="openmsp430-minidebug" />
|
69 |
|
|
<br /><br />
|
70 |
|
|
As you can see from the screenshot, it allows the following actions:
|
71 |
|
|
<ul>
|
72 |
|
|
<li><b><font color="#FF0000">(1)</font></b> Load the program memory with an ELF file</li>
|
73 |
|
|
<li><b><font color="#FF0000">(2)</font></b> Reset the CPU</li>
|
74 |
|
|
<li><b><font color="#FF0000">(3)</font></b> Stop/Start the program execution</li>
|
75 |
|
|
<li><b><font color="#FF0000">(4)</font></b> Read/Write access of the CPU registers</li>
|
76 |
|
|
<li><b><font color="#FF0000">(5)</font></b> Read/Write access of the whole memory range (program, data, peripherals)</li>
|
77 |
|
|
</ul>
|
78 |
|
|
|
79 |
|
|
<a name="4. openmsp430-gdbproxy"></a>
|
80 |
|
|
<h1>4. openmsp430-gdbproxy</h1>
|
81 |
|
|
The purpose of this program is to replace the '<b><i>msp430-gdbproxy</i></b>' utility provided by the mspgcc toolchain.<br />
|
82 |
|
|
Typically, a GDB proxy creates a local port for gdb to connect to, and handles the communication with the target hardware. In our case, it is basically a bridge between the RSP communication protocol from GDB and the serial debug interface from the openMSP430.<br />
|
83 |
|
|
Schematically the communication flow looks as following:
|
84 |
|
|
<br /><br />
|
85 |
|
|
<img src="getimg.php?1248897690" width="40%" alt="GDB Proxy flow" title="GDB Proxy flow" />
|
86 |
|
|
<br /><br />
|
87 |
|
|
Like the original '<b><i>msp430-gdbproxy</i></b>' program, '<b><i>openmsp430-gdbproxy</i></b>' can be controlled from the command line. However, it also provides a small graphical interface:
|
88 |
|
|
<br /><br />
|
89 |
|
|
<img src="getimg.php?1248897753" width="60%" alt="openmsp430-gdbproxy" title="openmsp430-gdbproxy" />
|
90 |
|
|
<br /><br />
|
91 |
|
|
These two additional screenshots show the script in action together with the Eclipse and DDD graphical frontends:
|
92 |
|
|
<br /><br />
|
93 |
|
|
<img src="getimg.php?1248897844" width="100%" alt="openmsp430-gdbproxy and Eclipse" title="openmsp430-gdbproxy and Eclipse" />
|
94 |
|
|
<br /><br />
|
95 |
|
|
<img src="getimg.php?1248897887" width="100%" alt="openmsp430-gdbproxy and DDD" title="openmsp430-gdbproxy and DDD" />
|
96 |
|
|
<br /><br />
|
97 |
|
|
<b>Tip:</b> There are several tutorials on Internet explaining how to configure Eclipse for the MSP430. As an Eclipse newbie, I found the followings quite helpful:
|
98 |
|
|
<ul>
|
99 |
|
|
<li><a href="http://matthias-hartmann.blogspot.com/2009/02/use-eclipse-and-mspgcc-easy-way.html">Use Eclipse and mspgcc - The easy way</a> (English)</li>
|
100 |
|
|
<li><a href="http://msp430.ms.funpic.de/doku.php?id=msp430:entwicklungumgebung">MSP430 - Entwicklungumgebung</a> (German)</li>
|
101 |
|
|
</ul>
|
102 |
|
|
|
103 |
|
|
<a name="5. MSPGCC Toolchain"></a>
|
104 |
|
|
<h1>5. MSPGCC Toolchain</h1>
|
105 |
|
|
|
106 |
|
|
<a name="5.1 Some notes regarding msp430-gdb"></a>
|
107 |
|
|
<h2>5.1 Some notes regarding msp430-gdb</h2>
|
108 |
|
|
|
109 |
|
|
As of today (July 2009), the GDB port for the MSP430 has some problems (<a href="http://www.nabble.com/Help-with-gdb-commands-td21942613.html">here</a>).<br />
|
110 |
|
|
The stepping over function is not available and the backtrace and finish commands don't work properly.<br />
|
111 |
|
|
There is fortunately a <a href="http://www.nabble.com/Useful-new-GDB-fixes-td19554922.html">patch</a> existing, and until it is included into GDB, I can only recommend to recompile GDB with it (I didn't try it for Windows but it is quite straight forward to do for Linux).
|
112 |
|
|
|
113 |
|
|
<a name="5.2 CPU selection for msp430-gcc"></a>
|
114 |
|
|
<h2>5.2 CPU selection for msp430-gcc</h2>
|
115 |
|
|
|
116 |
|
|
The following table aims to help selecting the proper <b>-mmcu</b> option for the <b>msp430-gcc</b> call.<br />
|
117 |
|
|
Note that the program memory size should imperatively match the openMSP430 configuration.
|
118 |
|
|
<br /><br />
|
119 |
|
|
<table align="center" border="1">
|
120 |
|
|
<tr align="center"><td><b>-mmcu option</b></td><td><b> Program <br />Memory</b></td><td><b>Data<br /> Memory </b></td></tr>
|
121 |
|
|
<tr align="center"><td colspan="3"><b><i>Program Memory Size: 1 kB</i></b></td></tr>
|
122 |
|
|
<tr align="center"><td>msp430x110 </td><td> 1 kB</td><td> 128 B</td></tr>
|
123 |
|
|
<tr align="center"><td>msp430x1101 </td><td> 1 kB</td><td> 128 B</td></tr>
|
124 |
|
|
<tr align="center"><td>msp430x2001 </td><td> 1 kB</td><td> 128 B</td></tr>
|
125 |
|
|
<tr align="center"><td>msp430x2002 </td><td> 1 kB</td><td> 128 B</td></tr>
|
126 |
|
|
<tr align="center"><td>msp430x2003 </td><td> 1 kB</td><td> 128 B</td></tr>
|
127 |
|
|
<tr align="center"><td>msp430x2101 </td><td> 1 kB</td><td> 128 B</td></tr>
|
128 |
|
|
<tr align="center"><td colspan="3"><b><i>Program Memory Size: 2 kB</i></b></td></tr>
|
129 |
|
|
<tr align="center"><td>msp430x1111 </td><td> 2 kB</td><td> 128 B</td></tr>
|
130 |
|
|
<tr align="center"><td>msp430x2011 </td><td> 2 kB</td><td> 128 B</td></tr>
|
131 |
|
|
<tr align="center"><td>msp430x2012 </td><td> 2 kB</td><td> 128 B</td></tr>
|
132 |
|
|
<tr align="center"><td>msp430x2013 </td><td> 2 kB</td><td> 128 B</td></tr>
|
133 |
|
|
<tr align="center"><td>msp430x2111 </td><td> 2 kB</td><td> 128 B</td></tr>
|
134 |
|
|
<tr align="center"><td>msp430x2112 </td><td> 2 kB</td><td> 128 B</td></tr>
|
135 |
|
|
<tr align="center"><td>msp430x311 </td><td> 2 kB</td><td> 128 B</td></tr>
|
136 |
|
|
<tr align="center"><td colspan="3"><b><i>Program Memory Size: 4 kB</i></b></td></tr>
|
137 |
|
|
<tr align="center"><td>msp430x112 </td><td> 4 kB</td><td> 256 B</td></tr>
|
138 |
|
|
<tr align="center"><td>msp430x1121 </td><td> 4 kB</td><td> 256 B</td></tr>
|
139 |
|
|
<tr align="center"><td>msp430x1122 </td><td> 4 kB</td><td> 256 B</td></tr>
|
140 |
|
|
<tr align="center"><td>msp430x122 </td><td> 4 kB</td><td> 256 B</td></tr>
|
141 |
|
|
<tr align="center"><td>msp430x1222 </td><td> 4 kB</td><td> 256 B</td></tr>
|
142 |
|
|
<tr align="center"><td>msp430x2122 </td><td> 4 kB</td><td> 256 B</td></tr>
|
143 |
|
|
<tr align="center"><td>msp430x2121 </td><td> 4 kB</td><td> 256 B</td></tr>
|
144 |
|
|
<tr align="center"><td>msp430x312 </td><td> 4 kB</td><td> 256 B</td></tr>
|
145 |
|
|
<tr align="center"><td>msp430x412 </td><td> 4 kB</td><td> 256 B</td></tr>
|
146 |
|
|
<tr align="center"><td colspan="3"><b><i>Program Memory Size: 8 kB</i></b></td></tr>
|
147 |
|
|
<tr align="center"><td>msp430x123 </td><td> 8 kB</td><td> 256 B</td></tr>
|
148 |
|
|
<tr align="center"><td>msp430x133 </td><td> 8 kB</td><td> 256 B</td></tr>
|
149 |
|
|
<tr align="center"><td>msp430x313 </td><td> 8 kB</td><td> 256 B</td></tr>
|
150 |
|
|
<tr align="center"><td>msp430x323 </td><td> 8 kB</td><td> 256 B</td></tr>
|
151 |
|
|
<tr align="center"><td>msp430x413 </td><td> 8 kB</td><td> 256 B</td></tr>
|
152 |
|
|
<tr align="center"><td>msp430x423 </td><td> 8 kB</td><td> 256 B</td></tr>
|
153 |
|
|
<tr align="center"><td>msp430xE423 </td><td> 8 kB</td><td> 256 B</td></tr>
|
154 |
|
|
<tr align="center"><td>msp430xE4232</td><td> 8 kB</td><td> 256 B</td></tr>
|
155 |
|
|
<tr align="center"><td>msp430xW423 </td><td> 8 kB</td><td> 256 B</td></tr>
|
156 |
|
|
<tr align="center"><td>msp430x1132 </td><td> 8 kB</td><td> 256 B</td></tr>
|
157 |
|
|
<tr align="center"><td>msp430x1232 </td><td> 8 kB</td><td> 256 B</td></tr>
|
158 |
|
|
<tr align="center"><td>msp430x1331 </td><td> 8 kB</td><td> 256 B</td></tr>
|
159 |
|
|
<tr align="center"><td>msp430x2131 </td><td> 8 kB</td><td> 256 B</td></tr>
|
160 |
|
|
<tr align="center"><td>msp430x2132 </td><td> 8 kB</td><td> 256 B</td></tr>
|
161 |
|
|
<tr align="center"><td>msp430x2232 </td><td> 8 kB</td><td> 512 B</td></tr>
|
162 |
|
|
<tr align="center"><td>msp430x2234 </td><td> 8 kB</td><td> 512 B</td></tr>
|
163 |
|
|
<tr align="center"><td>msp430x233 </td><td> 8 kB</td><td> 1024 B</td></tr>
|
164 |
|
|
<tr align="center"><td>msp430x2330 </td><td> 8 kB</td><td> 1024 B</td></tr>
|
165 |
|
|
<tr align="center"><td colspan="3"><b><i>Program Memory Size: 16 kB</i></b></td></tr>
|
166 |
|
|
<tr align="center"><td>msp430x4250 </td><td>16 kB</td><td> 256 B</td></tr>
|
167 |
|
|
<tr align="center"><td>msp430xG4250</td><td>16 kB</td><td> 256 B</td></tr>
|
168 |
|
|
<tr align="center"><td>msp430x135 </td><td>16 kB</td><td> 512 B</td></tr>
|
169 |
|
|
<tr align="center"><td>msp430x1351 </td><td>16 kB</td><td> 512 B</td></tr>
|
170 |
|
|
<tr align="center"><td>msp430x155 </td><td>16 kB</td><td> 512 B</td></tr>
|
171 |
|
|
<tr align="center"><td>msp430x2252 </td><td>16 kB</td><td> 512 B</td></tr>
|
172 |
|
|
<tr align="center"><td>msp430x2254 </td><td>16 kB</td><td> 512 B</td></tr>
|
173 |
|
|
<tr align="center"><td>msp430x315 </td><td>16 kB</td><td> 512 B</td></tr>
|
174 |
|
|
<tr align="center"><td>msp430x325 </td><td>16 kB</td><td> 512 B</td></tr>
|
175 |
|
|
<tr align="center"><td>msp430x415 </td><td>16 kB</td><td> 512 B</td></tr>
|
176 |
|
|
<tr align="center"><td>msp430x425 </td><td>16 kB</td><td> 512 B</td></tr>
|
177 |
|
|
<tr align="center"><td>msp430xE425 </td><td>16 kB</td><td> 512 B</td></tr>
|
178 |
|
|
<tr align="center"><td>msp430xW425 </td><td>16 kB</td><td> 512 B</td></tr>
|
179 |
|
|
<tr align="center"><td>msp430xE4252</td><td>16 kB</td><td> 512 B</td></tr>
|
180 |
|
|
<tr align="center"><td>msp430x435 </td><td>16 kB</td><td> 512 B</td></tr>
|
181 |
|
|
<tr align="center"><td>msp430x4351 </td><td>16 kB</td><td> 512 B</td></tr>
|
182 |
|
|
<tr align="center"><td>msp430x235 </td><td>16 kB</td><td> 2048 B</td></tr>
|
183 |
|
|
<tr align="center"><td>msp430x2350 </td><td>16 kB</td><td> 2048 B</td></tr>
|
184 |
|
|
<tr align="center"><td colspan="3"><b><i>Program Memory Size: 32 kB</i></b></td></tr>
|
185 |
|
|
<tr align="center"><td>msp430x4270 </td><td>32 kB</td><td> 256 B</td></tr>
|
186 |
|
|
<tr align="center"><td>msp430xG4270</td><td>32 kB</td><td> 256 B</td></tr>
|
187 |
|
|
<tr align="center"><td>msp430x147 </td><td>32 kB</td><td> 1024 B</td></tr>
|
188 |
|
|
<tr align="center"><td>msp430x1471 </td><td>32 kB</td><td> 1024 B</td></tr>
|
189 |
|
|
<tr align="center"><td>msp430x157 </td><td>32 kB</td><td> 1024 B</td></tr>
|
190 |
|
|
<tr align="center"><td>msp430x167 </td><td>32 kB</td><td> 1024 B</td></tr>
|
191 |
|
|
<tr align="center"><td>msp430x2272 </td><td>32 kB</td><td> 1024 B</td></tr>
|
192 |
|
|
<tr align="center"><td>msp430x2274 </td><td>32 kB</td><td> 1024 B</td></tr>
|
193 |
|
|
<tr align="center"><td>msp430x337 </td><td>32 kB</td><td> 1024 B</td></tr>
|
194 |
|
|
<tr align="center"><td>msp430x417 </td><td>32 kB</td><td> 1024 B</td></tr>
|
195 |
|
|
<tr align="center"><td>msp430x427 </td><td>32 kB</td><td> 1024 B</td></tr>
|
196 |
|
|
<tr align="center"><td>msp430xE427 </td><td>32 kB</td><td> 1024 B</td></tr>
|
197 |
|
|
<tr align="center"><td>msp430xE4272</td><td>32 kB</td><td> 1024 B</td></tr>
|
198 |
|
|
<tr align="center"><td>msp430xW427 </td><td>32 kB</td><td> 1024 B</td></tr>
|
199 |
|
|
<tr align="center"><td>msp430x437 </td><td>32 kB</td><td> 1024 B</td></tr>
|
200 |
|
|
<tr align="center"><td>msp430xG437 </td><td>32 kB</td><td> 1024 B</td></tr>
|
201 |
|
|
<tr align="center"><td>msp430x4371 </td><td>32 kB</td><td> 1024 B</td></tr>
|
202 |
|
|
<tr align="center"><td>msp430x447 </td><td>32 kB</td><td> 1024 B</td></tr>
|
203 |
|
|
<tr align="center"><td>msp430x2370 </td><td>32 kB</td><td> 2048 B</td></tr>
|
204 |
|
|
<tr align="center"><td>msp430x247 </td><td>32 kB</td><td> 4096 B</td></tr>
|
205 |
|
|
<tr align="center"><td>msp430x2471 </td><td>32 kB</td><td> 4096 B</td></tr>
|
206 |
|
|
</table>
|
207 |
|
|
<br />
|
208 |
|
|
|
209 |
|
|
</body>
|
210 |
|
|
</html>
|