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.

Porting CC3100 1.0.0 to PIC24EP512 - boot up protocol

Other Parts Discussed in Thread: CC3100, UNIFLASH, CC31XXEMUBOOST, CC3200

Dear Everyone,

Could you point me to cc3100 boot up sequence document?
I'm using example code from getting_started_with_wlan_ap folder.
I step through the code up to calling configureSimpleLinkToDefaultState() function, Line #358 of main.c file.
configureSimpleLinkToDefaultState() function calls sl_Start(0, 0, 0); at line #526 of main.c file.

sl_start() function is in device.c file, at line #95.
I continue step to line #139, which it calls OSI_RET_OK_CHECK(sl_SyncObjWait(&g_pCB->ObjPool[ObjIdx].SyncObj, SL_OS_WAIT_FOREVER)); function.

sl_SyncObjWait function is defined as #define sl_SyncObjWait(pSyncObj,Timeout) _SlNonOsSemGet(pSyncObj,__NON_OS_SYNC_OBJ_SIGNAL_VALUE,__NON_OS_SYNC_OBJ_CLEAR_VALUE,Timeout)

My test loops (wait forever) in this _SlNonOsSemGet() function which locate at line #72 of nonos.c file.

I need to know what the code is waiting for. How to get out of this loop. What else should I set before going into this loop?

I'm using SPI interface but don't use OS.

