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.

CC3100MOD: Why sl_Start(0,0,0) return 1, the ROLE_UNKNOWN?

Part Number: CC3100MOD
Other Parts Discussed in Thread: CC3100

Hello Ti,

I start my code with sl_Start to enable CC3100MOD, but it return 1 ROLE_UNKNOWN.

Why sl_Start can return ROLE_UNKNOWN?

BRs.

Wang Jin

  • Hi user4924752,

    I only guessing. You call sl_Start() twice without sl_Stop(). At second sl_Start() returns ROLE_UNKNOWN.

    Before your 2nd call sl_Start() you need call sl_Stop().

    Jan
  • Hi Jan,
    It is my first call sl_Start().
    I am ready to set mode to ROLE_STA, so I call flow: sl_Start() -> sl_WlanSetMode(ROLE_STA) -> sl_Stop(0) -> sl_Start(0, 0, 0)
    The first sl_Start() and the 2nd sl_Start() are also return ROLE_UNKNOWN.
    BRs.
    Wang Jin
  • Hi,

    Hmm... are you sure that there in no sl_Start() inside some other initialisation code? Do you have latest ServicePack inside your device? Are you able check it with latest version of SDK? What host platform do you use? What code is returned from sl_WlanSetMode()?

    Jan

  • Hi Jan,

    I am sure that. The SDK is 1.2.0, 03-10-2016. My platform is STM32F429 with MDK. The os is FreeRTOS. I port the SDK to my os.
    And the SPI clk speed is 175KHZ. Then sl_Start() will return 1.

    But When I change the clk speed to 1.4MHZ, it is normal. sl_Start() will return 0 (ROLE_STA).

    So why it is not normal when the SPI clock speed is 175KHZ? Maybe I will use 1.4MHZ, But I guess somewhere has also some problem
    (Maybe in my porting code or my spi driver).

    BRs.
    Wang Jin
  • Hi,

    Hard to say what can cause your issue. Maybe you have right and it can be caused by code inside your low level SPI driver. Actually SPI clock speed 175kHz is very slow because CC3100 supports up to 20MHz SPI. But don't think that SPI low speed can cause issue with CC3100(MOD) itself.

    Maybe you can try add small delay (~1 ms) after asserting CS and before de-asserting CS.

    Jan
  • Hi Jan,

    Thank you very much.
    Your advice take effect.
    It is really related to SPI clock speed.
    I am using 11.4MHZ, and it works normal.

    By the way, I use ping tool to test network status, and ping show delay time is around 100ms.
    What method could reduce the delay time?

    BRs.
    Wang Jin
  • Hi,

    You are pinging IP inside your local network or outside LAN? Inside LAN is ping 100ms really high.

    Maybe you should try change power management policy to always on -  sl_WlanPolicySet(SL_POLICY_PM , SL_ALWAYS_ON_POLICY, NULL,0).

    Jan

  • Thank you very much.

    "power management policy to always on" has resolved my issue.
    Now ping inside LAN , the delay time is around 2ms.

    I'll verify your answer.

    BRs.
    Wang Jin