Giter Club home page Giter Club logo

msp432r-core's Introduction

The Energia project is no longer maintained.

Energia, the fork of the Arduino IDE and SDK for the LaunchPad boards, is no longer maintained. The last release 1.8.10E23 was published in December 2019.

The official tools from Texas Instruments are Code Composer Studio, based on Eclipse with an online variant, and the SimpleLink SDK for the ARM Cortex-M MCUs.

What Is Energia?

Energia is a fork/port of Arduino for the Launchpads, or boards with MCUs from Texas Instruments.

What Are the LaunchPads Supported?

Energia provides native support for the following LaunchPads:

  • LaunchPad with MSP430G2231, MSP430G2452 or MSP430G2553 or LaunchPad
  • Experimeter Board with MSP430FR5739 or FraunchPad
  • LaunchPad with MSP430F5529 or FattyPad
  • LaunchPad with MSP430FR5969
  • LaunchPad with Stellaris LM4F120 or Tiva C Series TM4C123 or StellarPad
  • Connected LaunchPad with Tiva C Series TM4C129

What Are the BoosterPacks Supported?

Energia includes ready-to-use libraries for the following BoosterPacks:

  • Anaren Air CC110L BoosterPack
  • Educational BoosterPack MKII
  • LCD Sharp BoosterPack
  • CC3000 SimpleLink WiFi BoosterPack

Looking for Help?

No problem! There are a variety of resources available to get you up and running, and sprinting once you're up and running.

  • GitHub repository - This very page!
  • Download - Download a compiled application for Linux, Mac OS X, or Windows.
  • Website - Full documentation including tutorials, reference, pins maps, FAQ and much more!
  • Wiki - Find basic information and tutorials here.
  • LaunchPad forum at 43oh - A community around the original LaunchPad but also the newer ones.
  • StellarPad forum at Stellaristi - A community more focused on the newer Stellaris LaunchPad.
  • Bug report - Is something not working as it ought to? Or better yet, is there something we could make better?

Clone instructions:

Energia consists of the main repository and a submodule called emt. The emt tree contains the sources for the Energia MT (Multi Tasking) feature that is based on TI-RTOS/SYSBIOS. To clone Energia and the emt submodule:

git clone --recursive https://github.com/energia/Energia.git

If you already have a clone of Energia then:

git submodule update --init --recursive
git submodule sync
cd emt
git pull
cd ..

msp432r-core's People

Contributors

robertinant avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

msp432r-core's Issues

Conflict when using PWM and Servo at the same time

OS: Windows 10 64bit
IDE Version: Energia 1.8.7E21
Board: MSP_EXP432E401Y
Core: MSP432 EMT Red v5.25.0

Currently I'm having an issue when using both analogWrite and the Servo library. It appears that the Servo library isn't aware of what timers analogWrite is using. Therefore, the two can conflict which causes weird behavior on both the pwm and servo pins.

Pins I'm using for PWM
P2.7, P2.6, P2.4 and P5.7

Pins I'm using for Servo
P3.7 and P3.6

Base example I used for testing is below

// Sweep
// by BARRAGAN <http://barraganstudio.com> 
// Modified for Energia/Stellaris Launchpad by Kevin Balke <[email protected]>
// This example code is in the public domain.

#include <Servo.h> 

#define P2_4  38
#define P2_6  39
#define P2_7  40
#define P5_7  17

#define P3_6  11
#define P3_7  31

Servo myservo1;  // create servo object to control a servo 
Servo myservo2;             // a maximum of eight servo objects can be created 
 
int pos = 0;    // variable to store the servo position 
 
