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.

SmartConfig Not Completing

Configuration:

  • Stellaris (LM4F120XL) Launchpad
  • BoosterPackEM adapter (modified to connect GPIOA - GPIO2)
  • CCS v5 updated to 5.0.6, required increasing the stack size to even get the example code to work - that cost me a GOB of time to figure that one out.
  • CC3000 SDK, updated with the last week.
  • CC3000EM - stock jumper settings
  • System Patched with 1.19
  • Basic WiFi Application, modified to include dumping patch level and scanning for APs
  • Stock, Non-Rooted Google Nexus 7 Tablet
  • Stock (Precompiled) Android App

Test / Results

  • Start Firmware
  • Scan for access points, see the access points I expect, stop scan
  • Dump patch level, verifying 1.19
  • On Android Tablet, start CC3x Config Tool
  • Wait for access points to display
  • Pick the desired access point, Enter WPA2 Key, click "Configure CC3x for {SSID}
  • On terminal window to Launchpad, start SimpleConfig
  • Wait.  Wait..  Wait...
  • Finally break application, find it in the loop waiting for SimpleConfig to complete.
  • AFAIK, no callbacks have occurred outside of the keep alive.  I know that's happening, but the one that ends SimpleConfig does not fire.
  • After SimpleConfig, nothing works - API to retrieve patch level fails, scanning for APs returns nothing.
  • Problem persists after a POR.
  • Repatching restores operation of patch level and scan APIs.

Troubleshooting:

  • Tried switching order of starting simpleconfig on Android and Launchpad
  • Tried invoking simpleconfig many times on Android while Launchpad stuck waiting.
  • Tried skipping scan/patch apis before starting SimpleConfig

I have Saleae logic analyzer traces of both SImpleConfig and recovery by Re-Patching, but don't have a good way to interpret them.

TI, any ideas?  I'm trying to sick as close to the supplied example before venturing off on my own, but I can't even get the stock stuff from TI to work properly - and there's no feedback as to why things are failing.  This doesn't give me warm fuzzies about what my customers would experience if I can't get the demo to work out of the box, using all TI stuff.

