AndyD273

Using Energia with MSP430G2231

9 posts in this topic

I'm trying to get my MSP430 working with Energia.

 

I was getting an error saying it couldn't find the board. 

Then I found this work around: http://forum.43oh.com/topic/9848-energia-1610r18-windows-7-launchpad-msp430g2553-dont-load-sketch/?p=74156

 

and now it can find the board, but I'm getting a new error:

 

Energia: 1.6.10E18 (Windows 10), Board: "MSP-EXP430G2553LP"
 
Build options changed, rebuilding all
 
Sketch uses 760 bytes (4%) of program storage space. Maximum is 16,384 bytes.
Global variables use 20 bytes (3%) of dynamic memory, leaving 492 bytes for local variables. Maximum is 512 bytes.
C:\Users\andy\Desktop\energia-1.6.10E18\hardware\tools\msp430/bin/mspdebug tilib --force-reset prog C:\Users\andy\AppData\Local\Temp\build75ed397880e43e5832dfe04a926c3554.tmp/blink.ino.hex 
MSPDebug version 0.22 - debugging tool for MSP430 MCUs
Copyright © 2009-2013 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
MSP430_GetNumberOfUsbIfs
MSP430_GetNameOfUsbIf
Found FET: HID0016:COM5
MSP430_Initialize: HID0016:COM5
Firmware version is 20409001
MSP430_VCC: 3000 mV
MSP430_OpenDevice
MSP430_GetFoundDevice
Device: F20x2_G2x2x_G2x3x (id = 0x0035)
2 breakpoints available
MSP430_EEM_Init
Chip ID data: f2 01 02
Erasing...
Programming...
Writing  842 bytes at c000...
tilib: MSP430_Memory: Could not write device memory (error = 7)
MSP430_Run
ihex: error on line 55
MSP430_Close
tilib: MSP430_Run: Could not run device (to breakpoint) (error = 17)
tilib: MSP430_Run: Could not run device (to breakpoint) (error = 17)
 

 

 

I'm just trying to upload an unmodified blink example program. 

From what I can tell, the problem is the line that says "Writing  842 bytes at c000..." because that is outside of the device memory range.

 

I don't know if there's a way to work around this, but I'm hopeful.

 

Share this post


Link to post
Share on other sites

First problem you have the wrong board selected:

 

 

 

Energia: 1.6.10E18 (Windows 10), Board: "MSP-EXP430G2553LP"

 

Second problem ... Energia is not going to work smoothly with the msp430g2231 chip even when you do select the right board. Energia is too bloated to work well on a chip with only 2k of flash and 128bytes of ram, and no real uart and a single timer. You are wasting your time trying to learn with this chip if your goal is to do Arduino stuff.

Share this post


Link to post
Share on other sites

First problem you have the wrong board selected:

 

 

 

 

Second problem ... Energia is not going to work smoothly with the msp430g2231 chip even when you do select the right board. Energia is too bloated to work well on a chip with only 2k of flash and 128bytes of ram, and no real uart and a single timer. You are wasting your time trying to learn with this chip if your goal is to do Arduino stuff.

 

Unfortunately that's the only G chip listed. 

I tried adding the MSP430G2231 to the boards.txt with some stuff I found on GitHub, but apparently I didn't do that right:

 

boards.txt  

#MSP-EXP430G2231
 
MSP-EXP430G2231LP.vid.0=0x2341
MSP-EXP430G2231LP.pid.0=0x0c9f
 
MSP-EXP430G2231LP.name=MSP-EXP430G2 w/ MSP430G2231
 
MSP-EXP430G2231LP.build.mcu=msp430g2231
MSP-EXP430G2231LP.build.f_cpu=1000000L
MSP-EXP430G2231LP.build.core=msp430
MSP-EXP430G2231LP.build.variant=MSP-EXP430G2
MSP-EXP430G2231LP.build.board=MSP_EXP430G2231LP
 
MSP-EXP430G2231LP.upload.tool=mspdebug
MSP-EXP430G2231LP.upload.protocol=tilib
MSP-EXP430G2231LP.upload.maximum_size=2048
MSP-EXP430G2231LP.upload.maximum_data_size=256

 

 

