This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Combining CCS code with Energia Sketch

Other Parts Discussed in Thread: ENERGIA

Hi,

I have built a code in CCS v6 for TM4C1294 for Modbus RTU Master/ Slave using basic C programming and Driver Libraries. I want to combine it with an Energia Sketch for Ethernet Client. Is this possible, please guide me with an example if possible.

Thanks.

  • Hello Komal

    Would be worth while to check on Energia on "How-To". Out friend Luis Afonso has been an Energia enthusiast and I may try to ping him,

    Regards
    Amit
  • We're told that such "pings" accompanied with LPads & RDKs are especially effective. (just say'in)
  • Actually right now a good pepperoni pizza would be better :p

    As Amit suggested, going to the forum.43oh.com in the Energia section should prove to be better.

    Now if you want an example on how to use that code with Ethernet I can't really help.
    Now if you want to simply be able to use the code in Energia it's really simple. The Energia uses the GNU compiler, actually you can make Energia sketches in CCS if you use the GNU compiler, even the libraries like the Ethernet one.
    Now if I remember correctly, in Energia you need to include all the correct driver files this way, instead of doing #include "driverlip/gpio.h you do #include "driverlib/gpio.c". And remember that the files inside the "inc" folder are included with #include "inc/file.h".

    That should pretty much it. If you have done a code for the TI compiler, this is what usually needs to be done to work in the Energia IDE. Now, remember that in Energia IDE you don't have access to the startup file or anything, so when using interrupts, using the "Register" functions for the handlers is easier. Also, remember to manage the files if you had multiple one (like 1 file for handlers, 1 for the main, 1 for the Modbus RTU functions) by adding files to the sketch.
  • Good for you Luis. Suspect this is bit (more) work than poster wanted.

    Anyway - enjoy your pizza - some way/how "box of LPads" arrived my doorstep! (I'm hungry - yet still satisfied...)
  • Komal Marathe said:

    Hi,

    I have built a code in CCS v6 for TM4C1294 for Modbus RTU Master/ Slave using basic C programming and Driver Libraries. I want to combine it with an Energia Sketch for Ethernet Client. Is this possible, please guide me with an example if possible.

    Thanks.

     Hi Komal, it is not clear to me if you wish use CCS written code on Energia or use Energia Library on CCS code.

     So if you wish port Library to energia see here:

    http://energia.nu/Tutorial_Library.html

     If you wish import Code from Energia to CCS I first suggest try port your library to Energia, if it work leave just as is, then from CCS import ENERGIA Sketch, point to where is code and continue development on CCS using energia Libraries. If you desire port again on Energia some rework are necessary to imported code, process is one way only from Energia to CCS.
     I am using Energia two fold, didactic target and to try sketch when just this code example is on.

     At last, MODBUS, are you using code written from you or you ported some available like freemodbus?

  • Hello Komal,

    Do you find an easy way to do it?

    Uriel

  • It's already really simple...

    I can only add this which explains how to use Energia sketches in CCS:
    43oh.com/.../
  • This was put together in like 5min:
    Edit: Remember to read the description.

    The best I can make since I don't want to be doing video editing, uninstalling things or clear settings nor speaking over it, requiring lots of takes until I am not annoyed with my bad english.

  • Thanks Luis.

    There is away to do it in the second direction - to insert an enregia function to CCS project?

  • There is a way. But why would you do it?

    You need to use a C++ compiler, and you would need to use the GCC most likely, you need to configure the linker and the compiler to use Energia libraries, and because of that you would probably need to make many more adaptations or you would basically get the same result shown above but by going with a much harder path (even if you did those adaptations, it would pretty much be the same).

    Of course you can try to configure the compiler and edit the files to just use some functions, but that would require so much work compared to just using a Energia sketch to begin with.
  • Hello Luis,

                        I am also facing similar problem. what I understand with your explanation is I can use CCS driver library files with energia. Am I correct?

    Could you please explain it in detail please.

  • Hello LAXMI KANT TIWARI,

    You can combine CCS code with Energia Sketch in 2 ways:

    1. Use Energia Sketch and place in it CCS code (with adjustments, if they are required). This way always works.

    2. Use CCS project and place in it code from Energia libraries (usually adjustments are required). This way can work when the specific Energia code can be written at C (a large part  of Energia functions is in C++).

  • can you please explain the 1st step in detail??
  • Hello,

    How can you do this for msp432 in ccsv7? I've tried but can not build the code

    Regards.