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
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)
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- How to write C/C++ code in DSP? + Data types in c6000
- What role does power supply potting glue play in power supplies, and why do power supplies need potting?
- 37 "Ten Thousand Miles" Raspberry Pi Car——ROS Learning (VSCode Debugging ROS)
- How to pack .mpy files into esp8266 micro python firmware package?
- Beidou short message development board based on STM32F103RET6
- Want to know more about UWB? Just read this article.
- When downloading a program to a PCB board in SWD mode, what will happen if the PCB board's own power is not disconnected?
- I would like to ask you guys, what is the value of the bypass capacitor for the LT1763 chip?
- Many people ask whether the soft board can run at high speed...
- 82 AD conversion design experience summary!