Difference between revisions of "MSP-EXP430G2"
From Bashlinux
(→How to build and upload a project on Eclipse) |
(→How to setup MSP430 plugin for Eclipse) |
||
Line 32: | Line 32: | ||
* Update eclipse, <code>Help > Check Updates</code> |
* Update eclipse, <code>Help > Check Updates</code> |
||
* Add the MSP430 plug-in on <code>Help > Install New software</code> |
* Add the MSP430 plug-in on <code>Help > Install New software</code> |
||
− | * On the "Available Software" screen, click on 'Add' button and |
+ | * On the "Available Software" screen, click on 'Add' button and fill in the fields as follow |
+ | ** <tt>Name:</tt> "MSP430 Plugin" |
||
+ | ** <tt>Location:</tt> http://eclipse.xpg.dk |
||
* Back to "Available Software" screen, enable the check box for <code>msp430</code> and then hit 'Next' at the bottom of the screen |
* Back to "Available Software" screen, enable the check box for <code>msp430</code> and then hit 'Next' at the bottom of the screen |
||
* On the "Install Details" screen click 'Finish' and click 'Ok' if the "Security Warning" prompts you to confirm the installation |
* On the "Install Details" screen click 'Finish' and click 'Ok' if the "Security Warning" prompts you to confirm the installation |
Revision as of 22:18, 8 June 2015
How to setup udev for MSP430 LaunchPad
- Add the proper udev rule to let the user have access to the device
SUBSYSTEM=="usb", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="f432", MODE="0664", GROUP="dialout"
- Restart udev
udevadm control --reload
- (Re)Attach the MSP430 LaunchPad board
How to setup MSP430 GCC toolchain from distro
- Install msp430 tools and dependencies
Fedora
# yum -y install msp430-gcc msp430-binutils msp430-libc mspdebug msp430mcu libmpc-devel glibc-devel.i686 # sudo ln -s /usr/lib64/libmpc.so /usr/lib64/libmpc.so.2
Ubuntu
# apt-get -y install gcc-msp430 binutils-msp430 msp430-libc gdb-msp430 msp430mcu libmpc-dev libc6-dev-i386 # sudo ln -s /usr/lib/libmpc.so /usr/lib/libmpc.so.2
- Setup the MSP430 Plugin
How to setup MSP430 GCC toolchain non-distro
On Fedora 21 and newer versions the toolchain has missed some symbols, on that case is better to not use the toolchain that comes with the distro. In order to deal with this, the toolchain provided by xpg.dk will suffice
- Get the toolchain from http://xpg.dk/files/File/msp430/msp430-toolchain-linux-amd64-3.0.tar.bz2
- Decompress, rename and put it on /opt/ti/msp430-toolchain
- Setup the MSP430 Plugin
How to setup MSP430 plugin for Eclipse
- Install msp430 tools and dependencies
Fedora
# yum -y install eclipse eclipse-cdt
Ubuntu
# apt-get -y install eclipse eclipse-cdt
- Update eclipse,
Help > Check Updates
- Add the MSP430 plug-in on
Help > Install New software
- On the "Available Software" screen, click on 'Add' button and fill in the fields as follow
- Name: "MSP430 Plugin"
- Location: http://eclipse.xpg.dk
- Back to "Available Software" screen, enable the check box for
msp430
and then hit 'Next' at the bottom of the screen - On the "Install Details" screen click 'Finish' and click 'Ok' if the "Security Warning" prompts you to confirm the installation
- Click on 'Yes' when Eclipse finish up the installation and ask you to restart Eclipse itself.
- Click on
MSP430 > Tool Manager
at the top menu- Click on 'Add' and look for the toolchain at /opt/ti/msp430-toolchain
- Click on 'Activate'
How to create a project on Eclipse
- Select
File > New > Project
- Select
C/C++ > C Project
and click 'Next' - Set a name on 'Project name'
- Select
MSP430 Cross Target Application > Empty Project
and click 'Finish'
- Select
- Right clik on Project and select
Properties
and then selectMSP430
on the left menu- On Target MCU select your microcontroller
- On MSPDebug select the driver 'rf2500'
- On Connection select 'USB', the serial number of the MSP430 LaunchPad should be listed in the dropbox, if not udev has not been set properly
How to build and upload a project on Eclipse
- Once the project is done, press '<CTRL>+B' to upload the code
- Once the project is build clean, upload the binary to the MSP430 LaunchPad with
MSP430 > Upload to target
NOTE: Make sure 'Debug' profile is always set. It can be checked doing a right-click on the project and selecting Build Configurations > Manage...