void setup() 
{ 

  myservo1.attach(P3_6);  // attaches the servo on Port F, pin 1 (Red LED pin) to the servo object
  myservo2.attach(P3_7);  // attaches the servo on Port F, pin 1 (Red LED pin) to the servo object

  analogWrite(P2_4,50);
  analogWrite(P2_6,100);
  analogWrite(P2_7,150);
  analogWrite(P5_7,200);      
} 
 
 
void loop() 
{ 
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    myservo1.write(pos);              // tell servo to go to position in variable 'pos' 
    myservo2.write(pos);   
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
  for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees 
  {                                
    myservo1.write(pos);   
    myservo2.write(pos);       // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
} 

Based on the above example
image

Based on the above example but I made P5_7 a servo pin and P3_7 a pwm pin.
image

Based on the above example but I made P5_7 a servo pin and P3_6 a pwm pin.
image

As you can see at times depending on the order that pwm and servo pins are first used the output can vary. All six pins should have some kind of output but that isn't the case with the above.

Two Boards with Same Board Tag

MSP432 LaunchPad red and MSP432 LaunchPad pre-series share the same board tag MSP-EXP432P401R, even after just released 4.9.1 of MSP432 LaunchPad red board package.

MSP-EXP432P401R.name=LaunchPad w/ msp432 EMT (48MHz)
MSP-EXP432P401R.name=RED LaunchPad w/ msp432 EMT (48MHz)

The board tag is unique to each board. In the case of the MSP432 LaunchPad red, it should be MSP-EXP432P401RED.

MSP-EXP432P401R.name=LaunchPad w/ msp432 EMT (48MHz)
MSP-EXP432P401RED.name=RED LaunchPad w/ msp432 EMT (48MHz)

EDU BoosterPack LCD Examples don't compile

LCD examples for EDU BoosterPack don't compile on MSP432. (Examples> 09.EducationalBP_MKII>LCD_*)

Error reports multiple definitions of several functions in the display library.

Compilation errors and warnings

There are quite a few compilation errors and warnings for:

  1. The builtin example Sketches.
  2. Examples for the builtin libraries.
  3. Examples for the libraries included in the MSP432 core packages.

macOS 10.15 — Build fails

When running on macOS 10.15 Catalina, building against the MSP432P401R raises an error.

/Applications/IDE/Energia.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /var/folders/wn/n7qqb8ss0k3bvpqwfcdwp_7r0000gn/T/arduino_build_325956/preproc/ctags_target_for_gcc_minus_e.cpp
fork/exec /Applications/IDE/Energia.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags: bad CPU type in executable
Error compiling for board LaunchPad w/ msp432 EMT (48MHz).

However, using embedXcode succeeds.

Might be related to energia/cc13x2-core#6

Code Behaves Differently Against MSP432 Black and Red

The same code behaves differently when used against the RED LaunchPad w/ msp432 EMT (48MHz) boards package release 5.6.1 and the LaunchPad w/ msp432 EMT (48MHz) boards package release 3.8.0.

The code uses the vsprintf() function to format a number. It seems to be missing when targeting the RED LaunchPad w/ msp432 EMT (48MHz) boards package release 5.6.1.

Results

  • With RED LaunchPad w/ msp432 EMT (48MHz) boards package release 5.6.1

oC

  • With LaunchPad w/ msp432 EMT (48MHz) boards package release 3.8.0

+23.4 oC

Code


#include "stdarg.h"
#include "stdio.h"

char bufferOut[128];

String formatString(const char * format, ...)
{
  va_list args;
  va_start(args, format);
  vsprintf(bufferOut, format, args);

  va_end(args);
  return String(bufferOut);
}

float temperature = 23.4;

void setup() {
  Serial.begin(9600);
  delay(500);

  Serial.println();
  Serial.println((formatString("%+6.1f oC", temperature)));
}

void loop() {

}

Boards Packages Releases

capture 2018-06-08 a 10 31 54

undefined reference to `toneTimerId'

OS: Windows 10 64bit
IDE Version: Energia 1.8.7E21
Board: MSP_EXP432E401Y
Core: MSP432 EMT Red v5.25.0

Building any program or example that uses the Tone library results in this error.

makefile:153: recipe for target 'toneMelody.out' failed C:/Users/a0273011/workspace_v9-rslk-test11111/msp432r_MSP-EXP432P401R_core/Debug\libmsp432r_MSP-EXP432P401R_core.a(Tone.o): In function tone(unsigned char, unsigned int, unsigned long)':
C:/ti/energia_msp432r_5.25.0/cores/msp432r/ti/runtime/wiring/Tone.cpp:107: undefined reference to toneTimerId' collect2.exe: error: ld returned 1 exit status gmake[1]: *** [toneMelody.out] Error 1 gmake[1]: Target 'secondary-outputs' not remade because of errors. gmake: *** [all] Error 2 makefile:146: recipe for target 'all' failed

This problem doesn't exist on the previous release 5.23.1

Has been verified on Energia IDE, CCS Cloud and CCS IDE using v5.25.0.

Spi modes 0/1 and 2/3 definitions incorrect (5.25.0)

It looks like the definitions for SPI_MODE0 and 1 (and the definitions for SPI_MODE2 and 3) have been swapped when going from 5.23.1 to 5.25.0. My perusal of the TI documentation seems to indicate that the 5.23.1 versions were correct.

5.23.1\cores\msp432r\ti\runtime\wiring\SPI.h

#define SPI_MODE0 SPI_POL0_PHA0
#define SPI_MODE1 SPI_POL0_PHA1
#define SPI_MODE2 SPI_POL1_PHA0
#define SPI_MODE3 SPI_POL1_PHA1

5.25.0\cores\msp432r\ti\runtime\wiring\SPI.h

#define SPI_MODE0 SPI_POL0_PHA1
#define SPI_MODE1 SPI_POL0_PHA0
#define SPI_MODE2 SPI_POL1_PHA1
#define SPI_MODE3 SPI_POL1_PHA0

Workshop — PWM Issue on RED MSP432P401R LaunchPad 5.6.3

The same code using PWM for the RGB LED works on the black but not on the red MSP432P401R LaunchPad.

  • Black MSP432P401R LaunchPad with board package 3.8.0

The RGB LEDs display yellow, orange and red colours.

  • Red MSP432P401R LaunchPad with board package 5.6.2

The RGB LEDs display none of the colours.

  • Minimal sketch
void setup() {
  // put your setup code here, to run once:
  pinMode(RED_LED, OUTPUT);
  pinMode(GREEN_LED, OUTPUT);
  pinMode(BLUE_LED, OUTPUT);
}

void setRGB(uint8_t red, uint8_t green, uint8_t blue)
{
  analogWrite(RED_LED, red);
  analogWrite(GREEN_LED, green);
  analogWrite(BLUE_LED, blue);  
}

void loop() {
  // put your main code here, to run repeatedly: 
  setRGB(127, 127, 0); // yellow
  delay(1000);
  setRGB(127, 63, 0); // orange
  delay(1000);
  setRGB(127, 0, 0); // red
  delay(1000);  
}

Weird Access is denied issue on Upload

OS: Windows 10 64bit
IDE Version: Energia 1.8.7E21
Board: MSP_EXP432E401Y
Core: MSP432 EMT Red v5.25.0

A student received the below error message when uploading code to their launchpad. I'm waiting for the verbose output but for now here is the error message that I received.

Sketch uses 40536 bytes (15%) of program storage space. Maximum is 262144 bytes.
Global variables use 8032 bytes (12%) of dynamic memory, leaving 57504 bytes for local variables. Maximum is 65536 bytes.
boost::filesystem::create_directories: Access is denied: "C:\Users\1#p\AppData\Local\Texas Instruments"
If this continues, please run fsclean or set TI_APPDATA_DIR to directory you have permissions to access
An error occurred while uploading the sketch

LED1 not defined in pins_energia.h

LED1 is referred in MSP432R Launchpad pinout. But no LED1 is defined properly in the pins_energia.h file, so I got "LED1 was not declared". The version I used is 5.6.1.

Windows 7 and 10 fails to resolve path to Java

During build the system claims that it can not find java with an error that
{runtime.ide.path}/java/bin/java
could not be found

changing this in platfrom.txt fixes the issue (locally)
#build.ino2cpp.cmd.windows={runtime.ide.path}/java/bin/java
build.ino2cpp.cmd.windows=c:/energia-1.6.10E18/java/bin/java

Anaren CC110L Examples Fail to Compile Against MSP432

The examples provided by Energia for the Anaren CC110L fail to compile against the MSP432.

In file included from ~/Library/Energia15/packages/energia/hardware/msp432/3.8.0/libraries/AIR430BoostEuropeETSI/utility/A110x2500Radio.cpp:29:0:
~/Library/Energia15/packages/energia/hardware/msp432/3.8.0/libraries/AIR430BoostEuropeETSI/utility/Platform.h:31:31: fatal error: driverlib/rom_map.h: No such file or directory
 #include <driverlib/rom_map.h>

                               ^
compilation terminated.

when rom_map.h has migrated to driverlib/MSP432P4xx/rom_map.h.

Change lines 31-33 to

#include <driverlib/MSP432P4xx/rom_map.h>
#include <driverlib/MSP432P4xx/gpio.h>
#include <driverlib/MSP432P4xx/spi.h>

SPI doesn't work as expected on MSP432 RED

SPI doesn't work as expected on MSP432 RED.

SPI modes seem to be mixed on MSP432R in silicon.

  • Mode0 and Mode1 are inverted.
  • Mode2and Mode3 are inverted.

For more information, please refer to MSP432P401R Device Erratasheet (Rev. O).

Different options:

  • Try building against against LaunchPad w/ MSP432 EMT (48 MHz) and not RED LaunchPad w/ MSP432 EMT (48 MHz)

capture 2018-05-05 a 10 53 41

  • Edit file ~/Library/Energia15/packages/energia/hardware/msp432/3.8.0/libraries/EduBPMKII_Screen/Screen_HX8353E.cpp and replace line 92
    SPI.setDataMode(SPI_MODE0);

by

#if defined(ENERGIA_ARCH_MSP432R)
#warning Horrible patch for hardware bug
    SPI.setDataMode(SPI_MODE1);
#else
    SPI.setDataMode(SPI_MODE0);
#endif

capture 2018-05-05 a 10 55 56

Serial printing issues.

I am having issues getting basic serial print usage working.

OS: Windows 10 64bit
IDE Version: Energia 1.8.7E21
Board: MSP_EXP432E401Y
Core: MSP432 EMT Red v5.23.1

When uploading the below code serial monitor outputs garbage text. However, doing a soft reset (hitting reset button) fixes this issue.
This code results in garbage text output:

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly: 
  Serial.println("hey");
}

image

Root cause is likely the same but this code doesn't generate any output when you upload it. Doing a soft reset output text but its garbage text.

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.print("hey");
}

void loop() {
  // put your main code here, to run repeatedly: 

}

image

Sometimes a delay fixes some of these issues. But with the below example it outputs text but its still has some garbage included.

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  delay(10000);
  Serial.print("hey");
}

void loop() {
  // put your main code here, to run repeatedly: 

}

image

Porting BLE Library to MSP432 Red

This is a continuation of #10.

The BLE library used to work with release 5.23.1 but no longer with latest release 5.29.0.

Building the example SerialOverBLE against the MSP432P401R fails with the following error:

In file included from /Users/ReiVilo/Documents/Projets/Energia/libraries/BLE/src/BLE.cpp:13:0:
/Users/ReiVilo/Documents/Projets/Energia/libraries/BLE/src/BLEBoard.h:16:44: fatal error: variants/MSP_EXP432P401R/Board.h: No such file or directory
 #include "variants/MSP_EXP432P401R/Board.h"
                                            ^
compilation terminated.

Question: Support for variants/MSP_EXP432P4111

Release 5.25.0 includes variants/MSP_EXP432P4111 but without file pin_names_energia.h.

Similarly, boards.txt doesn't list MSP_EXP432P4111.

Is there an ETA for MSP_EXP432P4111 being supported by Energia?

libMiniDump.so error on Ubuntu 16.04

OS: Ubuntu 16.04
IDE Version: Energia 1.8.7E21
Board: MSP_EXP432P401R
Core: MSP432 EMT Red v5.23.1

When building a program on a laptop running Ubuntu the students kept getting this compile error. Based on google search it seems the compiler requires this package. But we were unable to find a solution. This prevented the student from compiling any program.

IMG_2086

MSP432P401R end-of-life

According to distributors, the MSP432P401R is end-of-life and not recommended for new designs.

Capture 2021-11-14 à 11 43 56

Workshop — vsprintf() Does Not Work Properly on Floats

The vsprintf() function used to format a number does not work properly on floats, even with explicit #include "stdarg.h"and #include "stdio.h", with MSP432 red release 5.23.1.

  • Results

With RED LaunchPad w/ msp432 EMT (48MHz) boards package release 5.23.1

oC

  • Expected result

e.g. with LaunchPad w/ msp432 EMT (48MHz) boards package release 3.8.0

+23.4 oC

  • Code
#include "stdarg.h"
#include "stdio.h"

char bufferOut[128];

String formatString(const char * format, ...)
{
  va_list args;
  va_start(args, format);
  vsprintf(bufferOut, format, args);

  va_end(args);
  return String(bufferOut);
}

float temperature = 23.4;

void setup() {
  Serial.begin(9600);
  delay(500);

  Serial.println();
  Serial.println((formatString("%+6.1f oC", temperature)));
}

void loop() {

}

This issue replaces #11 as the black MSP432 LaunchPad is deprecated.

Feature Request — Implement Slave I²C on MSP432

Is I²C slave implemented on the MSP432?

I was unable to run this very basic program on the MSP432. I tried

  • MSP432 standard and MSP432 red,
  • ports myWire(0) and myWire(1).

However, the very same program runs fine on the old MSP430G2553 on port myWire(0).

The Arduino Uno board is connected to the LaunchPad through a logic level converter with the required pull-up resistors.

  • Slave
#include "Energia.h"
#include "Wire.h"
#define myLED RED_LED

// I2C slave 0x22 command[value]
// - Command
// A: on
// C: off


// MSP432
// 0 = pins 14=SCL 15=SDA
// 1 = pins  9=CLK 10=SDA
//TwoWire myWire(0); // fails
TwoWire myWire(1); // fails also

//// MSP430G2553 - works!
//// 0 = legacy   pins 14=SCL 15=SDA, master and slave
//// 1 = software pins  9=CLK 10=SDA, master only
//TwoWire myWire(0);

void ReceiveEventI2C(int howMany)
{
    uint8_t command = myWire.read();

    switch (command) {
        case 'A':
            digitalWrite(myLED, HIGH);
            break;

        default:
            digitalWrite(myLED, LOW);
    }
}

void RequestEventI2C()
{

}

void setup()
{
    pinMode(myLED, OUTPUT);

    myWire.begin(0x22);
    myWire.onReceive(ReceiveEventI2C);
    myWire.onRequest(RequestEventI2C);
}

void loop()
{
}
  • Master
#include "Arduino.h"
#include "Wire.h"
#define I2C_SLAVE 0x22

void send(uint8_t command)
{
    Wire.beginTransmission(I2C_SLAVE);
    Wire.write(command);
    Wire.endTransmission();
}

void setup()
{
    Wire.begin();
    Serial.begin(9600);
}

void loop()
{
    Serial.println("A");
    send('A');
    delay(1000);

    Serial.println("C");
    send('C');
    delay(1000);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.