Thanks in advance

  • (continue from previous post)

    I set SPI mode 0, Polarity = 0, Phase = 0.

    HIB = high (1)

    RST = high (1) non active

    When the host PIC24EP512 MCU sees the first interrupt (signal high = 1), it tries to read until the INT inactive (signal low = 0). In my case the INT never goes low. the data is all zeros.

    Do I miss any signal or setup?

    - Testing with spi_debug_tool

    I used spi_debug_tool example code and it passed, I got:

    Spi Write Passed
    Spi Read Passed
    Spi Init read complete Passed
    Spi Test Completed

    When PIC24EP512 host MCU received first inerrrupt while boot up, the host MCU sent 4 bytes: 0x65, 0x87, 0x78, 0x56. Then the host received: 0xBC, 0xDC, 0xCD, 0xAB, and next 4 bytes 0x08, 0x00, 0x08, 0x00, and last 4 bytes: 0x00, 0x00, 0x00, 0x00.

     I think my SPI interface and the driver are working.

    But I still can't get out _SlNonOsSemGet() from getting_started_with_wlan_ap example.

    Thanks in advance!

  • Hi Dieutan,

    Apologies for the delayed response on this thread.

    The host driver wait at below code for the interrupt from the CC3100.

    OSI_RET_OK_CHECK(sl_SyncObjWait(&g_pCB->ObjPool[ObjIdx].SyncObj, SL_OS_WAIT_FOREVER));

    You can refer to following documents for initialization sequence and SPI interface guide.

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

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

    It looks like you interface configuration is fine. Interrupt line should be cleared by cc3100 at the end of spi_debug_tool examples. Can you please check and confirm?

    Are you configuring the interrupt pin as edge triggered or level triggered?

    Regards,

    Ankur

  • Hi Ankur,

    Thanks for the information. I am looking for AP mode boot up protocol.

    Yes, Interrupt line should be cleared by cc3100 at the end of spi_debug_tool example. I'm using SPI edge triggered interrupt.

    I ran provisioning_ap test and had it returned from configureSimpleLinkToDefaultState() called function. This function called sl_Start(), OSI_RET_OK_CHECK(sl_SyncObjWait(&g_pCB->ObjPool[ObjIdx].SyncObj, SL_OS_WAIT_FOREVER));  functions. However, The test stopped at line #473 LOOP_FORVER() of main.c file - provisioning_ap folder.

    I captured the SPI data and noticed following activities: After the MCU received interrupt, it sent 0x65, 0x87, 0x78, 0x56 and 4 bytes of 0x00s. The CC3100 responded 0xBC, 0xDC, 0xCD, 0xAB. then, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,  0x11, 0x11, 0x11, 0x11.

    MCU sent 0x21, 0x43, 0x34, 0x12, 0x66, 0x84, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0C, 0x00, 0x11, 0x11.

    MCU sent: 0x65, 0x87, 0x78, 0x56, 8 bytes of 0x00s

    CC3100 responded: 0x66, 0x04, 0x0C, 0x00, 0x37, 0x00, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xFF, 0xFF, 0xFF, 0xFF, etc...

    I attached the cc3100_prov_ap_loop_foever.logicdata captured file using Saleae Logic.

    Why provisioning_ap example returned form configureSimpleLinkToDefaultState() function but getting_started_with_wlan_ap did not returned and stayed in 

    OSI_RET_OK_CHECK(sl_SyncObjWait(&g_pCB->ObjPool[ObjIdx].SyncObj, SL_OS_WAIT_FOREVER)); function?

    Thanks,

    Dennnis

    cc3100_prov_ap_loop_forever.zip
  • Hi Ankur,

    I got a little further with getting_started_with_wlan_ap example. I got some data exchanged between Host MCU and CC3100boosterpack. The example stopped at LOOP_FOREVER(), line #364 main.c file, getting_start_wlan_ap folder.

    I attached cc3100_wlan_ap_2014_11_11.zip SPI captured file. I used Saleae Logic to capture the file.

    Could you look at the data to see why the error occurred?

    Thanks,

    cc3100_wlan_ap_2014_11_11.zip
  • Hi Ankur,

    I step through the driver and got the return value 0xfffffffa = -7,  at line #563 of main.c, getting_start_wlan_ap folder

    retVal = sl_WlanPolicySet(SL_POLICY_CONNECTION, SL_CONNECTION_POLICY(1, 0, 0, 0, 1), NULL, 0);

    I searched the ti e2e forum and found related post: http://e2e.ti.com/support/wireless_connectivity/f/968/t/357349.aspx.

    Kaushal suggested to erase SFLASH.

    How can I send erase SFLASH command via SPI from this driver?

    Thanks,

    Dennis

  • Hi Dennis,

    -7 error code corresponds to access of the file system by network process.

    You can't send the format command over SPI to format the CC3100. You will need the CC31xx EMUBOOST board.

    Please refer to the Uniflash user guide for detailed instructions on formatting and updating the service pack.

    http://processors.wiki.ti.com/index.php/CC31xx_%26_CC32xx_UniFlash_Quick_Start_Guide

    http://processors.wiki.ti.com/index.php/CC31xx_%26_CC32xx_UniFlash

    Regards,

    Ankur

  • Hi Ankur,

    It turned out the hardware was bad.  The hardware passed some SPI tests but did not pass the wlan_ap test. It seems accept some commands but not the others. It could be the Serial Flash bad.

    About error (-7), I found a define 

    #define SL_FS_ERR_FS_ALREADY_LOADED (-7)

    I cannot have the EMU connect to my product. I need the erase command sent to CC3100 from PIC24EP512 host CPU via SPI or at the minimum through UART.

    Thanks,

    Dennis

  • Dennis,

    The formatting of serial flash by MCU is not supported. You need to use the CC31xxEMUBOSST board with Uniflash (GUI/command line) utility. You can have test points for UART1 RX/TX.

    Regards,

    Ankur

  • Ankur,

    Thanks for the info. Do you know if TI plan to support this feature as well as upgrade firmware via SPI without using the CC31xxEMUBOOST? Host MCU will directly send commands to CC3100 via SPI or UART interface.

    Denis

  • Hi Dennis,

    Firmware update over the SPI is supported however you can't format the serial flash using MCU.

    Please note formatting the serial flash is one time process.

    You can check the OTA example available at http://www.ti.com/tool/cc3100sdk.

    Regards,

    Ankur

  • Hi AnKur,

    As you wrote"Firmware update over the SPI is supported"

    Could you point me to where (document, example, driver)  I should look into to start implementing the Firmware update over the SPI function?

    Thanks,

    Dennis

  • Hi Dennis,

    You can refer to the the OTA example (link shared in previous post).

    This example downloads the servicepack files (servicepack.ucf and servicepack.bin) and update the service pack over the SPI.

    Documents on the OTA are provided within the package itself.

    Regards,

    Ankur

  • Hi Ankur,

    Where is servicepack.ucf file. I only see a servicepack.bin file.

    Forexample I'm using servicepack_1.0.0.1.2.bin, I could not find servicepack_1.0.0.1.2.ucf file.

    Thanks,

    Dennis

  • Hi Dennis,

    The OTA update package for CC3100 SDK can be download at www.ti.com/tool/cc3100sdk

    The OTA service pack binary and .ucf file are located in the OTA folder where the servicepack is installed. Instructions and example on how to perform the OTA update can be found in the CC3200 Over-The-Air (OTA) Update Application Note.pdf and CC3200 Simplelink OTA Extlib API User's Guide, located in the docs folder after you installed the OTA update package.

  • Hi Victor,

    I would like to use servicepack_1.0.0.1.2.bin but I could not see servicepack_1.0.0.1.2.ucf.

    Thanks,

    Dennis

  • Hi Dennis,

    For a stand alone servicepack, the ucf file is not necessary. You can simply use Uniflash to flash the servicepack_1.0.0.1.2.bin without any other files.

  • Hi Victor,

    Thanks for the clarification. I got it. I was being able to upgrade servicepack_1.0.0.1.2.bin.

    Here are steps:

    1. Check communication port, set up to 115,200 baud rate, 8 bits, no parity, 1 start/stop bit

    2. Press "Format" button, format the serial flash on target. don't check secure nor alert.

    3. Press "Service Pack Update" button, choose  servicepack_1.0.0.1.2.bin.

    Dennis