Jump to content
Nytblade

How to use GDB with MSPDebug on Linux?

Recommended Posts

I am able to connect to and program my MSP430 from MSPDebug successfully.

 

There is a command in MSPDebug named 'gdb' which I assume allows me to do stuff like 'backtrace' using GDB. However, when I type 'gdb' in MSPDebug and then in another window run 'msp430-gdb' and type "target remote :2000" it either hangs GDB or segfaults.

 

I'm just wondering how I am supposed to get this remote GDB functionality working?

 

Here are the package versions I'm using:

binutils-msp430 2.21~msp20110421-2

gcc-msp430 4.5.3~mspgcc-4.5.2-20110612-1

gdb-msp430 7.2~mspgcc-7.2-20110612-1ubuntu1

msp430-libc 20110612-1

msp430mcu 20110613-1

mspdebug 0.16-1

 

Thanks

Matt

Share this post


Link to post
Share on other sites

I do it like this:

 

In your project directory (where your sources and binary are), have a file called .gdbinit with the following contents:

target remote localhost:2000
monitor reset halt
load

 

On one terminal, start MSPDebug like so:

mspdebug rf2500 gdb

This starts up MSPDebug in GDB proxy mode -- on one end, there is a GDB server (by default on port 2000, see help gdb); on the other end, it is attached to your FET (change rf2500 to the actual FET driver you are using).

 

On an other terminal, assuming you are in your project's directory and your binary is called main.elf, start up msp430-gdb like so:

msp430-gdb main.elf

I like CGDB as a friont-end to GDB, so I do

cgdb -d msp430-gdb main.elf

 

Much of this can be automated from your Makefiles (I have not yet figured out how to reliable handle starting and killing the GDB proxy, then again, it doesn't bother me enough to spend time on it...).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×