Skip navigation
Home > All Places > WICED Studio Wi-Fi/Combo > WICED Studio Wi-Fi/Combo Forums > Blog > 2015 > August
2015

** This is one of the ways to program an FTDI chip, this might be easier as it only involves one download and double-clicking a script. To use an FTDI config program instead, see following blog post for alternative method.

WICED FTDI chip programming

 

<FTDI Introduction>


WICED evaluation boards have a FTDI FT2232 chip which provides debug capability with USB to UART+JTAG.

To provide this functionality the FTDI chip must be configured with the correct settings, which is done by programming the EEPROM via USB with the correct settings for the WICED board.

The EEPROM can be programmed using the script in the attachment. The configuration file to be programmed via FT_PROG is also included: BCM9WCD1EVAL1_FTDI.xml

 

<FTDI Programming>


If you have installed WICED SDK then the drivers should already be installed. Go through the following steps to program the FTDI chip.


1. Download the attachment and extract the contents into a folder.

  ftprog.PNG


2.  Run the Prog_BCM9WCD1EVAL1.bat by double-clicking on it. Wait until you see "Re-enumerating Device 0" (You must do through step #1 and extract all the files, otherwise it will not be able to run)

ftprog.PNG

 

3. Once this has finished successfully, go to Windows Device Manager and you will see the following:


- WICED USB Serial Port (COMx) under Ports

- WICED USB Serial Port B under Universal Serial Bus Controllers

- WICED USB JTAG Port under WICED USB JTAG Devices

ftprog.PNG



4. If it does not program correctly, change the VID/PID in the BCM9WCD1EVAL1_FTDI.xml file.

 

    Note: it is possible that FT_PROG cannot detect your board.  This means that the USB VID/PID of the board do match the default      FTDI VID/PID.  If this is the case you will need to :

  • Open Windows Device Manager, and right click the device and select properties. Then select the Details tab and Hardware Ids property. Make a note of the VID/PID
  • Change the VID/PID in the BCM9WCD1EVAL1_FTDI.xml file.

 

You should be able to download desired image to the board now. Try it out with our basic snip.scan app!



Once you have the WICED IDE installed, you can import other WICED SDK .7z releases easily without reinstalling the IDE, or even changing the workspace. This method comes in handy when you have several releases you want to test and compare. You may keep several projects(SDKs) open in one workspace, but for simplicity we will start with closing the existing project.


**In the case you want to change the workspace in Eclipse and import the new SDK, please refer to the following blog post.

How to bring a WICED SDK into Eclipse



1. Right-click on your current project name in the IDE and select "Close Project". This will not modify or delete your files in anyway. It will, however, close the files you had open in the IDE, and you can choose to either save any changes that had been made. (This step is optional, you may have several projects open at once)

close_project.png



2. Extract the new WICED SDK .7z file to your chosen destination.



3. Click on the arrow next to the blue folder icon and select "Makefile Project with Existing Code"

Makefile_existing.png



4. Click on "Browse" and navigate to and then select the WICED SDK folder you created. The "Project Name" will be automatically filled in from the name in the "Existing Code Location" you choose. You may modify the name for clarity.


navigate.PNG



5. The new SDK will now be showing in the "Project Explorer" view.

new_project.PNG



6. You will have to create new target names when you import a new project. The make file will be linked to the previous project if you  copy and paste existing targets from other projects, so it's best to create new ones.


In the "Make Target" window on the right, the "Hide Empty Folder" will be selected by default. You need to unselect this.

  target.png


Right click on the project name and select "New".

  target.png


This will allow you to make new targets. To obtain a complete list of build commands and options, enter the following text in the base WICED SDK directory on a command line:

$> make

 

create_make_target.png

 

For WICED SDK 3.3.1, the usage is as following:

 

Usage: make <target> [download] [run | debug] [JTAG=xxx] [no_dct]

 

  <target>

    One each of the following mandatory [and optional] components separated by '-'

      * Application (apps in sub-directories are referenced by subdir.appname)

      * Hardware Platform ()

      * [RTOS] (ThreadX NoOS wiced_rtos_common.c FreeRTOS)

      * [Network Stack] (wiced_network_common.c LwIP wiced_tcpip_common.c NoNS NetX NetX_Duo)

      * [MCU-WLAN Interface Bus] (SDIO SPI)

 

  [download]

    Download firmware image to target platform

 

  [run]

    Reset and run an application on the target hardware (no download)

 

  [debug]

    Connect to the target platform and run the debugger

 

  [JTAG=xxx]

    JTAG interface configuration file from the tools/OpenOCD dirctory

    Default option is BCM9WCD1EVAL1, direct JTAG option is jlink

 

  [no_dct]

    DCT downloading is disabled and the DCT remains unmodified.

    Only valid when the 'download' option is present

 

  [factory_reset_dct]

    Generates a factory reset DCT

 

  [VERBOSE=1]

    Shows the commands as they are being executed

 

  [JOBS=x]

    Sets the maximum number of parallel build threads (default=4)

 

  Notes

    * Component names are case sensitive

    * 'WICED', 'SDIO', 'SPI' and 'debug' are reserved component names

    * Component names MUST NOT include space or '-' characters

    * Building for release is assumed unless '-debug' is appended to the target

    * Some platforms may only support a single interface bus option

 

  Example Usage

    Build for Release

       make snip.scan-BCM943362WCD4

       make snip.scan-BCM943362WCD4-ThreadX-NetX_Duo-SDIO

 

    Build, Download and Run using the default USB-JTAG programming interface

       make snip.scan-BCM943362WCD4 download run

 

    Build for Debug

       make snip.scan-BCM943362WCD4-debug

 

    Build, Download and Debug using command line GDB

       make snip.scan-BCM943362WCD4-debug download debug

 

    Reset and run an application on the target hardware

       make run

 

    Clean output directory

       make clean

 

    Build a Factory Reset image for the SPI serial flash

       make snip.ping-BCM943362WCD4  OTA=waf.ota_upgrade  SFLASH=app-dct-ota-download

          where: [OTA]=<OTA application build string>

                         Build string options are App name, RTOS and TCP stack ONLY

                     <SFLASH>=<app>-[dct]-[ota]-[download]

                        where:

                            app      : Add the application to the image

                            dct      : Add the DCT to the image

                            ota      : Add the OTA application to the image

                            download : Download the image after creation

 



That was it! Enjoy using your new SDK

<BIG RESTful Smart Server Demo>


The RESTful Smart server implements the Bluetooth Internet Gateway(BIG), and is the successor of SmartBridge. It allows you to connect to the WICED device through WiFi and then connect to peripherals through BLE. You can issue http get/put requests to scan/connect/read and write characteristic and descriptor values from ble peripherals through WICED devices.


Below is a guide on how to use the RESTful Smart Server with curl commands. You can also use RESTful clients for a gui environment. The http requests will be the same. Note that results with REST clients may vary, you will get the best results with using curl commands in Cygwin. When using REST clients, be sure to always include “user-Agent: curl/7.37.1”.


The ble peripherals used for testing are WICED Sense kits, hello_sensor app loaded on a BCM920737 (TAG 4), and iOS LightBlue peripherals. If you do not have any physical peripheral devices available for testing you can download the Light Blue app in iOS to generate virtual peripheral devices. Make sure that your iOS device screen does not time out as that may disconnect the bluetooth connections. In the case that data gets corrupted and you are not getting the right JSON response, try reconnecting or resetting the peripheral.


- For BCM943909WCD1 / BCM943341WCD1 / BCM943438 REFAD

- See attached files for GAP and GATT API spec sheets for the format of the RESTful API.


- REST Client For Mac

    https://luckymarmot.com/paw

- REST Client For Windows

    http://www.swensensoftware.com/im-only-resting

- Installing Curl on Cygwin

    http://stackoverflow.com/questions/3647569/how-do-i-install-curl-on-cygwin

 


<SETUP>


1. Change the network SSID and password to match your network in /apps/demo/bt_internet_gateway/restful_smart_server/wifi_config_dct.h

  ssid.PNG


2. Compile and download with target demo.bt_internet_gateway.restful_smart_server-<PLATFORM> download run

smart_server.PNG


3. Open a terminal (PuTTY/TeraTerm/CoolTerm) to check the serial output. Once the device has downloaded and reset, it will connect to the network and set up the smart server automatically. You can access the server using the address it was assigned.

  smart_screen.PNG


4. Turn on some ble peripherals and use the curl commands below on your PC or use REST clients to scan/connect/read/write data. If you set up a local network for testing be sure to connect to the same network from your PC.


**When accessing services or characteristics, be sure to use the full hex value in the last part of the "self" "href" field.


**You will need to use GAP API to scan and connect to the device, then GATT API to access the data


<GAP Commands>

  • Active Scan
    • curl -v -X GET "http://<IP>/gap/nodes?active=1"
  • Passive Scan:
    • curl -v -X GET "http://<IP>/gap/nodes?passive=1"
  • Connect
    • curl -v -X PUT "http://<IP>/gap/nodes/<NODE_HANDLE>?connect=1&enable=1"
  • List Available Connect Nodes
    • curl -v -X GET "http://<IP>/gap/nodes?enable=1"
  • Remove Node
    • curl -v -X PUT "http://<IP>/gap/nodes/<NODE_HANDLE>?enable=0"


<GATT Commands>

  • Discover Primary Services
    • curl -v -X GET "http://<IP>/gatt/nodes/<NODE_HANDLE>/services?primary=1"
  • Discover Services by UUID
    • curl -v -X GET "http://<IP>/gatt/nodes/<NODE_HANDLE>/services?primary=1&uuid=<UUID>"
  • Discover All Characteristics of a Service
    • curl -v -X GET "http://<IP>/gatt/nodes/<NODE_HANDLE>/services/<SERVICE_REF>/characteristics"
  • Discover Characteristic by UUID
    • curl -v -X GET "http://<IP>/gatt/nodes/<NODE_HANDLE>/characteristics?uuid=<UUID>"
  • Discover Descriptors
    • curl -v -X GET "http://<IP>/gatt/nodes/<NODE_HANDLE>/characteristics/<CHARACTERISTIC_REF>/descriptors"
  • Read Characteristic Value
    • curl -v -X GET "http://<IP>/gatt/nodes/<NODE_HANDLE>/characteristics/<CHARACTERISTIC_REF>/value"
  • Write Characteristic Value
    • curl -v -X PUT "http://<IP>/gatt/nodes/<NODE_HANDLE>/characteristics/<CHARACTERISTIC_REF>/value/<VALUE>"
  • Read Descriptor Value
    • curl -v -X GET "http://<IP>/gatt/nodes/<NODE_HANDLE>/descriptors/<DESCRIPTOR_HANDLE>/value"
  • Write Descriptor Value
    • curl -v -X PUT "http://<IP>/gatt/nodes/<NODE_HANDLE>/descriptors/<DESCRIPTOR_HANDLE>/value/<VALUE>"



restful1.png

restful2.png

restful3.png

restful4.png

restful5.png

Filter Blog

By date:
By tag: