How To: Setup Linux Mint for TI MSP430 development

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
MarkusR

How To: Setup Linux Mint for TI MSP430 development

Post by MarkusR »

I wanted to setup a development environment for me MSP430 hardware, including:
MSP430 Launchpad ($5)
MSP430 eZ430-RF2500 ($49)
MSP430 eZ430-T2012 ($10 for 3)

My system was a fairly fresh install of Linux Mint 13 Maya, 64-bit, KDE
uname -a: Linux 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

I'm gald to say I was successful and felt like sharing my Journal. So, here it is:
MSP430 Linux Journal.

1. Installed software listed at http://www.43oh.com/2010/11/a-step-by-s ... der-linux/ , as recommended packages prior to MSGCC install, using Synaptic Package Manager
2. Installed MSP430 specific software listed on https://launchpad.net/ubuntu/oneiric/+s ... ext=msp430
3. Error Message during step 2: E: /var/cache/apt/archives/gdb-msp430_7.2~mspgcc-7.2-20110612-1ubuntu1_amd64.deb: trying to overwrite '/usr/share/gdb/python/gdb/__init__.py', which is also in package gdb 7.4-2012.04-0ubuntu2 (See Log 1)
4. Step 3 confirmed as a Bug in Ubuntu. Ref: https://bugs.launchpad.net/ubuntu/+sour ... bug/860045
5. Checked gdb version 7-4 for removal using Synaptic Package Manager (not complete removal)
6. Successfully installed gdb-msp430 once gdb was uninstalled
7. Followed http://mitchtech.net/cross-compiling-fo ... launchpad/ code & compilation instructions successfully, by changing all MCU references from msp430g2553 to msp430g2231
8. Performed the “Installation” section on the site in step 7 successfully.
9. LED blink operated as expected. Used Ctrl+C to abort and display registry and assembly code on the MCU
10. Created a second led.c file, this time with F2012 MCU descriptions.
11. Successfully debugged the MSP430 ez430-T2012 module using steps 8 & 9

No other steps were required to program/debug MSP430 devices using just the command line and the USB port (EDIT: unless you want to use the code examples for interrupts)

EDIT Sept 25, 2012:
PROBLEM: Instructions above are not sufficient for using Interrupts in the code. When compiing an example with an interrupt:

Code: Select all

// Timer A0 interrupt service routine
#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A (void)
{
  P1OUT ^= 0x01;                            // Toggle P1.0
  CCR0 += 50000;                            // Add Offset to CCR0
}
The following error appears, referring to "__interrupt" in the code sample.

Code: Select all

msp430g2xx1_ta_01.c:40:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
SOLUTION: Replace instances like this:

Code: Select all

#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A (void)
with something like this:

Code: Select all

void Timer_A (void) __attribute__((interrupt(TIMERA0_VECTOR)));
void Timer_A (void)
And it will fix it. This is not to say original can't be made to work (I'm sure it can), but at this point of system configuration the substitution is necessary.
Post Reply

Return to “Tutorials”