When I try to run it I get this error:

 

 

Energia: 1.6.10E18 (Windows 10), Board: "MSP-EXP430G2 w/ MSP430G2231"

 
C:\Users\andy\Desktop\energia-1.6.10E18\arduino-builder -dump-prefs -logger=machine -hardware "C:\Users\andy\Desktop\energia-1.6.10E18\hardware" -tools "C:\Users\andy\Desktop\energia-1.6.10E18\tools-builder" -tools "C:\Users\andy\Desktop\energia-1.6.10E18\hardware\tools\msp430" -built-in-libraries "C:\Users\andy\Desktop\energia-1.6.10E18\libraries" -libraries "C:\Users\andy\Documents\Energia\libraries" -fqbn=energia:msp430:MSP-EXP430G2231LP -ide-version=10610 -build-path "C:\Users\andy\AppData\Local\Temp\build75ed397880e43e5832dfe04a926c3554.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "C:\Users\andy\Documents\Energia\blink\blink.ino"
C:\Users\andy\Desktop\energia-1.6.10E18\arduino-builder -compile -logger=machine -hardware "C:\Users\andy\Desktop\energia-1.6.10E18\hardware" -tools "C:\Users\andy\Desktop\energia-1.6.10E18\tools-builder" -tools "C:\Users\andy\Desktop\energia-1.6.10E18\hardware\tools\msp430" -built-in-libraries "C:\Users\andy\Desktop\energia-1.6.10E18\libraries" -libraries "C:\Users\andy\Documents\Energia\libraries" -fqbn=energia:msp430:MSP-EXP430G2231LP -ide-version=10610 -build-path "C:\Users\andy\AppData\Local\Temp\build75ed397880e43e5832dfe04a926c3554.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "C:\Users\andy\Documents\Energia\blink\blink.ino"
Using board 'MSP-EXP430G2231LP' from platform in folder: C:\Users\andy\Desktop\energia-1.6.10E18\hardware\energia\msp430
Using core 'msp430' from platform in folder: C:\Users\andy\Desktop\energia-1.6.10E18\hardware\energia\msp430
Detecting libraries used...
"C:\Users\andy\Desktop\energia-1.6.10E18\hardware\tools\msp430/bin/msp430-g++" -c -g -O2  -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=msp430g2231 -DF_CPU=1000000L -DARDUINO=10610 -DENERGIA=10610 -DENERGIA_MSP_EXP430G2231LP -DENERGIA_ARCH_MSP430 -IC:\Users\andy\Desktop\energia-1.6.10E18\hardware\tools\msp430/include  "-IC:\Users\andy\Desktop\energia-1.6.10E18\hardware\energia\msp430\cores\msp430" "-IC:\Users\andy\Desktop\energia-1.6.10E18\hardware\energia\msp430\variants\MSP-EXP430G2" "C:\Users\andy\AppData\Local\Temp\build75ed397880e43e5832dfe04a926c3554.tmp\sketch\blink.ino.cpp" -o "nul"
"C:\Users\andy\Desktop\energia-1.6.10E18\hardware\tools\msp430/bin/msp430-g++" -c -g -O2  -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=msp430g2231 -DF_CPU=1000000L -DARDUINO=10610 -DENERGIA=10610 -DENERGIA_MSP_EXP430G2231LP -DENERGIA_ARCH_MSP430 -IC:\Users\andy\Desktop\energia-1.6.10E18\hardware\tools\msp430/include  "-IC:\Users\andy\Desktop\energia-1.6.10E18\hardware\energia\msp430\cores\msp430" "-IC:\Users\andy\Desktop\energia-1.6.10E18\hardware\energia\msp430\variants\MSP-EXP430G2" "C:\Users\andy\AppData\Local\Temp\build75ed397880e43e5832dfe04a926c3554.tmp\sketch\blink.ino.cpp" -o "nul"
Generating function prototypes...
"C:\Users\andy\Desktop\energia-1.6.10E18\hardware\tools\msp430/bin/msp430-g++" -c -g -O2  -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=msp430g2231 -DF_CPU=1000000L -DARDUINO=10610 -DENERGIA=10610 -DENERGIA_MSP_EXP430G2231LP -DENERGIA_ARCH_MSP430 -IC:\Users\andy\Desktop\energia-1.6.10E18\hardware\tools\msp430/include  "-IC:\Users\andy\Desktop\energia-1.6.10E18\hardware\energia\msp430\cores\msp430" "-IC:\Users\andy\Desktop\energia-1.6.10E18\hardware\energia\msp430\variants\MSP-EXP430G2" "C:\Users\andy\AppData\Local\Temp\build75ed397880e43e5832dfe04a926c3554.tmp\sketch\blink.ino.cpp" -o "C:\Users\andy\AppData\Local\Temp\build75ed397880e43e5832dfe04a926c3554.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Users\andy\Desktop\energia-1.6.10E18\tools-builder\ctags\5.8-arduino10/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\andy\AppData\Local\Temp\build75ed397880e43e5832dfe04a926c3554.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\Users\andy\Desktop\energia-1.6.10E18\hardware\tools\msp430/bin/msp430-g++" -c -g -O2  -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=msp430g2231 -DF_CPU=1000000L -DARDUINO=10610 -DENERGIA=10610 -DENERGIA_MSP_EXP430G2231LP -DENERGIA_ARCH_MSP430 -IC:\Users\andy\Desktop\energia-1.6.10E18\hardware\tools\msp430/include  "-IC:\Users\andy\Desktop\energia-1.6.10E18\hardware\energia\msp430\cores\msp430" "-IC:\Users\andy\Desktop\energia-1.6.10E18\hardware\energia\msp430\variants\MSP-EXP430G2" "C:\Users\andy\AppData\Local\Temp\build75ed397880e43e5832dfe04a926c3554.tmp\sketch\blink.ino.cpp" -o "C:\Users\andy\AppData\Local\Temp\build75ed397880e43e5832dfe04a926c3554.tmp\sketch\blink.ino.cpp.o"
Compiling libraries...
Compiling core...
open C:\Users\andy\Desktop\energia-1.6.10E18\hardware\energia\msp430\variants\MSP-EXP430G2: The system cannot find the file specified.
Error compiling for board MSP-EXP430G2 w/ MSP430G2231.

 

 

