Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Posts posted by LIJsselstein

  1. As a form of documenting... I just added another new MCU to Energia and -in short- had to do the following to get it working:

    In Energia 1.8.7E21:

    Copy from a close family member the following files and replace the model name with the new model name in the directory-/filename and file content:

    • \hardware\energia\msp430\variants\[existing-model]\
    • \hardware\tools\DSLite\common\targetdb\devices\[existing-model].xml
    • \hardware\tools\DSLite\common\targetdb\options\[existing-model]_GNU.xml
    • \hardware\tools\DSLite\common\targetdb\options\[existing-model]_TI.xml
    • \hardware\tools\msp430\msp430\lib\ldscripts\[existing-model]\
    • \hardware\tools\msp430\msp430\include\[existing-model].h

    Add the new model to the following files:

    • \hardware\energia\msp430\boards.txt
    • \hardware\tools\msp430\msp430\include\msp430.h
    • \hardware\tools\msp430\msp430\lib\msp430mcu.spec

    Of course, check for differences between the two family members (e.g. missing or added peripherals, memory sizes) and edit the copied files accordingly.

    After the above changes it might help to remove the temporary build tree. These are located in ~/.energia15 for Linux and  %userprofile%\appdata\local\Energia15 for Windows.

  2. Thanks for pointing me to right location. ūüĎć I always assumed that msp430-lg-core stood for legacy so didn't look further in the tree...

    I haven't been able to try this yet because the make_mito_release.sh script tries to download this file but the website constantly reports that it's offline due to maintenance for 2 days.

    Edit: Searching for the correct link via the Design Resources webpage on the ti.com website I get a new link to the latest Linux compiler.

  3. Perhaps I have missed something but it seems that the latest Energia 1.8.7E21 with Eneriga MSP430 boards package 1.05 is still using gcc 4.6.3 from 2012. Where can I find the updated board package with the msp430-elf-gcc compiler?

    If this project hasn't been completed yet, what can be done to help it forward, how can I help?

  4. Energia on the msp430fr2xxx-4xxx range falls back to using the REFO 32kHz clock when the external 32kHz crystal is not populated. REFO is a nice stable/accurate clock, but when you look it up in the datasheet (e.g. p24 in FR2433) you’ll notice the consumption is 15uA. See also line 139 in wiring.c.

    So, to get really low power with Energia (~1uA in LPM3 with sleep/sleepSeconds), either customise wiring.c to use VLO clock instead of REFO (but you loose clock accuracy) or add external LF crystal. Using driverlib/CCS without ext. LF crystal is basically the same: lowest power=inaccurate clock, a bit less low power=accurate clock.

  5. I think this is because, when there is no external XTAL connected, Energia (wiring) usually falls back to the VLO source (~12k Hz). But on the FR2433 the clock falls back to the REFO source which runs about 3x faster ( ~32768 Hz).

    However the code in wiring.h does not reflect this. Please look around line 144 in wiring.c (hardware/energia/msp430/cores/msp430/wiring.c):

    /* ACLK = VLO = ~ 12 KHz */
    vlo_freq = 8000;
    /* Source ACLK from REFO */

    Where I think it should be:

    /* ACLK = REFO = ~ 32 KHz */
    vlo_freq = 32768;
    /* Source ACLK from REFO */

    Since Sleep() uses the clock for timing and Delay() uses the CPU frequency for timing, this could explain your difference.

    Pinging @StefanSch

  6. @energia Below is the relevant section from boards.txt:

    LL-MSP430FR2433.name=LoRa Logger w/ MSP430FR2433


  7. @energiaDo you know if the CCS team is planning to support importing Energia projects for non-launchpad boards?

    I have an Energia project with a custom MSP430FR2433 board and would like to use the CCS debugging features, but when trying to import the project CCS does not import the board definition as well, it only allows you to select Launchpads.

  8. Thanks, wat was your criteria for singling out these libraries/protocols? There are a gazillion protocols and software tools that could be used for remote communication, ranging from very simple to very complex, form propitiatory/manufacturer specific to modbus, mqtt and IEC 60870-5. An xkcd cartoon would be appropriate.

  9. The program I am using needs to have control over changing into and out of the various Low Power Modes on the MSP430.   I need to listen for interrupts.  I need to use I2C to communicate with various devices that are connected to the MSP430.  I need to monitor Power Level/Consumption from time to time.


    Yes, a collegue and I have been doing all of the above with a G2553 (and other chips like the 28 pin version and the FR2433) using sleep (LPM0), sleepSeconds (LPM3), interrupts, ADC and master/slave I2C. We found two bugs in the I2C implementations and made bugreports and pull-requests for them. At least one pull-request is over a year old and has not been pulled-in, not sure why. So, it depends a bit on your specific situation if you'll run into any problems or not. CCS we found especially useful to do register level debugging of our I2C problems after importing the Energia sketch (which does not work for our custom FR2433 board!) and using EnergyTrace++ (a very very cool tool when doing low power development).

  10. I also often have problems with libraries in Energia where the compiler says 'No such file or directory' while the library is clearly installed correctly. In at least one instance I was able to fix this, perhaps this works for you as well:


    When the  "#include <BlynkSimpleTI_CC3200_LaunchXL.h>" statement is in a header file but only the accompanying .cpp file is referencing anything in the Blynk library then you could try to move the #include to the .cpp instead.

  11. I ran into this error while developing a reasonably large application using Energia-1.6.10E18. The minimal code to producing this error is below:


    File: Someheader.h

    #ifndef __SOMEHEADER#define __SOMEHEADER// Infomem address for the correction factor. This factor is two bytes long.#define INFOMEM_CORRECTION_FACTOR 0x1855// Read a value from infomem. If not between min and max, return standard valuetemplate <typename T>T readInfomemValueLimit(T min, T max, T* address, T stdValue){  if (*address < min || *address > max ){    return stdValue;  }  return *address;}#endif
    #include <Wire.h>#include "someheader.h"// Calculate the measurement interval based on messages per day, and the time correctionuint32_t applyCorrection(uint16_t value){  uint16_t temp = 1;  // Get the correction factor from information memory and make sure it is within specified bounds  uint16_t correctionFactor = readInfomemValueLimit((uint16_t)0, (uint16_t)20000, (uint16_t *)(INFOMEM_CORRECTION_FACTOR), (uint16_t)10000);  return (uint32_t)((uint16_t)temp * (uint16_t)correctionFactor);}void setup() { }void loop() {  //uint16_t someValue = 1;  //uint32_t correctedValue;  //correctedValue = applyCorrection(someValue);}
    The compilation output is:

    C:\energia-1.6.10E18\arduino-builder -dump-prefs -logger=machine -hardware "C:\energia-1.6.10E18\hardware" -tools "C:\energia-1.6.10E18\tools-builder" -tools "C:\energia-1.6.10E18\hardware\tools\msp430" -built-in-libraries "C:\energia-1.6.10E18\libraries" -libraries "C:\Energia\libraries" -fqbn=energia:msp430:MSP-EXP430G2553LP -ide-version=10610 -build-path "C:\Users\LIJSSE~1\AppData\Local\Temp\build251f882e875a4832b4dad2f88cd38085.tmp" -warnings=more -prefs=build.warn_data_percentage=75 -verbose "C:\Energia\test_struct\test_struct.ino"

    C:\energia-1.6.10E18\arduino-builder -compile -logger=machine -hardware "C:\energia-1.6.10E18\hardware" -tools "C:\energia-1.6.10E18\tools-builder" -tools "C:\energia-1.6.10E18\hardware\tools\msp430" -built-in-libraries "C:\energia-1.6.10E18\libraries" -libraries "C:\Energia\libraries" -fqbn=energia:msp430:MSP-EXP430G2553LP -ide-version=10610 -build-path "C:\Users\LIJSSE~1\AppData\Local\Temp\build251f882e875a4832b4dad2f88cd38085.tmp" -warnings=more -prefs=build.warn_data_percentage=75 -verbose "C:\Energia\test_struct\test_struct.ino"

    Using board 'MSP-EXP430G2553LP' from platform in folder: C:\energia-1.6.10E18\hardware\energia\msp430

    Using core 'msp430' from platform in folder: C:\energia-1.6.10E18\hardware\energia\msp430

    Detecting libraries used...

    "C:\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=msp430g2553 -DF_CPU=16000000L -DARDUINO=10610 -DENERGIA=10610 -DENERGIA_MSP-EXP430G2553LP -DENERGIA_ARCH_MSP430 -IC:\energia-1.6.10E18\hardware\tools\msp430/include "-IC:\energia-1.6.10E18\hardware\energia\msp430\cores\msp430" "-IC:\energia-1.6.10E18\hardware\energia\msp430\variants\MSP-EXP430G2553LP" "C:\Users\LIJSSE~1\AppData\Local\Temp\build251f882e875a4832b4dad2f88cd38085.tmp\sketch\test_struct.ino.cpp" -o "nul"

    "C:\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=msp430g2553 -DF_CPU=16000000L -DARDUINO=10610 -DENERGIA=10610 -DENERGIA_MSP-EXP430G2553LP -DENERGIA_ARCH_MSP430 -IC:\energia-1.6.10E18\hardware\tools\msp430/include "-IC:\energia-1.6.10E18\hardware\energia\msp430\cores\msp430" "-IC:\energia-1.6.10E18\hardware\energia\msp430\variants\MSP-EXP430G2553LP" "C:\Users\LIJSSE~1\AppData\Local\Temp\build251f882e875a4832b4dad2f88cd38085.tmp\sketch\test_struct.ino.cpp" -o "nul"

    Generating function prototypes...

    "C:\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=msp430g2553 -DF_CPU=16000000L -DARDUINO=10610 -DENERGIA=10610 -DENERGIA_MSP-EXP430G2553LP -DENERGIA_ARCH_MSP430 -IC:\energia-1.6.10E18\hardware\tools\msp430/include "-IC:\energia-1.6.10E18\hardware\energia\msp430\cores\msp430" "-IC:\energia-1.6.10E18\hardware\energia\msp430\variants\MSP-EXP430G2553LP" "C:\Users\LIJSSE~1\AppData\Local\Temp\build251f882e875a4832b4dad2f88cd38085.tmp\sketch\test_struct.ino.cpp" -o "C:\Users\LIJSSE~1\AppData\Local\Temp\build251f882e875a4832b4dad2f88cd38085.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"

    "C:\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\LIJSSE~1\AppData\Local\Temp\build251f882e875a4832b4dad2f88cd38085.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"

    Compiling sketch...

    "C:\energia-1.6.10E18\hardware\tools\msp430/bin/msp430-g++" -c -g -O2 -Wall -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=msp430g2553 -DF_CPU=16000000L -DARDUINO=10610 -DENERGIA=10610 -DENERGIA_MSP-EXP430G2553LP -DENERGIA_ARCH_MSP430 -IC:\energia-1.6.10E18\hardware\tools\msp430/include "-IC:\energia-1.6.10E18\hardware\energia\msp430\cores\msp430" "-IC:\energia-1.6.10E18\hardware\energia\msp430\variants\MSP-EXP430G2553LP" "C:\Users\LIJSSE~1\AppData\Local\Temp\build251f882e875a4832b4dad2f88cd38085.tmp\sketch\test_struct.ino.cpp" -o "C:\Users\LIJSSE~1\AppData\Local\Temp\build251f882e875a4832b4dad2f88cd38085.tmp\sketch\test_struct.ino.cpp.o"

    <command-line>:0:12: warning: missing whitespace after the macro name [enabled by default]


    C:\Users\LIJSSE~1\AppData\Local\Temp\cc9RPlUb.s: Assembler messages:


    C:\Users\LIJSSE~1\AppData\Local\Temp\cc9RPlUb.s:24: Error: odd operand: 6229


    exit status 1

    Error compiling for board MSP-EXP430G2553LP.

    The compiler error is is triggered in the line "return (uint32_t)((uint16_t)temp * (uint16_t)correctionFactor);", if you replace the variable correctionFactor with a constant (e.g. 1) then the sketch compiles successfully. The target doesn't seem to matter, the above is for the Launchpad but compiling for my own board with MSP430FR2433 gives the same error.


    Any ideas why this happens?

  12. When you only need one switch level, use a float switch. Cheap, easy, super low power, and it works . Put your mcu in lpm4 and wait for the switch interrupt to wake you up. If you need reliability in debris filled water or need to protect it against animals or vandalism then mount the switch in a perforated pvc tube.

  13. Yes, i've been doing telemetry since approx. 1997. Since then the prices have dropped significantly, both hardware as data bundles so we're connecting ever smaller and smaller installations as well. I guess that somewhere you cross the line between telemetry and IoT but nothing really changes. Even when there isn't a real boundary I'm still cool with 'IoT' because customers want it.. :)

  14. So just last week I stood before some 300 fruit farmers at a university research center showing our little IoT soil moisture transmitter that may either lift the burden of manually measuring twice a day on multiple locations, or from the long wires crisscrossing their fields with gprs modems and bulky batteries. There was quite some interest both from farmers as from their consultants. The name 'IoT' may be hype but there are a lot of realy useful applications.

  15. Thanks Rick for taking the time.

    As you probably know, Arduino/Energia produces bloated code -and that's ok-, when you compile a simple blinky sketch that only toggles a pin, it will still include lots of other code into your hex file. I.e. I2c init code is always included, as is TimerSerial and Tone apparently. Even if you don't use i2c or software serial, as in the blinky example.


    Indeed, one of the primary reasons for choosing the fr2433 was availability of the three hardware serial peripherals, specifically the two UARTS. Though maybe software serial might come in handy for debugging or somesuch when both hardware ones are already in use.

  • Create New...