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.

CC3120: Porting an existing CC3100 host application that uses NON_OS implementation to CC3120

Part Number: CC3120
Other Parts Discussed in Thread: CC3100

Hi,

I've started looking into porting our application from using a CC3100 to a CC3120. As stated in the thread title, we are currently using the CC3100 driver with the NON_OS option. I've installed the simplelink_msp432_sdk_wifi_plugin_1_00_00_04 (which I think is where we're supposed to get the CC3120 host driver and patch from), and am looking at the SinpleLink Gen1 to Gen2 Migration Guide, but it's not at all clear to me how to use the new SDK in a NON_OS implementation. I'm hoping someone can point me to something obvious that I am missing.

  • Hi Ed,

    The CC3120 software kit is essentially a plug-in for the MSP432 SDK. The drivers for the CC3120 (source/ti/drivers/net/wifi) are not specific to any RTOS or non-RTOS.

    The user.h has changed slightly from Gen 1 to Gen 2 and will need to be updated. Unfortunately, we do not yet have non-RTOS examples in this release.

    Best regards,
    Sarah
  • Hi Sarah,

    Thanks for the reply. Any idea when non-RTOS examples will be available?

    Thanks,
    -Ed
  • Hi Ed,

    We hope to have these in an upcoming release, but I do not currently have a date.

    Best regards,
    Sarah
  • OK, thanks Sarah. In the meantime, I guess I'll attempt to copy the nonos code from the CC3100 host driver and see if I can get that to work.
  • Hi Sarah,

    Is there any update on this?

    Regards,

    Lucas

  • Hi Lucas,

    FWIW, I took the nonos implementation from the CC3100 SDK and modified it slightly to use with the CC3120 and it seems to be working well. Some of the variable and function names are different between the CC3100 and CC3120 SDK, and you have to implement the host timestamp service or the drivers will time out a lot.

    -Ed

  • Hi Ed,

    Thanks for the help, I implemented slcb_GetTimestamp but the host driver keeps aborting in _SlDrvMsgReadCmdCtx() due to
    sl_SyncObjWait(&g_pCB->CmdSyncObj, CmdCmpltTimeout); line 1964 of "driver.c"
    If i add a break-point at this line i can step over the code with no issue but trying to run it will always fail.
    Did you experience anything like this?
    Any more help you could provide would be greatly appreciated.

    Regards,
    Lucas
  • Hi Lucas,

    We ended up abandoning the host timestamp service because our host uses an OS tick of 500ms, which led to some false timeouts due to its large granularity.

    After we did that, we had to make 1 modification to _SlNonOsSemGet() to make it work. Instead of going through the driver and making sure all timeout values were NONOS_WAIT_FOREVER if slcb_GetTimestamp is not defined, we decided to just comment out the following lines in _SlNonOsSemGet():


    #if (!defined (slcb_GetTimestamp)) || (defined (SL_TINY_EXT)) // if (Timeout != NONOS_WAIT_FOREVER) // { // Timeout--; // }

    Let me know if that works for you.

    -Ed

  • Hey Ed,

    Thanks heaps, It seems to be working a treat and have not had any issues (:

    -Lucas
  • Hi Ed

    Over six months on from your original post, there still don't exist any Non-OS examples for the CC3120. I was hoping you could help me. I am trying to get a non-OS port up and running for the CC3120. I used your post as a starting point and replaced the nonos.c and nonos.h in the CC3120 SDK with the ones from the CC3100 SDK. This is compiling fine but when I call sl_Start I find that it hangs at (line163 device.c)

    SL_DRV_SYNC_OBJ_WAIT_TIMEOUT(&g_pCB->ObjPool[ObjIdx].SyncObj, INIT_COMPLETE_TIMEOUT, SL_OPCODE_DEVICE_INITCOMPLETE); 

    and, digging deeper, in _SlNonOsSemGet() never receives "WaitforCmdResp" 

    if (FALSE == g_pCB->WaitForCmdResp)
    {
    (void)_SlNonOsMainLoopTask();
    }

    I realise my approach is the opposite to what you did, in that my starting point is the CC3120 SDK rather than the CC3100 SDK, but any help is appreciated! 

    Thanks,

    Meenal

  • Hi Meenal,

    Non-OS examples were added in SDK Plugin version 1.40. You can download the latest here: http://www.ti.com/tool/simplelink-wifi-cc3120-sdk-plugin

    For additional questions on implementation, please start a new thread.

    Best regards,

    Sarah

  • Hi Meenal,

    It's been while since I looked at this, but your problem sounds like something we ran into. I believe the way we fixed it was to comment out line 966 of _SlDrvDriverCBInit() in driver.c (see e2e.ti.com/.../581209 for a description of what we ran into).

    So instead of this:
    if (GlobalLockObj == NULL)
    {
    OSI_RET_OK_CHECK( sl_LockObjCreate(&GlobalLockObj, "GlobalLockObj") );
    }

    do this:
    // if (GlobalLockObj == NULL)
    {
    OSI_RET_OK_CHECK( sl_LockObjCreate(&GlobalLockObj, "GlobalLockObj") );
    }

    Let me know if that fixes your issue.

    Thanks,
    -Ed
  • Hi Sarah

    I have the latest version of the SDK plugin (1_40_00_02) installed and the non-OS examples require the use of SemaphoreP.h and MutexP.h etc, like this poster has experienced  -- https://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/t/620115. Hence I've turned to the CC3100 SDK.

  • Hi Ed,

    Thanks for your reply. Unfortunately this was not the cause of my problem. I think the issue is somewhere in the SPI comms. I can see the IRQ being detected but am stuck waiting for "init complete" back from the CC3120 device.

    Meenal