Program to update the Firmware of the CC3000 wlan module

Dependencies:   NVIC_set_all_priorities cc3000_hostdriver_mbedsocket mbed

The program will update the firmware version of the CC3000 wlan module to version 1.32. The update itself is cut off the texas instruments updater for the msp430 based code.

Connect the mbed with a serial terminal with 115200bd . The program read out the actual firmware version and ask to update. You have to press 'y' to start the update.

serial output:

***************************************
* CC3000 firmware update  1.32        *
***************************************
Checking connection to cc3000 chip ...
Found Firmware Version :  1.24
Found MAC Address : 70:FF:76:01:7F:F1
press y to start update
 update wlan driver ... Update wlan driver sucessfull
 update wlan firmware ... Update firmware driver sucessfull
 New Firmware Version :  1.32
***************************************
*           END                       *
*************************************** 
Committer:
dreschpe
Date:
Tue Jan 20 09:18:07 2015 +0000
Revision:
0:638c06c36bc5
update doc

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dreschpe 0:638c06c36bc5 1 /* mbed Microcontroller Library
dreschpe 0:638c06c36bc5 2 * Copyright (c) 2006-2013 ARM Limited
dreschpe 0:638c06c36bc5 3 *
dreschpe 0:638c06c36bc5 4 * Licensed under the Apache License, Version 2.0 (the "License");
dreschpe 0:638c06c36bc5 5 * you may not use this file except in compliance with the License.
dreschpe 0:638c06c36bc5 6 * You may obtain a copy of the License at
dreschpe 0:638c06c36bc5 7 *
dreschpe 0:638c06c36bc5 8 * http://www.apache.org/licenses/LICENSE-2.0
dreschpe 0:638c06c36bc5 9 *
dreschpe 0:638c06c36bc5 10 * Unless required by applicable law or agreed to in writing, software
dreschpe 0:638c06c36bc5 11 * distributed under the License is distributed on an "AS IS" BASIS,
dreschpe 0:638c06c36bc5 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dreschpe 0:638c06c36bc5 13 * See the License for the specific language governing permissions and
dreschpe 0:638c06c36bc5 14 * limitations under the License.
dreschpe 0:638c06c36bc5 15 */
dreschpe 0:638c06c36bc5 16 #include "main.h"
dreschpe 0:638c06c36bc5 17 #include "mbed.h"
dreschpe 0:638c06c36bc5 18
dreschpe 0:638c06c36bc5 19 #if (MY_BOARD == WIGO)
dreschpe 0:638c06c36bc5 20
dreschpe 0:638c06c36bc5 21 #include "NVIC_set_all_priorities.h"
dreschpe 0:638c06c36bc5 22
dreschpe 0:638c06c36bc5 23 /**
dreschpe 0:638c06c36bc5 24 * \brief Wi-Go initialization
dreschpe 0:638c06c36bc5 25 * \param none
dreschpe 0:638c06c36bc5 26 * \return none
dreschpe 0:638c06c36bc5 27 */
dreschpe 0:638c06c36bc5 28 void init() {
dreschpe 0:638c06c36bc5 29 DigitalOut PWR_EN1(PTB2);
dreschpe 0:638c06c36bc5 30 DigitalOut PWR_EN2(PTB3);
dreschpe 0:638c06c36bc5 31
dreschpe 0:638c06c36bc5 32 // Wi-Go set current to 500mA since we're turning on the Wi-Fi
dreschpe 0:638c06c36bc5 33 PWR_EN1 = 0;
dreschpe 0:638c06c36bc5 34 PWR_EN2 = 1;
dreschpe 0:638c06c36bc5 35
dreschpe 0:638c06c36bc5 36 NVIC_set_all_irq_priorities(3);
dreschpe 0:638c06c36bc5 37 NVIC_SetPriority(SPI0_IRQn, 0x0); // Wi-Fi SPI interrupt must be higher priority than SysTick
dreschpe 0:638c06c36bc5 38 NVIC_SetPriority(PORTA_IRQn, 0x1);
dreschpe 0:638c06c36bc5 39 NVIC_SetPriority(SysTick_IRQn, 0x2); // SysTick set to lower priority than Wi-Fi SPI bus interrupt
dreschpe 0:638c06c36bc5 40 PORTA->PCR[16] |=PORT_PCR_ISF_MASK;
dreschpe 0:638c06c36bc5 41 PORTA->ISFR |= (1 << 16);
dreschpe 0:638c06c36bc5 42 }
dreschpe 0:638c06c36bc5 43
dreschpe 0:638c06c36bc5 44 #elif (MY_BOARD == WIFI_DIPCORTEX)
dreschpe 0:638c06c36bc5 45
dreschpe 0:638c06c36bc5 46 /**
dreschpe 0:638c06c36bc5 47 * \brief Wifi DipCortex initialization
dreschpe 0:638c06c36bc5 48 * \param none
dreschpe 0:638c06c36bc5 49 * \return none
dreschpe 0:638c06c36bc5 50 */
dreschpe 0:638c06c36bc5 51 void init() {
dreschpe 0:638c06c36bc5 52 NVIC_SetPriority(SSP1_IRQn, 0x0);
dreschpe 0:638c06c36bc5 53 NVIC_SetPriority(PIN_INT0_IRQn, 0x1);
dreschpe 0:638c06c36bc5 54
dreschpe 0:638c06c36bc5 55 // SysTick set to lower priority than Wi-Fi SPI bus interrupt
dreschpe 0:638c06c36bc5 56 NVIC_SetPriority(SysTick_IRQn, 0x2);
dreschpe 0:638c06c36bc5 57 }
dreschpe 0:638c06c36bc5 58
dreschpe 0:638c06c36bc5 59 #else
dreschpe 0:638c06c36bc5 60
dreschpe 0:638c06c36bc5 61 /**
dreschpe 0:638c06c36bc5 62 * \brief Place here init routine for your board
dreschpe 0:638c06c36bc5 63 * \param none
dreschpe 0:638c06c36bc5 64 * \return none
dreschpe 0:638c06c36bc5 65 */
dreschpe 0:638c06c36bc5 66 void init() {
dreschpe 0:638c06c36bc5 67
dreschpe 0:638c06c36bc5 68 }
dreschpe 0:638c06c36bc5 69
dreschpe 0:638c06c36bc5 70 #endif