This blog has permanently moved to

Contact Form | Email Address

© 2018 All rights reserved by Boseji

Thank you for all your support.

Friday, November 25, 2011

Compiling mspdebug for Windows using MinGW

We were trying to compile the windows version of Mspdebug from its source.
In this post we would detail the dependencies that needed to be taken care off and how to make the Mspdebug-0.18 build with MinGW.

First let us browse the setup:
1. We need Latest version of the MinGW installed presently using :gcc version 4.6.1 (GCC)
2. Download the Old Regex utility from GNU http://ftp.gnu.org/old-gnu/regex/ file regex-0.12.tar.gz

3. Download the Mspdebug-0.18 http://sourceforge.net/projects/mspdebug/files/mspdebug-0.18.tar.gz/download
Note: Make sure that MinGW in in the path along with Msys for the binutils

Building the Dependency of the regex in MinGW
1. Extract the regex-0.12.tar.gz file in a directory say regex-0.12
2. Compile the files: gcc -g -DHAVE_STRING_H=1 -I. -c regex.c
3. Now make the lib file: ar ru libregex.a regex.o
4. Copy the files to the respective directories:
libregex.a => [MinGW dir]\lib and regex.h => [MinGW dir]\include
Here are some quick commands:

cp libregex.a ..\MinGw\lib 
cp regex.h ..\MinGW\include
Thanks to kemovitra blog for help.

Also possible to Get the more recent(2007) Regex Package mingw-libgnurx-2.5.1:

File modifications for including LibUsb-Win32 used in MinGW:
1. Need to change #include<usb.h> to: #include <lusb0_usb.h>

2. Each of the following files need to be modified:
mspdebug-0.18\util\usbutil.h      Line number: 22
mspdebug-0.18\drivers\olimex.c Line number: 23
mspdebug-0.18\drivers\rf2500.c Line number: 22
mspdebug-0.18\drivers\ti3410.c Line number: 23

Compiling the  Mspdebug:
1. Use the command:  make WITHOUT_READLINE=1
2. If this works then you have a mspdebug.exe ready !!
Next we need to try out using this to program the MSP430 chips.

No comments:

Post a Comment