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: sl_Start() doesn't work with SL_TINY turned on

Part Number: CC3120
Other Parts Discussed in Thread: CC3100

In order to make the host driver fit in our bootloader application, I had to turn on SL_TINY. Doing this caused sl_Start() to get stuck in the call to _SlDrvSyncObjWaitForever() on line 159 of device.c. The reason it gets stuck is because the variable GlobalLockObj isn't initialized. The reason for that can be found in the function _SlDrvDriverCBInit(), where the call to sl_LockObjCreate() only gets called if GlobalLockObj is NULL, which it clearly isn't. When I commented out the check for NULL on line 966 of driver.c, the call to sl_Start() completed successfully.

Has an implementation with SL_TINY been verified to be good? If not, is a future release of the host driver going to verify it?

  • Hi Ed,

    I just verified that sl_Start works successfully with SL_TINY (and SL_TINY_EXT)defined in user.h.

    What host are you using for your application? Are you using SPI or UART? Issues with sl_Start are often from the SPI driver. You may want to test putting a 100 ms delay in SPI enable and disable and see if that changes the behavior.

    Best regards,
    Sarah
  • Hi Sarah,

    I think the issue is happening because our host is running on a MSP430, and we're using the COFF output format in our builds. The variable GlobalLockObj is not initialized, and COFF format does not auto initialize uninitialized variables, so the value of it is whatever random data is at that memory location. In the CC3100 driver, the sl_LockObjCreate() function is unconditionally called from _SlDrvDriverCBInit(), so it didn't matter that GlobalLockObj wasn't initialized. However, the CC3120 driver only calls sl_LockObjCreate() if GlobalLockObj is NULL. That is why my code started working when I commented out the check for NULL.

    I'm thinking that the check for GlobalLockObj being NULL should be removed, since the purpose of _SlDrvDriverCBInit() seems to be to initialize all of the objects to a known state. What do you think?

    Thanks,
    -Ed
  • Hi Ed,

    Thanks for the details. I'll submit this as a bug review for certain MCUs on our side and let you know if there is any feedback.

    Best regards,
    Sarah
  • Hi Ed,

    I apologize for missing this earlier, but this issue with the SL_TINY library is a known issue and documented in the host driver release notes ( linked to in the main release notes or found in the docs/wifi_host_driver_api folder). This will be addressed in a future release.

    Best regards,
    Sarah