Lastly, I have an Arduino Uno which I started my project on and got it working, but I want to turn it into an embedded project and so was hoping to use this little board in place of the Uno so I can use that for other things. 

The project is super simple, and isn't much more complicated than this blink example.

If I have to I'll learn how to do it with code composer, but it would be cool if I didn't have to start over from scratch.

Share this post


Link to post
Share on other sites

My project is this:

 

Wait for a button push. Turn on a relay for 10 seconds. Turn off the relay. Wait for the next button push.

 

on the arduino it is essentially:

 

loop(){

  if(button == HIGH){

    writeout(relay, HIGH);

    delay(10000);

    writeout(relay, LOW);

  }

}

 

In code composer it seems a lot more complicated. I think that's why I've never done anything with the MSP430 in the 8+ years I've had it.

Share this post


Link to post
Share on other sites

Why don't you just buy one of those $2 Chinese Arduino clones and then you can use stuff you are familiar with and don't have to do any learning.  It doesn't seem like the msp430 is worth spending time with for your goals.

Share this post


Link to post
Share on other sites

Here is a version written with fabooh. https://github.com/RickKimball/fabooh

 

/*
 * andyd273.cpp - simple fabooh msp430g2231 program to turn on a relay for 10 seconds
 *                when the user button on the launchpad is pressed
 *
 *  Created on: Feb 13th, 2017
 *      Author: kimballr
 * Pinout:
 *   P1.3 is button on launchpad board
 *   P1.6 is relay output (also lights led)
 */
#include <fabooh.h>
#define SMALL_INIT4 /* don't initialize .bss and .data sections */
#include <main.h>
#include <serial.h>