Also on the CC3x Android App, a scrolling log of what it's doing (with timestamps) would be MUCH better.

  • Try adding this to  SmartConfig function of ur code...

    wlan_stop();
    SysCtlDelay(1000000);
    wlan_start(0);

    just before

     wlan_smart_config_set_prefix((char*)aucCC3000_prefix);

    It works fine for me then...  best wishes..

     

  • Thanks sooraj!

    Unfortunately, it didn't help me much.

    I did find that at least I could get the patch level after I cancelled, which I couldn't do before.  But then I tried a scan again, that failed, and after that, no patch version either.

    Touchy little booger, isn't it.  I wish there was a way to query status so that I could tell what was going on under the CC3000's pointy little hat.

  • Hi Greg,

    You should be using the Smartconfig Android app.

    http://processors.wiki.ti.com/index.php/CC3000_Smart_Config

    You are using an old one.

     

    Regards,

    Aaron

  • AFAIK, I'm running the version you suggest.


    C:\ti>dir *.apk /s
    Volume in drive C has no label.
    Volume Serial Number is 3A48-9D79

    Directory of C:\ti\CC3000AndroidApp\SmartConfigCC3X\bin

    09/03/2013 12:33 AM 769,720 SmartConfigCC3X.apk
    1 File(s) 769,720 bytes

    Directory of C:\ti\CC3000AndroidApp(1)\SmartConfigCC3X\bin

    09/17/2013 12:31 AM 769,720 SmartConfigCC3X.apk
    1 File(s) 769,720 bytes

    Total Files Listed:
    2 File(s) 1,539,440 bytes
    0 Dir(s) 223,289,581,568 bytes free

    The (1) version is the one I just downloaded from your link.  Is there something else I should have installed instead?



  • Interesting, I installed the aforementioned APK to my HTC One and it looks vastly different than the one that I have on my tablet - and since I have no other APK, I'm wondering how this could be.

    However, using the "other" android app, It still doesn't work.

    One of the things I'm doing in my firmware is to keep track of all the events that occur in CC3000_UsynchCallback routine.  In the main loop, if any have occurred, I send a message to the terminal.  The only one I ever see is the KeepAlive.  I'm using a ring buffer to keep track of the events, so even if events were stacked up on top of each other, I'd still see it.  What should I see?

    How can I diagnose what's (not) going on?  I have an Android app, I have some library code.  I have a SPI protocol that is not clearly defined.  It would help if TI could publish some "this is what you should see on the SPI bus", these are the events you should see in the code...

    The diagrams on this page...

    http://processors.wiki.ti.com/index.php/CC3000_Smart_Config#Examples_using_IOS.5CAndroid.5CPC_devices

    ...don't even match the code in the Basic Wifi Application in the SDK (see below).  Should I change the code, or is the code right and the diagram wrong?

    void StartSmartConfig(void)
    {
    ulSmartConfigFinished = 0;
    ulCC3000Connected = 0;
    ulCC3000DHCP = 0;
    OkToDoShutDown=0;

    // Reset all the previous configuration
    wlan_ioctl_set_connection_policy(DISABLE, DISABLE, DISABLE);
    wlan_ioctl_del_profile(255);

    //Wait until CC3000 is disconnected
    while (ulCC3000Connected == 1)
    {
    SysCtlDelay(100);
    hci_unsolicited_event_handler();
    }

    // Start blinking LED1 during Smart Configuration process
    turnLedOn(1);

    wlan_smart_config_set_prefix((char*)aucCC3000_prefix);
    turnLedOff(1);

    // Start the SmartConfig start process
    wlan_smart_config_start(1);
    turnLedOn(1);

    // Wait for Smart config to finish
    while (ulSmartConfigFinished == 0)
    {
    turnLedOff(1);
    SysCtlDelay(16500000);
    turnLedOn(1);
    SysCtlDelay(16500000);
    }
    turnLedOn(1);
    // create new entry for AES encryption key
    nvmem_create_entry(NVMEM_AES128_KEY_FILEID,16);

    // write AES key to NVMEM
    aes_write_key((unsigned char *)(&smartconfigkey[0]));

    // Decrypt configuration information and add profile
    wlan_smart_config_process();

    // Configure to connect automatically to the AP retrieved in the
    // Smart config process
    wlan_ioctl_set_connection_policy(DISABLE, DISABLE, ENABLE);


    // reset the CC3000
    wlan_stop();

    DispatcherUartSendPacket((unsigned char*)pucUARTCommandSmartConfigDoneString,
    sizeof(pucUARTCommandSmartConfigDoneString));

    SysCtlDelay(100000);
    wlan_start(0);

    // Mask out all non-required events
    wlan_set_event_mask(HCI_EVNT_WLAN_KEEPALIVE|HCI_EVNT_WLAN_UNSOL_INIT|
    HCI_EVNT_WLAN_ASYNC_PING_REPORT);
    }

  • The code gets stuck here...

    // Wait for Smart config to finish
    while (ulSmartConfigFinished == 0)
    {
    turnLedOff(1);
    SysCtlDelay(16500000);
    turnLedOn(1); 
    SysCtlDelay(16500000);
    }

    Is there any way to peer into the innards of the CC3000 to find out why it never responds with the SmartConfigFinished event ?...



  • Hi Greg,

    Just to get a feel how well the driver is working, are you able to connect to a secured AP? Send any data through sockets?

    Thanks,

    Aaron

  • Try to set your compiler options to:

    default char type is unsigned (-funsigned-char)

    Works for me fine... this "great" portable lib from TI use datatypes there aren't equal on all systems. Not like uint8_t and so on :-/

    -Basti

  • Funny, I didn't have that compiler option.  I tried this one --plain_char=unsigned, which IS supported and it doesn't seem to make any difference.

    Curiously, now that i'm connecting (I still can't seem to be able to send/recv data), the mac address looks funny - it's certainly not the same as on the sticker...