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.

Tiva C Series TM4C1294 Connected LaunchPad - HTTP Server Application

Other Parts Discussed in Thread: SW-TM4C, EK-TM4C1294XL

H Everyone,

Recently i purchased Tiva C Series TM4C1294 Connected LaunchPad , i want to control(ON/OFF) the port pins of TM4C1294 through Internet. where i can get the sample code for this?

I believe it would be easy to create with the help of TI EXOSITE  but if i want to develop my own HTML/ASP.net application how do i can start?

Thanks,

Ashok r

  • I preface this post by saying I know nothing about ASP.net.

    TI EXOSITE is configured where the TI device is a client.  Exosite is the cloud server. The advantage of this configuration is that you can more easily pass through corporate firewalls and access your data from the internet.  In this case to access the data you point your browser to exosite (not the device) and the exosite servers have already parsed, stored and made pretty the data presentation.

    The alternate configuration is where the TI device is the server. In this case the HTML actually lives on the TI device.  you point your browser to the IP addess of the device itself.  you can use server side includes and CGI to live update the data on the web page with real data from the application.  Look at enet_io for a good example of this application model.

    If you want to create your own server application on your own server machine then create the RESTful interface, usually a GET request with parameters in the URL.  How to do this is outside the scope of this forum, lots of good resources elsewhere for your server configuration I am sure.  Once you have a server with a GET type API then you can examine the exosite code and see how to create a GET request with API parameters in the URL and then parse the response. 

  • Thanks Dexter.

    I am new to this so did not have much idea on  creating server related application using RESTful / GET request , probably i will start looking into those stuffs. 


    before that one more question.

    if i want to add some additional Toggle Buttons to the Exosite  widget , how i can do that?  In my application i want to control more than 40 Switches using cloud.

    thanks,

    Ashok r

  • There is a WIKI page for the CLP adding data sources.  It adds an analog input if I recall but the concept is the same from the embedded side.

    Adding a widget and graphical stuff to the exosite dashboard is not covered but the exosite folks can help you with that.

    http://processors.wiki.ti.com/index.php/CLP_Exosite_Data_Sources

  • Hi Dexter,


    I have contacted exosite technical team , so now i am able to create more button controls on my dashboard  so the next thing is to make corresponding changes in Launchpad Ethernet example code. I downloaded tivaware code bundles in which is the default code coming with Tiva C Connected launchpad? (SW-EK-LM4F232-2.1.0.12573)

    and where exactly i have to make the changes?

    thanks,

    Ashok r

  • SW-EK-LM4F232 is not the right software package for the EK-TM4C1294XL Connected Launchpad.

    I suggest you download SW-TM4C which has all the TivaWare packages and boards.  http://www.ti.com/tool/sw-tm4c

    After that look at my previous post and you will find a link to a wiki page that explains the software and how to modify it to add Exosite data sources and get those data sources transferred to the Exosite server.

  • Hi Dexter,

    I found some example code inside my installed path "C:\ti\TivaWare_C_Series-2.0.1.11577\examples\boards\dk-tm4c129x\enet_io\fs" 

    What is that I/O Control Demo?  it demonstrate Toggling  USER LED using some java scripts. these kind of controlling only i am looking for , how do i can add more toggle buttons and make it work?

    thanks,

    Ashok r

  • First, my understanding was that you have an EK-TM4C1294XL connected Launchpad.  Stop looking at code written fro the DK-TM4C129X.  It is a different board and for a beginner using code not written and tested on your board will only cause you more trouble.

    There is a similar enet_io example in the examples\boards\ek-tm4c1294xl\ directory.  It perform local control of various code and board elements from an HTTP server that runs on the TM4C1294.  Up to now my understanding was that you wanted a cloud based solution.  Typically that means that the TM4C1294 acts as a client to a dedicated cloud host such as Exosite.  The enet_io is self contained and does not require a cloud host.  You will type the IP address of your board directly into the web browser URL.  This example generally only works if you and the TM4C are on the same side of the nearest firewall or router.  Cloud solutions as previously stated are much more adept at working globally.

    I am less familiar with this example, further I think at this point you are best served by doing some learning and discovery on your own.  Read the documentation and readme files that come  with the example.  Use the debugger to follow code execution through different functions and see how things work.  You will learn much more in the doing then in the hearing (from me or anyone else).

    Dexter

  • Hi Dexter,

    I downloaded the latest Tiva ware  and i tried  example project "enet_io"  this example shows the control of led within  local network. In the same way i want to control globally using my own domain. for now i can use exosite  for control but later i must need to control through my own domain. please refer me some good links/ books to make such kind of application.

    Thanks,

    Ashok r

  • Hi Dexter,

    I tested the qs_iot example , it works fine also i added new data into exosite  it also works. But when i add more data (more than 4 Integers) App is not working. From debugging i came to know that its entering into the Fault ISR

    FaultISR(void)
    {
        //
        // Enter an infinite loop.
        //
        while(1)
        {
        }
    }  

    what could be the issue?

    #define NUM_STATS                           17   (because i added 5 new integer data)   

    it works when i have added 4 data  -->  #define NUM_STATS                           16

    Thanks,

    Ashok r

  • A couple of great resources. That can help you backtrack out of the fault ISR and determine what line(s) of code are causing the issues.  If you can use these to debug faults on a cortex M then you have learned a valuable skill that in my opinion puts you ahead of many folks on these forums.  The best part is that it is not really that hard, just applied MCU debugging.

    http://www.freertos.org/Debugging-Hard-Faults-On-Cortex-M-Microcontrollers.html

    http://www.ti.com/lit/an/spma043/spma043.pdf

    Given your description that it works with 4 new data sources but not with 5, then i would start looking at what changes when you add a data source.  What variables or strings related to data sources will grow or change as a result of a change to that #define NUM_STATS?   

    A few that come to mind are the obvious stats arrays themselves and the global variables associated with the data.  However, more hidden are things like the string of encoded payload data that is sent to the exosite server.  I'd be less worried (but still checking) about global variables and focus more on local variables.  Locals generally live on the stack.  This is where i would focus first.

  • Hi Dexter,

    I  debugged this scenario and found that , NVIC_FAULT_STAT_UNDEF bit is set. I attached the snap for your reference. What is the solution for this?  

    Thanks,

    Ashok r

  • Keep going through the app notes i sent.  The second one i know has information about how to use the stack trace information to figure out what code was executing just before the fault.  I cannot tell this from the image you sent.

    My strong suspicion based on experience is that you have run out of stack room and on return from some function you popped a PC off the stack that was invalid.

    The quick simple thing i would do next is double the stack size in project settings.  However, i also strongly encourage going through the learning experience of debugging your way back to figure out what code was executing and then understanding why a stack size change fixed it.

  • Hi Dexter,


    Still i followed that document only , but i did not have much experience on this could not figure out from the memory location. here i attached the latest view of memory. don't know what to do next>

    I also tried with doubling the stack size  , no luck.!

     2677.qs_iot_Fault ISR.zip

    also i attached my code here , please have a look!

  • You are still looking at the memory location for the Fault ISR.  What you need to do is use the stack pointer and stack itself to figure out where the PC was before entering the ISR.

    Before entering fault ISR a set of registers from the device are stored on the stack.  Among those registers is the PC where the machine would return to if it were to return from the ISR.

    This is all described in the document.  I will try to summarize here.

    In the debugger after the fault ISR.  Use the register window to find the address of the SP this is top of stack.  Use the memory browser to view the top of stack and about the next twelve 32 bit words under it.  These are the most recent contents of the stack.  Somewhere among those 12 words is the PC value you are looking for. Use the document to figure out where, i don't remember without looking myself.  Once you know the PC value from the contents of stack then put that PC value into your memory browser or disassembly window.  This window will now point you to the approximate area of code that generated the fault ISR.