namespace {
  const uint32_t BAUD_RATE=9600;
  typedef serial_default_t<BAUD_RATE, CPU::frequency, TX_PIN, NO_PIN> serial;
  serial Serial;
}

void setup() {
  PUSH2::set_mode(INPUT_PULLUP);
  P1_6::set_mode(OUTPUT);
  P1_6::low();
  Serial.begin();

}

void loop() {
  for (; {
    int n = 1;

    do (PUSH2::read()) ? --n : (n = 5000); while (n);
    do (PUSH2::read()) ? n = 5000 : --n; while (n);
    Serial << "turning on relay\r\n";
    P1_6::high();
    Serial << "wait 10 seconds\r\n";
    delay(10000);
    Serial << "turning off relay\r\n";
    P1_6::low();
  }
}

 

 

I've included a compiled version of this so you can just load it on the msp430g2231 launchpad.

Use the mspdebug command to load it (Find mspdebug.exe someplace in the Energia install tree on your hard disk)

 

C:\ mspdebug rf2500 "prog andyd273.hex"

 

rename this file to andyd273.hex

andyd273.txt

dubnet, AndyD273, Fmilburn and 1 other like this

Share this post


Link to post
Share on other sites

I have the MSP-EXP430G2 board and it works fine with energia.

 

I used the instructions I found at https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/539487

 

"I use the latest version of Energia, i.e Energia 18. If you follow this step exactly it will work as usual."

1, copy <energia directory>\hardware\tools\DSLite\DebugServer\drivers\MSP430.dll to <energia directory>\hardware\tools\msp430\bin\
2. edit <energia directory>\hardware\energia\msp430\boards.txt an change the 2 occurrences of rf2500 with tilib
3. restart energia and you should be able to upload to the MSP-EXP430G2 with MSP430G2553.

 

Your boards.txt file from step 2 should look exactly like this after you save it:

# See: http://code.google.com/p/arduino/wiki/Platforms

menu.cpu=Processor

##############################################################

MSP-EXP430F5529LP.vid.0=0x2341
MSP-EXP430F5529LP.pid.0=0x0c9f

MSP-EXP430F5529LP.name=MSP-EXP430F5529LP

MSP-EXP430F5529LP.build.mcu=msp430f5529
MSP-EXP430F5529LP.build.f_cpu=16000000L
MSP-EXP430F5529LP.build.core=msp430
MSP-EXP430F5529LP.build.variant=MSP-EXP430F5529LP
MSP-EXP430F5529LP.build.board=MSP-EXP430F5529LP

MSP-EXP430F5529LP.upload.tool=dslite
MSP-EXP430F5529LP.upload.protocol=dslite
MSP-EXP430F5529LP.upload.maximum_size=131072
MSP-EXP430F5529LP.upload.maximum_data_size=8192

#MSP-EXP430FR4133

MSP-EXP430FR4133LP.vid.0=0x2341
MSP-EXP430FR4133LP.pid.0=0x0c9f

MSP-EXP430FR4133LP.name=MSP-EXP430FR4133LP

MSP-EXP430FR4133LP.build.mcu=msp430fr4133
MSP-EXP430FR4133LP.build.f_cpu=8000000L
MSP-EXP430FR4133LP.build.core=msp430
MSP-EXP430FR4133LP.build.variant=MSP-EXP430FR4133LP
MSP-EXP430FR4133LP.build.board=MSP-EXP430FR4133LP

MSP-EXP430FR4133LP.upload.tool=dslite
MSP-EXP430FR4133LP.upload.protocol=dslite
MSP-EXP430FR4133LP.upload.maximum_size=15360
MSP-EXP430FR4133LP.upload.maximum_data_size=2048

#MSP-EXP430FR5969

MSP-EXP430FR5969LP.vid.0=0x2341
MSP-EXP430FR5969LP.pid.0=0x0c9f

MSP-EXP430FR5969LP.name=MSP-EXP430FR5969LP

MSP-EXP430FR5969LP.build.mcu=msp430fr5969
MSP-EXP430FR5969LP.build.f_cpu=8000000L
MSP-EXP430FR5969LP.build.core=msp430
MSP-EXP430FR5969LP.build.variant=MSP-EXP430FR5969LP
MSP-EXP430FR5969LP.build.board=MSP-EXP430FR5969LP

MSP-EXP430FR5969LP.upload.tool=dslite
MSP-EXP430FR5969LP.upload.protocol=dslite
MSP-EXP430FR5969LP.upload.maximum_size=65536
MSP-EXP430FR5969LP.upload.maximum_data_size=2048

#MSP-EXP430FR5969

MSP-EXP430FR6989LP.vid.0=0x2341
MSP-EXP430FR6989LP.pid.0=0x0c9f

MSP-EXP430FR6989LP.name=MSP-EXP430FR6989LP

MSP-EXP430FR6989LP.build.mcu=msp430fr6989
MSP-EXP430FR6989LP.build.f_cpu=8000000L
MSP-EXP430FR6989LP.build.core=msp430
MSP-EXP430FR6989LP.build.variant=MSP-EXP430FR6989LP
MSP-EXP430FR6989LP.build.board=MSP-EXP430FR6989LP

MSP-EXP430FR6989LP.upload.tool=dslite
MSP-EXP430FR6989LP.upload.protocol=dslite
MSP-EXP430FR6989LP.upload.maximum_size=130048
MSP-EXP430FR6989LP.upload.maximum_data_size=2048

#MSP-EXP430G2553

MSP-EXP430G2553LP.vid.0=0x2341
MSP-EXP430G2553LP.pid.0=0x0c9f

MSP-EXP430G2553LP.name=MSP-EXP430G2553LP

MSP-EXP430G2553LP.build.mcu=msp430g2553
MSP-EXP430G2553LP.build.f_cpu=16000000L
MSP-EXP430G2553LP.build.core=msp430
MSP-EXP430G2553LP.build.variant=MSP-EXP430G2553LP
MSP-EXP430G2553LP.build.board=MSP-EXP430G2553LP

MSP-EXP430G2553LP.upload.tool=mspdebug
MSP-EXP430G2553LP.upload.protocol=tilib
MSP-EXP430G2553LP.upload.maximum_size=16384
MSP-EXP430G2553LP.upload.maximum_data_size=512

#MSP-EXP430FR5739

MSP-EXP430FR5739LP.vid.0=0x2341
MSP-EXP430FR5739LP.pid.0=0x0c9f

MSP-EXP430FR5739LP.name=MSP-EXP430FR5739LP

MSP-EXP430FR5739LP.build.mcu=msp430fr5739
MSP-EXP430FR5739LP.build.f_cpu=16000000L
MSP-EXP430FR5739LP.build.core=msp430
MSP-EXP430FR5739LP.build.variant=MSP-EXP430FR5739LP
MSP-EXP430FR5739LP.build.board=MSP-EXP430FR5739LP

MSP-EXP430FR5739LP.upload.tool=mspdebug
MSP-EXP430FR5739LP.upload.protocol=tilib
MSP-EXP430FR5739LP.upload.maximum_size=16384
MSP-EXP430FR5739LP.upload.maximum_data_size=512


T

Fmilburn and energia like this

Share this post


Link to post
Share on other sites

 

I have the MSP-EXP430G2 board and it works fine with energia.

Your solution is for the G2553.  The OP asked about the G2231.

Share this post


Link to post
Share on other sites

 

I've included a compiled version of this so you can just load it on the msp430g2231 launchpad.

Use the mspdebug command to load it (Find mspdebug.exe someplace in the Energia install tree on your hard disk)

 

C:\ mspdebug rf2500 "prog andyd273.hex"

 

rename this file to andyd273.hex

attachicon.gifandyd273.txt

 

 

That is awesome, thanks!

I had to use tilib instead of rf2500, but after that it seemed to work. Weirdly the first few times that I unplugged the board and plugged it back in the program seemed to get lost. Then the 4th or 5th time I loaded the program it seemed to stick. 

 

I'll probably pick up a handful of those arduino clones, and maybe a few of the atmega chips so I can just program them and use them without the board, I've just had this board laying around so long that I really wanted to see it given a use.

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