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.

CC3100 Configuration process - sl_Start()

Other Parts Discussed in Thread: CC3100

Hi,

I'm trying to configure the CC3100.
I tried calling sl_WlanPolicySet(...) before calling sl_Start(), but the process gets stuck within the simplelink code.
I understand that nothing can be done before calling sl_Start(). Even sl_Stop() gets stuck - is this assumption correct?

Looking at the TI examples (getting_started_with_wlan_ap), I can be calling sl_Start() 3 times till the CC3100 is configured as needed:
1 - Establish connection.
2 - Change to AP (if in STA)
3 - restart the CC3100 after configuration
Is there a way to quicken things? Can I make AP configuration changes even if the CC3100 is in STA, thus merging 2 and 3?

  • Hi Everyone,

    I have the same question with same example: getting_started_with_wlan_ap.

    I added a log message " Entering sl_Start" and saw the configuration procedure called sl_start 4 times. Following is my log messages:

    Getting started with WLAN access-point application - Version 1.1.0
    *******************************************************************************
    Entering sl_Start
    Device is configured in default state
    Entering sl_Start
    Entering sl_Start
    Entering sl_Start
    Device started as Access Point
    Waiting for clients to connect...!
    Client connected to the device
    Pinging...!
    Device and the station are successfully connected

    Why does host application have to call sl_Start() function 4 times to config the CC3100 to AP mode? I think the host application should call st_Start() function 1 time.

    I tested few more times and these times, host application called sl_start() function 5 times:

    Getting started with WLAN access-point application - Version 1.1.0
    *******************************************************************************
    Entering sl_Start
    Entering sl_Start
    Device is configured in default state
    Entering sl_Start
    Entering sl_Start
    Entering sl_Start
    Device started as Access Point
    Waiting for clients to connect...!
    Client connected to the device
    Pinging...!
    Device and the station are successfully connected

    Thanks!

  • Hi Rami,

    Rami

    I tried calling sl_WlanPolicySet(...) before calling sl_Start(), but the process gets stuck within the simplelink code.
    I understand that nothing can be done before calling sl_Start(). Even sl_Stop() gets stuck - is this assumption correct?

    Yes, your assumption is correct. No simplelink API can be called before before calling sl_Start().

    ------------------------------------------------------

    Not all configuration of step 3 can be merged with step 2 but you can safely merge following with step 2.

    • Configuring SSID
    • Configuring Security type
    • Configuring Password

    Hi Dennis,

    configureSimpleLinkToDefaultState() function will call sl_Start() once (if device in station mode) and twice (if device is not in station mode)

    Regards,

    Ankur

  • Ankur,

    Thanks for the information.

    It could be simple if I can send only one command "Set AP mode" to CC3100.  If CC3100 already in AP mode, return to the host said in AP mode. If it was not in AP mode, set the CC3100 and return AP mode to host.

    As current CC3100 implementation. If it is not in AP mode, host MCU set it to default - calling sl_Start() 2 times. then host MCU call sl_Start() 3 more times to set the AP mode with the total of calling sl_Start() 5 times.

    Dennis

  • Dennis,

    sl_Start() API call returns the mode in which device is configured. User can check this value and and configures the device in AP mode its not in AP mode. Please check the example in SDK.

    Please note the sample example provided in SDK are to showcase how to configure/use the features available. ConfigureSimpleLinkToDefaultState() configures the device in default state and may not be needed in final application (again sdk application are sample applications).

    I hope this clarify your concerns.

    Regards,

    Ankur

  • I'm afraid that my system will get stuck in sl_Stop(), an an endless loop.
    Can I test the simplelink for its status, if it's connected, so my call to sl_Stop() will not get stuck?
    Sort of:
      if (sl_Status() == SL_CONNECTED) {
          sl_Stop();
      }
    same as checking a pointer if it's not NULL...

  • Ankur,

    Thanks for the information.

    Could you point me to a"final application" example?

    Thanks,

    Dennis

  • Hi Rami,

    We don't have any API to check for the sl_Start() was called.

    You can use the 'sl_Start()' with callback and set some variable in callback or use state machine to check if the driver is initialized.  Please refer to chapter 3 of the NWP programmers guide. http://www.ti.com/lit/ug/swru368/swru368.pdf

    Regards,

    Ankur

  • Hi Dennis,

    As mentioned earlier we only provide sample applications in SDK as a reference for users to build their solution.

    We have added a clear comments for use of function 'ConfigureSimpleLinkToDefaultState()' in examples.

        /*
         * Following function configures the device to default state by cleaning
         * the persistent settings stored in NVMEM (viz. connection profiles &
         * policies, power policy etc)
         *
         * Applications may choose to skip this step if the developer is sure
         * that the device is in its default state at start of application
         *
         * Note that all profiles and persistent settings that were done on the
         * device will be lost
         */

    If you looking for anything specific please let us know.

    Regards,

    Ankur

  • Hi Ankur,

    Thanks for the information.

    How can we sure that the device is in default state?

    I am looking a way to set the CC3100 in AP mode as short/simple as possible. If I skip calling the ConfigureSimpleLinkToDefaultState() function, the example code still calls sl_Start() function 3 times.

    I was looking the boot up/handshake protocol between host and CC3100 document but could not find the document.

    Regards,

    Dennis

  • Hi Dennis,

    You can use the following code sequence to configure the device in AP mode. It will require only one (if device is in AP mode) or two (if device is not in AP mode) sl_Start().

    mode = sl_Start(0, 0, 0);
    if (ROLE_AP == mode)
    {
    	/* Wait for device to acquire IP */
    }
    else
    {
    	/* Configure CC3100 to start in AP mode */
    	retVal = sl_WlanSetMode(ROLE_AP);
    	if(retVal < 0)
    		LOOP_FOREVER();
    		
    	/* configure the SSID, Password and security type if needed */
    	
    	sl_Stop(SL_STOP_TIMEOUT);
    	
    	mode = sl_Start(0, 0, 0);
    	if (ROLE_AP == mode)
    	{
    		/* Wait for device to acquire IP */
    	}
    	else
    	{
    		/* Error */
    	}
    }

    There is no API to check or configure the device in default state. To configure the device in default state application needs to revert all the changed configuration.

    You can check the host interface document for boot up/handshake protocol. http://processors.wiki.ti.com/index.php/CC31xx_Host_Interface

    Regards,

    Ankur

  • Hi,

    I am closing this thread, If you have follow up question please open a new thread with link to this one for reference.

    Regards,

    Ankur

  • Hi,

    have you found out a quicker way to start in AP mode from the beginning?

    There is a FORCEAP pin on the module which seems to be a good candidate but I have not tried this option yet.

    I'm also irritated by AP-init order which takes a long time to complete.

    Regards,

    Filip