Jump to content

Code::Blocks + mspgcc how-to.

Recommended Posts



Thanks yyrkoon for your tutorial!


I've got programming up and running on Mac OS X 10.8.4 and want to add something for my fellow Mac users.


The tool config window should look like this:




Then the Code::Blocks console will read something like this:

Launching tool 'Upload': /usr/local/msp430/mspdebug/mspdebug rf2500 --force-reset "prog /Users/jacob/Engineering/CodeBlocks/msprf24-rx/bin/Debug/msprf24-rx.elf" (in /Users/jacob/Engineering/CodeBlocks/msprf24-rx/bin/Debug)
stdout> MSPDebug version 0.20 - debugging tool for MSP430 MCUs
stdout> Copyright (C) 2009-2012 Daniel Beer <dlbeer@gmail.com>
stdout> This is free software; see the source for copying conditions.  There is NO
stdout> Trying to open interface 1 on 006
stdout> Initializing FET...
stdout> FET protocol version is 30066536
stdout> Configured for Spy-Bi-Wire
stdout> Sending reset...
stdout> Set Vcc: 3000 mV
stdout> Device ID: 0x2553
stdout>   Code start address: 0xc000
stdout>   Code size         : 16384 byte = 16 kb
stdout>   RAM  start address: 0x200
stdout>   RAM  end   address: 0x3ff
stdout>   RAM  size         : 512 byte = 0 kb
stdout> Device: MSP430G2553/G2403
stdout> Code memory starts at 0xc000
stdout> Number of breakpoints: 2
stdout> Chip ID data: 25 53
stdout> Erasing...
stdout> Programming...
stdout> Writing 2038 bytes at c000 [section: .text]...
stdout> Writing   32 bytes at ffe0 [section: .vectors]...
stdout> Done, 2070 bytes total
Tool execution terminated with status 0



Which means your Launchpad MSP430 is now programmed and running :-)

Share this post

Link to post
Share on other sites

Thank you! Copy and translate to Russian: http://www.shelezyakin.ru/?p=816

I've learned about yyrkoon's "how-to" from shluzzzoid. And installed the CB and mspgcc. Thank you guys!


Being a newbee in MSP430 MCUs, I like the GRACE program which I installed as standalone tool. It helped me very much to configure MCU's periphery and obtain several init C-files.

Now I want to use GRACE-generated files in my CODE::BLOCKS project. And to do it by "late linking": any time I decide to change smth in MCU periphery, I'd like to do it in GRACE, then refresh generated files and just remake the CODE::BLOCKS project. So GRACE project is used not once as a init code source, but is kept in the CB project forever and may be changed.

Is it sensible at all?


I've organised a common folder for GRACE and CB projects, included all GRACE-generated files in CB project and tried to compile. Compiler shows errors... Seemingly I have to arrange proper paths for header and lib files. And I cannot figure it out - what libraries do GRACE use? What path have I to add in CD compiler settings to use GRACE files?


Note: the CD paths are as yyrkoon proposed - in HighTech folder.

Share this post

Link to post
Share on other sites


Compiling template I get this error message

#include int main(){ return 0;}
..\main.c|1|error: #include expects "FILENAME" or <FILENAME>|
||=== Build finished: 1 errors, 0 warnings (0 minutes, 0 seconds) ===|

CodeBlock version : 12.11


Any idea to help me ?



Share this post

Link to post
Share on other sites

Everything still works fine with the latest version of code::blocks, and the first version of energia on Windows 10 x64 pro. In fact, the launchpad is recognized straight out of the box, without installing drivers. That is, at least for the purpose of flashing binaries to the launchpad.


IN fact I've just flashed three TSSOP-20 parts, using the launchpad using a ZIP socket adapter + 20 pin TSSOP to DIP socket adapter.

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