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.

How can I patch the CC3000 in my target board?

I need to patch the CC3000 in my target board which is a LM3S9D92.  It is ported to SPI 0 and the SPI hardware abstraction layer appears to be working.  I can't get Smart Config to work.  It hangs waiting for ulSmartConfigFinished to get set.  Looks like the CC3000_UsynchCallBack() callback is never called.

Calling nvmem_read_sp_version(ptr) shows the CC3000 came with version = 1.10. 

Reading the forums suggests a few things.

1. The CC3000 may not have been a wise choice since it seems to be buggy.

2. What is why is Smart Config not working?

3. It may have something to do with the CC3000 firmware.  But this is not a CC3000 EM module.  Its wired to my board which is also running its primary task (a fancy thermostat) and I am trying to add WiFi to it.

So how do I update the firmware on the CC3000 through my target board?

  • Hi Bill,


    Simply import PatchProgrammer_DR_Patch.c and PatchProgrammer_FW_Patch.c and run the content of their main() method. You must run the driver patch before the firmware patch.

    In my project I combined them into a single file, but my MCU has enough flash memory to fit both. I am attaching the file just for your reference. Then in my main() method I simply do the following:

        static uint8_t spVersion[2];
        nvmem_read_sp_version(spVersion);
        if (spVersion[0] != 1 || spVersion[1] != 26)
        {
            ProgramDriver();
            ProgramFirmware();
        }

    8130.PatchProgrammer.h

    2642.PatchProgrammer.c

  • Hi Ivor,

    This is terrific and I thank you. 

    I am trying to port your code to mine.  Frankly I am terrified that if I screw this up I will end up turning my expensive bread board into a brick.

    Since my platform is the LM3S ARM and not an MSP430 I need to change a few things.

    My board doesn't have many LEDs.  It does have an LCD touchscreen running its own app that I must now add WiFi to.

    1. TI is obviously going to continue to supply firmware updates for the CC3000.  When the next one comes out, how do I get the fw_patch[size] and wlan_drv_patch[size] structures like you provided?

     

    2.  I need to know where to do the 

     if (spVersion[0] != 1 || spVersion[1] != 26)
     {
          ProgramDriver();
          ProgramFirmware();
     }

    I already have my own version of initDriver but I need to understand your version that uses the cRequestPatch parameter.  I have my own wlan_initi call in my initialization.  

       init_WiFi_GPIO();              // initialize WiFi I/O not related to SPI or DMA

       init_spi();                            // initialize SPI0 to CC3000 chip

                                                  // WLAN On API Implementation 
       wlan_init( CC3000_UsynchCallback, // Asynchrounous events callback (HCI_EVNT_xxxx
                        sendWLFWPatch,             // FW patches (whatever that is)
                        sendDriverPatch,               // Driver patches
                        sendBootLoaderPatch,      // Boot Loader patches
                        ReadWlanInterruptPin,       // init callback. The callback read wlan interrupt status
                        WlanInterruptEnable,          // init callback. The callback enable wlan interrupt
                        WlanInterruptDisable,         // init callback. The callback disable wlan interrupt
                        WriteWlanPin);                    // init callback. The callback write value to device pin

       wlan_start(0);                                         // I use a 0 parameter and you use cRequestPatch parameter

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

    Can I call ...

     if (spVersion[0] != 1 || spVersion[1] != 26)
     {
          ProgramDriver();
          ProgramFirmware();
     }

    After my initialization?

     

    3. After that,  How then do I make it ready for Smart Config?

    Thanks again

    Bill

  • Hi Bill,


    You should really be porting PatchProgrammer_DR_Patch.c and PatchProgrammer_FW_Patch.c, not my file, which I provided just for a reference. My file is simply merging these two files and getting rid of the duplicate methods. I also renamed PatchProgrammer_DR_Patch.c's main() method to ProgramDriver() and PatchProgrammer_FW_Patch.c's main() method to ProgramFirmware().

    Now to answer your questions:

    1. When a new patch comes out, you will able to download it from TI and install it on your machine. It will contain the source code in a directory called "C:\ti\PatchProgrammerMSP430FR5739-1.xx.x.xx.xx\Patch Programmer Source\Source\Patch Programmer". There you will find PatchProgrammer_DR_Patch.c and PatchProgrammer_FW_Patch.c which will contain the updated driver and firmware arrays. You can do this today with v1.12.

    2. I do it in my main() method right before I call wlan_init(...). My situation is different, since I cannot fit both the patch programmer and my own firmware into the 32K of flash memory my $1.65 MCU has. So, I compile 2 separate firmwares - one to patch and one to run. This slightly complicates my manufacturing process,since I first have to program my board with the patch, run it and then program with the firmware. But it sound like your MCU can fit everything, so the only thing you have to do after patching is reset the CC3000.

    3. Did not play much with Smart Config, since I don't use it, but I got it to connect to my router when I first got the CC3000EM + FRAM Experimenter's board. If you don't have this board, I strongly suggest you get it, as there are many step-by-step instructions and videos on how to setup SmartConfig with this board and a free iPhone app. Here is the video I used to get it to work:

    http://www.youtube.com/watch?v=NChWXY7VYec