Jump to content

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




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


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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...