Set up the MSP430 Development Environment (MSPGCC) in Ubuntu)

Source: Internet
Author: User

Recently, I accidentally saw a netizen say that the MSP430 also has the GCC compiler, namely, MSPGCC. I also began to think that it is not far from developing the MSP430 in Linux. Google end time, find the MSPGCC Wiki: http://sourceforge.net/apps/mediawiki/mspgcc/index.php? Title = MSPGCC_Wiki and a compiled installation package already exists in Ubuntu. At this point, I do not like to install these tool chains from Ubuntu sources, I prefer the tool chain officially released by MSPGCC, but the official tool chain has not been found for a long time, so now I will first use the Ubuntu installation package, the above link found the Ubuntu link, https://launchpad.net/ubuntu/oneiric/+search? Text = msp430, lp has 6 packages, which are

Msp430-libc:
Standard C library for TI MSP430 development430 C Standard libraryMspdebug:
Debugging tool for MSP430 microcontrollers430 debugging tool, used to connect to the simulatorMCU:
Spec files, headers and linker scripts for TI's MSP430 targets430 header file and link scriptBinutils-msp430:
Binary utilities supporting TI's MSP430 targets430 Binary ToolkitGcc-msp430:
The gnu c compiler (cross compiler for MSP430) 430 GCC compilerGdb-msp430:
The GNU debugger for release 430 GDB debuggerFor more information about the functions of these packages and Their Relationships with GCC, refer to the following post. Http://cms.mcuapps.com/techinfo/toolchains/gcc/we installed it together! Enter:

 

Sudo apt-get install msp430-libc mspdebug MCU binutils-msp430 gcc-msp430 gdb-msp430 gdb-msp430_7.2 but there are some small episodes during the installation process, there will be the following error: dpkg: Processing/var/cache/apt/archives ~ Mspgcc-7.2-20110612-1ubuntu1_i386.deb (-- unpack) error: attempting to overwrite/usr/share/gdb/python/gdb/_ init __. py, which is included in the package gdb 7.4-2012.04-0ubuntu2. 1. Processing the trigger for man-db... an error occurred while processing:/var/cache/apt/archives/gdb-msp430_7.2 ~ Mspgcc-7.2-20110612-1ubuntu1_i386.debE: Sub-process/usr/bin/dpkg returned an error code (1) Here it means that the installation files in the gdb-msp430 package will overwrite the files in the gdb package, refer to this blog: Workshop:

 

Sudo apt-get-o Dpkg: Options: = "-- force-overwrite" install the gdb-msp430 will see the following information: dpkg: Warning: Since the -- force option is enabled, the following problem is ignored:/usr/share/gdb/python/gdb/_ init _ is being overwritten __. py, which is included in the package gdb 7.4-2012.04-0ubuntu2. 1 dpkg: Warning: The -- force option is enabled, and the following problem is ignored:/usr/share/gdb/python/gdb/types is being overwritten. py, which is included in the package gdb 7.4-2012.04-0ubuntu2. 1 dpkg: Warning: The -- force option is enabled, and the following problem is ignored:/usr/share/gdb/python/gdb/printing is being overwritten. py, which is included in the package gdb 7.4- 2012.04-0ubuntu2. 1 dpkg: Warning: The -- force option is enabled, and the following problem is ignored:/usr/share/gdb/python/gdb/command/_ init _ is being overwritten __. py, which is included in the package gdb 7.4-2012.04-0ubuntu2. 1 dpkg: Warning: Due to the -- force option enabled, the following problem is ignored: attempting to overwrite/usr/share/gdb/python/gdb/command/pretty_printers.py, it is also included in the package gdb 7.4-2012.04-0ubuntu2. 1. Processing the trigger for man-db... setting consumer MCU (20110613-3 )... setting binutils-msp430 (2.22 ~ Msp20110716p5-1)... is setting gcc-msp430 (4.5.3 ~ Mspgcc-20110716-4)... setting msp430-libc (20110612-2)... setting mspdebug (0.18-1)... setting gdb-msp430 (7.2 ~ Mspgcc-7.2-20110612-1ubuntu1)... here it means the installation is successful. Next, create a new file for compilation. The content is as follows:

 

/* Blink LED example */# include <symbol g2553. h>/** Delay function. **/delay (unsignedint d) {int I; for (I = 0; I <d; I ++) {nop () ;}} int main (void) {WDTCTL = WDTPW | WDTHOLD; P1DIR = 0xFF; P1OUT = 0x01; for (;) {P1OUT = ~ P1OUT; delay (0x4fff) ;}} input in terminal:

 

Msp430-gcc-OS-mmcu = rjg2553-o led. elf led. c compiled successfully! For online debugging and debugging of eclipse + msp430-gdb, stay tuned.
  • 1
  • 2
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.