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.

RTOS/CC3100: Running tcpEchoCC3X00 with TM4c1294

Part Number: CC3100
Other Parts Discussed in Thread: , , TM4C1294NCPDT

Tool/software: TI-RTOS

Hi,

I am experimenting with SimpleLink for the first time. I use CC3100BOOST board together with TM4c1294 MCU. In particular I am trying to run tcpEchoCC3X00 project from TI_RTOS/TIVA examples. My confusion came from the fact that I had to make the following links to CC3100-SDK:

Some of the links point to msp430 platform. I have resolved all errors and tcpEchoCC3X00 example worked. Is there a simpler way to correctly include all necessary files? Did I miss something?

Secondly, I would like to ask if it is necessary for this CC3100 board to run the ServicePack update (using dedicated emulation board) ?

Thanks.

  • Hello,

    I think the examples you're using are not native to CC3100 so naturally you will have to make some changes. Might be easier to download SW for the device you're using here (www.ti.com/.../tidcak5) - run the installer. It's just station and AP examples but you should be able to easily take code from the examples you want to use and move them into the native project.

    It is necessary to program service pack to device.

    Jesu
  • Hi Jesu,

    The ReadMe clearly states that examples are meant to be used with CC3100 devices and are located in directory with examples for tm4c1294 MCU:

    C:\ti\tirtos_tivac_2_16_01_14\tirtos_tivac_2_16_01_14_examples\TI\EK_TM4C1294XL

    After deeper investigation of tidrivers_tiva_<version> I figured out the following search path that is totally within tirtos_tivac.

    I looked at the ti-rtos spi driver files to understand how those link with simplelink related functions. Then I have realized that all necessary code is already included in ti-rtos at location:

    ${COM_TI_RTSC_TIRTOSTIVAC__TIDRIVERS_TIVAC}\packages\ti\mw\wifi\cc3x00\simplelink

    Modified search path, as shown above, looks better and makes more sense to me. Does the logic make sense?

    The AP and station examples ((www.ti.com/.../tidcak5) for Tiva thatyou have mentioned are my next step. Actually, I have posted a separate question on the forum regarding those.

    Thank you.

  • Hello,

    Thanks for pointing that out- I was not aware of other SDKs that had examples for our device.

    The SDK you're using seems to have some linking issues and the SimpleLink host driver it's using is outdated. The link I provided before has the same problem.

    For the latest and greatest on the CC3100 use CC3100SDK version 1.3.0. You can find tiva examples for your device in platform/tiva-c-connected-launchpad.

    Download link: www.ti.com/.../CC3100SDK

    Jesu
  • Hi Jesu,

    I was looking into this location but the only source file that I see is: tm4c1294ncpdt_startup_ccs.c. Nothing else.
  • Hello,

    I just built with no problem. Had to install CC3100SDK and Tivaware v2.1.4.178 here: .

    These are my project properties:

    Also make sure CCS recognizes your TivaC install in Windows->Preferences->Code Composer Studio->Products.

    Will show up as TI-RTOS for TivaC.

    Jesu

  • Hi Jesu,

    I have managed to run both examples from CC3100SDK_1.3.0\cc3100-sdk\platform\tiva-c-connected-launchpad (station and AP). These examples use other BoosterPack than examples provided in Tiva SDK but once I have figured it out and resolved include paths those work (thanks for your support).

    As an exercise and a way of understanding the whole CC3100 SDK environment I try to create similar application as given in TIDU992. I believe that access point example in TIDU992 is directly based on http_server code from examples in CC3100 SDK. I did the following:

    - getting_started_with_wlan_ap and getting_started_with_wlan_station examples are linked to the necessary files like user.h, spi.c/.h and other host MCU related files. I have used those projects to start

    -having those I used main.c source file from \examples\http_server. 

    - included led.c and led.h files to define led related functions. 

    Everything compiles without a single error or warning. When I run it:

    - configureSimpleLinkToDefaultState() routine returns and I get good communicate on serial port: CLI_Write(" Device is configured in default state \n\r");

    -In line 439 after configuring to default state there is a call of sl_Start()

    -Code gets stuck in line 87 of spi.c (original spi.c still linked as in getting_started_with_wlan_ap  ) SSIConfigSetExpClk. It never gets to line 90 SSIEnable().

    In configureSimpleLinkToDefaultState()  there is sl_Start() too and it runs perfectly fine. So it got stuck on a code that already run successfully. Does anything come to your mind?

    Thank you. 

    led.c
    /*
     * board.c - TM4C1294 launchpad configuration
     *
     * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
     *
     *
     *  Redistribution and use in source and binary forms, with or without
     *  modification, are permitted provided that the following conditions
     *  are met:
     *
     *    Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     *    Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the
     *    distribution.
     *
     *    Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     *
    */
    
    #include "simplelink.h"
    //#include "inc/tm4c1294ncpdt.h"
    #include "inc/hw_memmap.h"
    //#include "inc/hw_ssi.h"
    //#include "inc/hw_types.h"
    //#include "driverlib/ssi.h"
    //#include "driverlib/rom.h"
    #include "driverlib/gpio.h"
    #include "driverlib/sysctl.h"
    //#include "driverlib/fpu.h"
    //#include "driverlib/uart.h"
    //#include "board.h"
    
    #include "led.h"
    
    
    
    void initLEDs()
    {
          SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);
          GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_0|GPIO_PIN_1);
          GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_0, PIN_LOW);
          GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_1, PIN_LOW);
    }
    
    void turnLedOn(char ledNum)
    {
        switch(ledNum)
        {
          case LED1:
              GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_0, PIN_HIGH);
            break;
          case LED2:
              GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_1, PIN_HIGH);
            break;
        }
    }
    
    void turnLedOff(char ledNum)
    {
        switch(ledNum)
        {
          case LED1:
              GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_0, PIN_LOW);
            break;
          case LED2:
              GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_1, PIN_LOW);
            break;
        }
    }
    
    
    void toggleLed(char ledNum)
    {
        switch(ledNum)
        {
          case LED1:
              if(GPIOPinRead(GPIO_PORTN_BASE,GPIO_PIN_0))
              {
                  GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_0, PIN_LOW);
              }
              else
              {
                  GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_0, PIN_HIGH);
              }
            break;
          case LED2:
              if(GPIOPinRead(GPIO_PORTN_BASE,GPIO_PIN_1))
              {
                 GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_1, PIN_LOW);
              }
              else
              {
                 GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_0, PIN_HIGH);
              }
            break;
        }
    
    }
    
    unsigned char GetLEDStatus()
    {
      unsigned char status = 0;
    
      if(GPIOPinRead(GPIO_PORTN_BASE,GPIO_PIN_0))
        status |= (1 << 0);
      if(GPIOPinRead(GPIO_PORTN_BASE,GPIO_PIN_1))
        status |= (1 << 1);
    
      return status;
    }
    
    void initAntSelGPIO()
    {
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); //use PF1 and PF2
        GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2);
        GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_2, PIN_HIGH);
        GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1, PIN_LOW);
    }
    
    void SelAntenna(int antenna)
    {
        switch(antenna)
       {
            case ANT1:
            {
                GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_2, PIN_HIGH);
                GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1, PIN_LOW);
            }
                break;
            case ANT2:
            {
                GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_2, PIN_LOW);
                GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1, PIN_HIGH);
            }
                break;
       }
    }
    
    
    
    
    led.h 

  • HI,

    Looking more into this I have found the cause.  The main.c in http_server project in comparison with getting_started_with_wlan_ap project has these calls in the initializeAppVariables():

        pal_Memset(g_auth_name, 0, sizeof(g_auth_name));
        pal_Memset(g_auth_password, 0, sizeof(g_auth_name));
        pal_Memset(g_auth_realm, 0, sizeof(g_auth_name));
        pal_Memset(g_domain_name, 0, sizeof(g_auth_name));
        pal_Memset(g_device_urn, 0, sizeof(g_auth_name));

    After a while I have found out that commenting those solved my problem. I was able to get the authentication parameters via CLI and open the website with LED control. pal_Memset looks like a macro using standard memset() function. I am happy that I have finally managed to get this running but am not sure what was causing the problem. If you have any comments I will appreciate it.

    Thank you.

  • Hi Lucas,

    I don't see how initializing memory for arrays could influence the behavior of sl_Start or SPI drivers. You probably changed something else that fixed it.

    Jesu
  • Hi Jesu,

    I understand. I Tried today once again with clean project. The same behavior, it gets stuck in the same place as I have described. Once halted in debugging view it always points to this source file in a library: DriverLib/build/DriverLib.test/driverlib/ssi.c. I also don't see a clear and logical link but I verified (as much as I could on my own) that it wasn't coincidence or some silly change I have made.

    I have managed to add host MCU related code to examples from CC3100 SDK, I feel it is a good starting point for future. Thanks a lot for helping me doing that and clarifying CC3XXX resources in Tiva SDK.

    Thanks.