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.

【CC3200 评测】CC3200-LAUNCHXL开发板使用心得分享+使用simplelink的库遇到问题

Other Parts Discussed in Thread: UNIFLASH, CC3200

1.用gcc编译simplelink下面的源码,生成libsimplelink.a的库,然后再编译example下面的getting_started_with_wlan_ap,生成wlan_ap.bin,用uniflash烧写到SPI FLASH运行,总是出现如下错误,然后就结束了。

*************************************************
CC3200 WLAN AP Application
*************************************************

[GENERAL EVENT] - ID=[0] Sender=[0]

Error [-100] at line [527] in function [ConfigureSimpleLinkToDefaultState]

查了一下源码:

是在ConfigureSimpleLinkToDefaultState()这个函数里面的lMode = sl_Start(0, 0, 0);返回错误,一直跟下去,发现是在

_SlReturnVal_t _SlDrvSyncObjWaitTimeout(_SlSyncObj_t *pSyncObj, _u32 timeoutVal, SlDriverAPIWithTimeout_e apiIdx)
{
_SlReturnVal_t ret = sl_SyncObjWait(pSyncObj, timeoutVal);

/* if timeout occured...*/
if (ret)
{
_SlDriverHandleError(SL_DEVICE_DRIVER_TIMEOUT_ASYNC_EVENT, apiIdx, timeoutVal);
}
else if (g_bDeviceRestartIsRequired == TRUE)
{
return SL_API_ABORTED;
}

return SL_RET_CODE_OK;
}

这个函数的sl_SyncObjWait接口出错了,走到了这个分支return SL_API_ABORTED;

#define SL_API_ABORTED      (-100)

simplelink用的是OS的版本。

后来,看了simiplelink的user guide,

The available sets are:

  1. SL_TINY - Compatible to be used on platforms with very limited resources. Provides the best in class foot print in terms of Code and Data consumption.
  2. SL_SMALL - Compatible to most common networking applications. Provide the most common APIs with decent balance between code size, data size, functionality and performances
  3. SL_FULL - Provide access to all SimpleLink functionalities

自己定义了这个宏:

#define SL_SMALL

但是还是不行,出现同样的错误,请TI的工程师帮忙分析解决一下,谢谢。

  • 添加打印信息,输出log,继续调试。
    这是添加的打印:
    static long ConfigureSimpleLinkToDefaultState()
    {
    SlVersionFull ver = {0};
    _WlanRxFilterOperationCommandBuff_t RxFilterIdMask = {0};

    unsigned char ucVal = 1;
    unsigned char ucConfigOpt = 0;
    unsigned char ucConfigLen = 0;
    unsigned char ucPower = 0;

    long lRetVal = -1;
    long lMode = -1;

    lMode = sl_Start(0, 0, 0);
    Report("[%s,%d]->sl_Start_lMode=%d\n\r",__func__,__LINE__,lMode);
    ASSERT_ON_ERROR(lMode);

    // If the device is not in station-mode, try configuring it in station-mode
    if (ROLE_STA != lMode)
    {
    if (ROLE_AP == lMode)
    {
    // If the device is in AP mode, we need to wait for this event
    // before doing anything
    while(!IS_IP_ACQUIRED(g_ulStatus))
    {
    #ifndef SL_PLATFORM_MULTI_THREADED
    _SlNonOsMainLoopTask();
    #endif
    }
    }

    // Switch to STA role and restart
    lRetVal = sl_WlanSetMode(ROLE_STA);
    Report("[%s,%d]->sl_WlanSetMode_lRetVal=%d\n\r",__func__,__LINE__,lRetVal);
    ASSERT_ON_ERROR(lRetVal);

    lRetVal = sl_Stop(0xFF);
    Report("[%s,%d]->sl_Stop_lRetVal=%d\n\r",__func__,__LINE__,lRetVal);
    ASSERT_ON_ERROR(lRetVal);

    lRetVal = sl_Start(0, 0, 0);
    Report("[%s,%d]->sl_Start_lRetVal=%d\n\r",__func__,__LINE__,lRetVal);
    ASSERT_ON_ERROR(lRetVal);

    // Check if the device is in station again
    if (ROLE_STA != lRetVal)
    {
    // We don't want to proceed if the device is not coming up in STA-mode
    return DEVICE_NOT_IN_STATION_MODE;
    }
    }

    这个是调试输出:

    *************************************************
    CC3200 WLAN AP Application
    *************************************************



    [GENERAL EVENT] - ID=[0] Sender=[0]

    [ConfigureSimpleLinkToDefaultState,508]->sl_Start_lMode=3
    [ConfigureSimpleLinkToDefaultState,528]->sl_WlanSetMode_lRetVal=-100
    Error [-100] at line [529] in function [ConfigureSimpleLinkToDefaultState]

    可以看到,sl_Start这个函数返回了3,
    ROLE_STA = 0,
    ROLE_UNKNOWN = 1,
    ROLE_AP = 2,
    ROLE_P2P = 3,
    也就是ROLE_P2P, 不知道为什么返回这个值,希望懂的人解答。
    继续往下看,sl_WlanSetMode这个函数返回了-100,出错了退出了。
    也就是说
    // Switch to STA role and restart
    lRetVal = sl_WlanSetMode(ROLE_STA);

    设置到 STA role的时候出错了,请懂的人帮忙解答,谢谢!
  • 我的问题解决了,打印输出如下:
    *************************************************
    CC3200 WLAN AP Application
    *************************************************



    [ConfigureSimpleLinkToDefaultState,508]->sl_Start_lMode=0
    Host Driver Version: 1.0.1.13
    Build Version 0.0.0.0.31.0.0.0.0.0.0.0.0
    Device is configured in default state
    Device started as STATION
    Enter the AP SSID name: easylink
    Device is configured in AP mode
    [GENERAL EVENT] - ID=[51] Sender=[132]

    Failed to get network configuration

    解决办法:
    用uniflash先format SPI FLASH,然后重新烧写/sys/mcuimg.bin即可。
    好了,现在可以好好玩一玩TI的simplelink了。
  • 厉害,解决问题能力强
  • 厉害,不知道最后是按什么思路去解决这个问题的。
  • 谢谢分享,就是不知道最后楼主是按什么思路去解决这个问题的
  • 没思路,不会了就逛论坛,逛多了就有想法了。
  • 楼主解决问题能力非常强,学习了
  • 学习了,希望之后也有机会试试CC3200,期待更多的评测。
  • 还是祝贺一下作者最后解决了问题,但是不值得提倡这种设计方式。任何程序设计之前都因该把硬件的板载设计搞清楚,CC3200 users guid里面写得很清楚对于片载外部flash情况的,第一次使用都应该对flash初始处理,但是知识点值得学习
  • 用uniflash先format SPI FLASH,然后重新烧写/sys/mcuimg.bin即可。这个知识点记下来!
  • 麻烦老哥评论的时候先把帖子看完?你FTDI都连不上你告诉我怎么去format?凭想象么?

  • 把解决STA role设置问题解决了,期待更多测评!
  • 片载外部flash初始化处理的问题