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.

TCP/IP socket example for TM4C1294 Connected LaunchPad

Other Parts Discussed in Thread: ENERGIA

Hey everyone,

I'm looking for a simple TCP/IP socket example for the new Tiva C connected LaunchPad kit (based on TM4C1294 microcontroller), most of the example found in the TivaWare package are based on lwIP or uIP are too complicated which invokes HTTP server calls and nothing about simple sockets like BSD-like socket calls/APIs, the ones provided in the package are good but suitable to experts in embedded networking and people with depp knowledge in embedded web-enabled applications not hardware engineers, is there any recommendations or extra example codes how to tackle this issue?

Thanks

--

K. El-Rayes

Research Engineer

  • Sorry - we don't include an example that makes use of a sockets-level API. lwIP provides this interface but it's only possible to use it if you are running an RTOS because it relies upon threads and semaphores. The low level, raw API for lwIP is more complicated to use but can be run successfully without the need for an OS.

  • Thanks Dave for the reply, well now its explained why, though I have used before a TCP/IP stack with a PIC32 microcontroller without an RTOS support (if you wanna have a look then check PIC32 Ethernet Starter Kit based on PIC32MX795L512 microcontroller), however thats off topic, so do you have recommendations/suggestions for an RTOS with TCP/IP stack support other than TI-RTOS cause its not working with me under CCS5.5 for some unknown reason (some files aren't created when I create new TI-RTOS project).

    Thanks,

    Karim

  • Actually, all the bits you need are already included in TivaWare 2.1. The only thing you won't find there is an example that uses the sockets-level API. Under the third_party directory, you'll find both FreeRTOS and the lwIP TCI/IP stack which contains an optional sockets layer. If you look in examples/boards/dk-tm4c129x you'll also find freertos_demo which uses FreeRTOS and lwIP together. This example does use the lwIP raw (low level) API but you should be able to modify it fairly easily to use the socket API instead.

  • Thanks Dave for the reply, there is no FreeRTOS demo the board (maybe isn't in the version I downloaded of TivaWare for some reason), but I figured out some work around using Energia IDE, though its not TCP/IP (UDP sockets) but their UDP sockets example is quite handy, maybe not very professional but at least covers the part I need temporarily till more RTOS ports with TCP/IP support are available.

    Thanks,

    Karim 

  • Hello Dave,

    I know its been awhile, but I figured out the solution for the issue of TCP sockets example for Tiva C connected Launchpad, in the latest release of TI-RTOS for Tiva C there is a an example that uses BSD-like sockets called "tcp  Echo", it works fine and very easy to understand.

    Thanks,

    Karim

  • Dear Dave,

    It means that it is pssible to make a code such as basic TCP/UDP server and client under no RTOS environment.

    Is it right?

    If so, can I get sample codes for TCP/UDP echo server and client based on low level API of lwIP?

    (I have DK-TM4C129X  kit.)

  • Hello Vinicius

    Thanks for pulling in the resource. The only thing that concerned me in the template was SysCtlMOSCConfigSet API call after configuring the clock. This must be done before the API call and the fact that the function is already a part of SysCtlClockFreqSet

    Regards
    Amit