MSP430 development environment MSPGCC + Codeblocks

Publisher:幸福满溢Latest update time:2015-04-28 Source: 51heiKeywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
I prefer simple and compact things, so the official CCS is not suitable for me, and IAR needs to be cracked, so I chose this platform as the development environment for MSP430.

Codeblocks itself integrates the template of MSPGCC compiler, but the new version of MSPGCC seems to be a little different from the old version, so some configuration work is needed.
In theory, the construction method is also applicable to the Linux system, but I personally haven't built it under Linux.

Compared with Eclipse, codeblocks is very small (less than 30M if you don't want MinGW), does not require a JAVA environment, runs very fast, and supports the construction of multiple development environments. It is my preferred platform for tinkering with things. As for its other advantages, google it yourself.

My mspgcc is placed in the D:mspgcc directory, and the TI official burning software is placed in the "D:mspgccflash_fet" directory. Readers are welcome to modify it by themselves. 
Start:
1) Install codeblocks 10.05 first, this is very simple. The one below is without minGW and is only 23M, and with minGW and is 74M
http://sourceforge.net/projects/codeblocks/files/Binaries/10.05/Windows/codeblocks-10.05-setup.exe/download 
http://sourceforge.net/projects/codeblocks/files/Binaries/10.05/Windows/codeblocks-10.05mingw-setup.exe/download 
2) Download MSPGCC (the new version is only 37M), unzip it to "D:mspgcc"
http://sourceforge.net/projects/mspgcc/files/Windows/mingw32/mspgcc-20120406-p20120502.zip/download
3) Download the TI LuanchPad software package, and unzip the Flasher, driver, etc. in it to the "D:mspgcc" directory. (Attachment)

4) Run codeblocks, click Setting->Compiler and debugger..
Select the compiler "GNU GCC Compiler for MSP430"
 

Note: If you only use one compiler setting and one MCU model, you can also set the Compiler Flags here. (I personally do not recommend it~~)

Switch to "Toolchain executables" and modify it as follows
 

Switch to "Addition Paths" on this page and add the directory of msp430
 

Switch to "Search directories", add the compiler's include directory and linker's lib directory [page]

 

 

Save.


5) Create a new project. File->New->project->Empty project.
I usually only check Release and not Debug.

 


 

7) Create a new blank file and add it to the project File->New->Empty file
Enter the test code. My LaunchPad code (no comments, sorry):
#include

void delay(int duration)
{
        volatile int d = duration;
        while((d--) > 0)
        {
        }
}

int main(void)
{
        WDTCTL = WDTPW | WDTHOLD;

        P1OUT = 0x00;
        P1DIR = 0x41;

        while(1)
        {
                P1OUT = 0x40;
                delay(5000);
                P1OUT = 0x01;
                delay(5000);
        }
        return 0;
}
Reminder: the variables in the delay function must be modified with volatile. [page]

8) There are some important things to do before compiling.
Project->Propertise..->Build targets
 


The following contents can also be set in the page in red font above (not recommended)
9) Project->Build Options..
 


 



 
My settings:
msp430-objcopy -O ihex bin/Release/CB_MSP430_test001.elf bin/Release/CB_MSP430_test001.a43
D:/mspgcc/msp_fet/MSP430Flasher.exe -n msp4302553 -w bin/Release/CB_MSP430_test001.a43 -v -g -z [VCC]


At this point, the settings are complete.

You can click Run. Information is displayed after success~~

-------------- Build: Release in CB_MSP430_test001 ---------------

msp430-gcc.exe -Wall -mmcu=msp430g2553 -Os -O3 -ID:mspgccmsp430include -ID:mspgccinclude -c CB_MSP430_test001.c -o objReleaseCB_MSP430_test001.o
msp 430-gcc.exe -LD:mspgccmsp430libldscriptsmsp430g2553 -LD:mspgccmsp430lib -LD:mspgcclib -o binReleaseCB_MSP430_test001.elf objReleaseCB_MSP430_test001.o -s  
Output size is 584.00 bytes
Running target post-build steps
msp430-objcopy -O ihex bin/Release/CB_MSP430_test001.elf bin/Release/CB_MSP430_test001.a43
D:/mspgcc/msp_fet/MSP430Flasher.exe -n msp4302553 -w bin/Release/CB_MSP430_test001.a43 -v -g - z [VCC]
** ERROR: Unable to access log file. Log disabled.
** Please make sure the directory 'Log' exists in line with the executable.
Evaluating additional triggers...done
Initializing interface on TIUSB port...done
Checking firmware compatibility...done
Reading FW version...done
Reading HW version...done
Powering up...done
Configuring...done
Accessing device...done
Reading device information...done
Loading file into device...done
Verifying transfer...done
Resetting device...done
Refreshing registers...
/* -------------------------------------------------------------------------------
* UseCase : MSP430Flasher.exe
* Arguments : -n MSP4302553 -w bin/Release/CB_MSP430_test001.a43 -v -g -z [VCC] 
* ATTENTION: Default options used due to invalid argument list.
* -------------------------------------------------------------------------------
* Driver : loaded
* Dll Version : 2040900 1
* FwVersion: 30394216
* Interface: TIUSB
* HwVersion: E 2.0
* Mode: AUTO
* Device: MSP430G2xx3
* EEM: Level 1, ClockCntrl 1
* Prog.File: bin/Release/CB_MSP430_test001.a43 (ERASE_ALL, verified = TRUE)
* BSL Unlock : FALSE
* InfoA Access: FALSE
* VCC ON : TRUE
* UseCase specific tasks: ---------------------------------------------------------------
* Powering up...done
* Disconnecting from device...
* -------------------------------------------------------------------------------
* Driver : closed (No error)
*------------------------------------------------ --------------------------
*/
Process terminated with status 0 (0 minutes, 7 seconds)
0 errors, 0 warnings

LaunchPad download: http://www.51hei.com/f/TI_LaunchPad.zip

Keywords:MSP430 Reference address:MSP430 development environment MSPGCC + Codeblocks

Previous article:Two-way electronic stopwatch based on 24C08 with power-off memory function
Next article:IIC bus protocol written in 430: 24C02 power-off memory program (digital tube display)

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号