Skip navigation
Home > All Places > WICED Studio Wi-Fi/Combo > WICED Studio Wi-Fi/Combo Forums > Blog > 2014 > June
2014

The following Eclipse Kepler setup for WICED SDK is tested using Ubuntu 12.04 LTS and Ubuntu 14.04 LTS.


1. Install Eclipse Kepler on Ubuntu

a. Download the appropriate eclipse package from www.eclipse.org/downloads/?osType=linux

b. Un-tar the package

tar -zvxf eclipse-standard-kepler-SR2-linux-gtk-x86_64.tar.gz

c. Copy eclipse directory to /opt

sudo cp -R eclipse /opt

d. Change ownership /opt/eclipse

sudo chown -R root:root /opt/eclipse

e. Create a link in /usr/bin

sudo ln -s /opt/eclipse/eclipse /usr/bin/eclipse

f. Create a desktop file to lunch eclipse

sudo vi /usr/share/applications/eclipse.desktop

or

sudo gedit /usr/share/applications/eclipse.desktop

 

Insert the following text into the eclipse.desktop file:

[Desktop Entry]

Name=Eclipse

Type=Application

Exec=/opt/eclipse/eclipse

Terminal=false

Icon=/opt/eclipse/icon.xpm

Comment=WICED IDE

NoDisplay=false

Categories=Development;IDE

Name[en]=eclipse.desktop

 

2. Install “C/C++ Development Tools” and “C/C++ GDB Hardware Debugging” to Eclipse.

a. Go to Eclipse software install by “Help” -> “Install New Software…”

b. On the “Work with:” type “CDT Kepler – http://download.eclipse.org/tools/cdt/releases/kepler”.

c. Select “C/C++ Development Tools” under “CDT Main Features”

d. Select “C/C++ GDB Hardware Debugging” under “CDT Optional Features”

e. Click “Next” to install above software.

 

3. Download desired version of WICED SDK from community.broadcom.com.

The 7zip is needed to extract WICED SDK and “Ubuntu Software Center” could be used to install it.

Extract WICED SDK to desired location using 7zip.

For this example the WICED-SDK-2.4.1.7z.zip file is extracted into …/WicedSDKs/WICED-SDK-2.4.1.

 

4. Bring WICED SDK into Eclipse.

a. For this example, set the eclipse workspace to …/WicedSDKs

b. Switch to “C/C++” perspective if not already in it.

c. Create new project by “File” -> “New” -> "Project..." then select “Makefile Project with Existing Code” under "C/C++".

d. Enter new project name. New project name could be the same as location of the SDK.

 

e. Select “WICED-SDK-2.4.1” then “Project” -> “Properties” to open project properties.

Update the “Build command” on the “Builder Settings” tab to the following:

“${workspace_loc:/WICED-SDK-2.4.1}/make”

    

f. Select “Window” -> “Show View” -> “Make Target” to display “Make Target” tab.


g. Select “WICED-SDK-2.4.1” in the “Make Target” tab then select “Project” -> “Make Target” -> “Create” to create the following make targets.

- “clean”

- “snip.scan-BCM94390WCD2-debug HOST_OS=Linux_64 download run”

For 32-bit host use “HOST_OS=Linux_32”.

 

5. Setup WICED USB J-TAG connection

a. For Ubuntu 12.04 and 14.04:

Create the /etc/udev/rules.d/70-wiced-JTAG.rules file as follows:

     sudo gedit /etc/udev/rules.d/70-wiced-JTAG.rules

 

Set the content of the file as the following:

# udev rules file for WICED USB JTAG interface, to allow use by non super-users

SUBSYSTEM=="usb", ATTR{idVendor}=="0a5c", ATTR{idProduct}=="43fa", GROUP="hwlab", MODE="0666"

 

b. Set the serial port:

sudo modprobe ftdi_sio vendor=0x0a5c product=0x43fa


The above line could be inserted into the ~/.bashrc to load FTDI driver at startup.

 

6. Clean, build, download, and run the WICED sample application

a. Double click “clean” target build on the “Make Target” tab to clean.

b. Double click on

     “snip.scan-BCM94390WCD2-debug HOST_OS=Linux_64 download run” or

     “snip.scan-BCM94390WCD2-debug HOST_OS=Linux_32 download run”

     to build, download, and run scan sample application.

Note: Below descriptions apply to BCM4390WCD2 WiFi module with WICED SDK-3.0.x.

 

Here is how to use Olimex ARM-USB-TINY-H and Segger J-Link Plus programmers to download and debug BCM4390WCD2 WiFi evaluation board. The J-TAG connections for the application processor for Broadcom 4390 WiFi module are routed directly to the USB driver chip and small modifications are needed to connect external programmer.

 

1. Below are the connections that need to be made between the 20-Pin J-TAG connector on the programmer and the BCM4390WCD2_2 WiFi module.

 

Olimex ARM-USB-TINY-H

OR

Segger J-link Plus

BCM4390WCD2_2

WiFi Module Pin

Function

Pin 1

TP25

VREF

Pin 5

TP38

TDI

Pin 7

TP39

TMS

Pin 9

TP35

TCK

Pin 13

TP37

TDO

Pin 20

TP40

GND

All other pins

Not Connected

-

 

2. The attached configuration file replaces ...\tools\OpenOCD\BCM439x.cfg.

 

3. The command for downloading and debugging the scan example app in ...\apps\snip\scan

For Olimex ARM-USB-TINY-H

     snip.scan-BCM94390WCD2-debug JTAG=Olimex_ARM-USB-TINY-H download run

 

For Segger J-Link

     snip.scan-BCM94390WCD2-debug JTAG=jlink download run

 

 

Here is a picture of the updated evaluation board with Olimex:

Here is a picture of the updated evaluation board with Segger J-Link:

GregG_16

WICED FTDI chip programming

Posted by GregG_16 Jun 6, 2014

** This is one of the ways to program an FTDI chip, see following blog post for alternative method running an automatic script instead of this program.

WICED FTDI Chip Programming (2) via Script

 

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 via an EEPROM. This EEPROM should be programmed via USB with the correct settings for the WICED board.

The EEPROM can be programmed using a tool called FT_PROG which is available from : http://www.ftdichip.com/Support/Utilities/FT_Prog_v2.8.2.0.zip

The configuration file to be programmed via FT_PROG is attached: BCM9WCD1EVAL1_FTDI.xml

 

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
  • Download FTDI drivers from http://www.ftdichip.com/Drivers/VCP.htm
  • Unzip and open the following files in a text editor: ftdiport.inf,  ftdibus.inf
  • Modify the VID/PID to match those you noted earlier.
  • Install the driver by right clicking the device (in Device Manager) and selecting "Update Driver Software", then "Browse my computer for driver software" and select the directory with the modified driver files.
  • Now FTDI should be able to detect the board.

 

Important Note in relation to the FTDI programming:

The pin mapping between the FTDI chip and the host processor must exactly match that used on the WICED boards otherwise the board will be incompatible with the TCL scripts. If the board is incompatible please use a new VID/PID and TCL script to avoid making your system incompatible with WICED EVBs.

If you are selling boards with FTDI parts on them, you MUST NOT use BroadcomVendor ID. This means they you will need to change the driver and TCL scripts to pick up your new values.

Using AP(softAP) and STA(client) simultaneously

 

Several people have asked about using the WICED module as a SoftAP (AP) and a Client (STA) at the same time.

In this Blog, we will demonstrate this with the Console test App.

First, compile, download and run the Console Test App:

This can be done with the following "Make Target" test.console-BCM943362WCD4 download run

ap1.JPG

 

Next assure via the Serial port console window that the Console app is running

For more information on this Serial Port Communication to WICED Module

Using AP and STA simul..JPG

Typing 'help'  will scroll a long list of commands.

 

> help

Console Commands:

     help [<command> [<example_num>]]

         - Print help message or command example.

     loop <times> [ <semicolon_separated_commands_list> ]

         - Loops the commands inside [ ] for specified number of times

     antenna <0|1|3>

         - Antenna selection. 3 = Auto

     get_noise

         - Get PHY noise after successful TX

     get_ap_info

         - Get AP information

     get_access_category_parameters_sta

         - Get access category parameters for STA

     get_associated_sta_list

         - Get list of associated clients

     get_counters

         - Get counters

     get_country

         - Get country.

     get_rate

         - Get current rate.

     get_data_rate

         - Get data rate.

     get_mac_addr

         - Get the device MAC address.

     get_pmk <key>

         - Get PMK

     get_random

         - Get a random number.

     get_rssi

         - Get the received signal strength of the AP (client mode only).

     get_soft_ap_credentials

         - Get SoftAP credentials

     get_tx_power

         - Gets the tx power in dBm.

     join <ssid> <open|wep|wpa_aes|wpa_tkip|wpa2|wpa2_tkip> [key] [ip netmask gateway]

         - Join an AP. DHCP assumed if no IP address provided

     join_specific <ssid> <bssid> <channel> <open|wep|wpa_aes|wpa_tkip|wpa2|wpa2_tkip> [key] [ip netmask gateway]

         - Join specified AP. DHCP assumed if no IP address provided

     leave

         - Leave an AP.

     scan

         - Scan all enabled channels and print a list of APs found.

     set_legacy_rate <1|2|5.5|6|9|11|12|18|24|36|48|54>

         - Set legacy (CCK/OFDM) rate on PHY

     set_mcs_rate <MCS Index> <Override MCS only>

         - Set MCS rate on PHY

     disable_11n

         - Disable 11n mode operation

     enable_11n

         - Enable 11n mode operation

     set_data_rate <1|2|5.5|6|9|11|12|18|24|36|48|54>

         - Set data rate.

     set_ip <ip> <netmask> <gateway>

         - Set a static IP.

     set_listen_interval <listen interval> <time unit>

         - Set listen interval in time unit 0 = Beacon Intervals. 1 = DTIM Intervals

     wifi_powersave <mode> [delay]

         - Enable/disable Wi-Fi powersave mode. 0 = disable. 1 = PS Poll. 2 = Wait [delay] ms before entering powersave

     set_tx_power <0-31>

         - Set the tx power in dBm.

     start_ap <ssid> <open|wpa2|wpa2_aes> <key> <channel> <wps>

         - Start AP mode.

     status

         - Print status of the Wi-Fi and network interfaces.

     stop_ap

         - Stop AP mode.

     test_ap <ssid> <open|wpa2|wpa2_aes> <key> <channel> <wps> <iterations>

         - Test AP mode.

     test_join <ssid> <open|wep|wpa_aes|wpa_tkip|wpa2|wpa2_tkip> [key] [ip netmask gateway] <iterations>

         - Test joining an AP. DHCP assumed if no IP address provided

     test_join_specific <ssid> <bssid> <channel> <open|wep|wpa_aes|wpa_tkip|wpa2|wpa2_tkip> [key] [ip netmask gateway] <iterations>

         - Test joining an AP. DHCP assumed if no IP address provided

     test_cred <ssid> <bssid> <channel> <open|wep|wpa_aes|wpa_tkip|wpa2|wpa2_tkip> [key]

         - Test joining an AP

     ping <destination> [-i <interval in ms>] [-n <number>] [-l <length>]

         - Pings the specified IP or Host.

     force_alignment

         - Force aligned memory accesses

     join_wps <pbc|pin> [pin] [<ip> <netmask> <gateway>]

         - Join an AP using WPS

     join_wps_specific [pin] [<ip> <netmask> <gateway>]

         - Join a specific WLAN using WPS PIN mode

     scan_wps

         - Scan for APs supporting WPS

     start_registrar <pbc|pin> [pin]

         - Start the WPS Registrar

     stop_registrar

         - Stop the WPS Registrar

     p2p_connect <pin|pbc> [8 digit PIN]

         - Connect to an existing Group Owner or negotiate to form a group

     p2p_client_test <SSID> <8 digit PIN> [Iterations]

         - Test P2P client connection to existing group owner

     p2p_discovery_disable

         - Disable P2P discovery mode

     p2p_discovery_enable

         - Enable P2P discovery mode

     p2p_discovery_test [iterations]

         - Test enable/disable of P2P discovery mode

     p2p_go_start <p|n> [<ssid_suffix> <key> <operating channel>]

         - Start P2P (p)ersistent or (n)on-persistent group

     p2p_go_stop

         - Stop P2P group owner

     p2p_go_test <p|n> [iterations]

         - Test start/stop of (p)ersistent or (n)on-persistent group

     p2p_go_client_test_mode <enable=1|disable=0> <pin value>

         - Allow test client to join using PIN value

     p2p_leave

         - Disassociate from P2P group owner

     p2p_negotiation_test <8 digit PIN> [Iterations]

         - Test P2P negotiation handshake

     p2p_peer_list

         - Print P2P peer list

     p2p_registrar_start <pin|pbc> [8 digit PIN]

         - Start P2P group owner's WPS registrar

     p2p_registrar_stop

         - Stop P2P group owner's WPS registrar

     p2p_set_go_intent <intent value>

          - Set P2P group owner intent (0..15 where 15 = must be GO)

     p2p_set_go_pbc_mode_support <0|1>

          - Set P2P group owner support for PBC mode (1 = allow, 0 = disallow)

     p2p_set_listen_channel <channel>

         - Set listen channel (1, 6 or 11)

     p2p_set_operating_channel <channel>

         - Set operating channel (1..11)

     iperf

         - Run iperf --help for usage.

     iperf_test

         - iperf_test [iterations] iperf command

     malloc_info

         - Print memory allocation information

     thread_list

         - [ThreadX only] Lists the current running threads

     thread_kill <thread id>

         - [ThreadX only] Kills the specified running thread

     thread_spawn [priority] <cmds>

         - [ThreadX only] Spawns a new thread for the specified command. Optionally run at a specific priority.

     reboot

         - Reboot the device

     mcu_powersave <0|1>

         - Enable/disable MCU powersave

     traffic_stream_ipv4 [-c <destination ip>] [-p <port>] [-u (for udp)] [-l <length>] [-d <duration in seconds>] [-r <rate (pps)>] [-S <type of service>] [-i <interface>]

         - Start a traffic stream.

>

 

 

In this demo we will use the following commands:


status

     - Print status of the Wi-Fi and network interfaces.


scan

     - Scan all enabled channels and print a list of APs found.


start_ap <ssid> <open|wpa2|wpa2_aes> <key> <channel> <wps>

     - Start AP mode.


stop_ap

     - Stop AP mode.


join <ssid> <open|wep|wpa_aes|wpa_tkip|wpa2|wpa2_tkip> [key] [ip netmask gateway]

    - Join an AP. DHCP assumed if no IP address provided

 

leave

- Leave an AP.



First let's check the "status"

> status
WICED Version  : 3.1.2
Platform              : BCM943362WCD4
MAC Address     : 44:39:C4:31:14:83

STA Interface     : Down
AP Interface       : Down
P2P Interface     : Down

 

You can see from the output that the STA and AP interfaces are both down.

 

Next we can join an existing network:


Type 'scan' to see who is available:

> scan

Waiting for scan results...

  # Type  BSSID                      RSSI  Rate Chan Security    SSID

----------------------------------------------------------------------------------------------

  0 Infra 00:16:01:A1:98:38     -68    144.4     1    Open              Nidal-Out

  1 Infra 00:90:4C:10:E2:20    -57     216.7    1    Open              BSD-Android-Test

  2 Infra B8:BE:BF:15:AF:B2  -38     144.4    1    WPA2 AES    BRCMWiFi

  3 Infra B8:BE:BF:15:AF:B1  -38     144.4    1    WPA2 AES    brcmwpa

  4 Infra 04:A1:51:38:63:AD    -65     216.7   1    WPA2 AES    NETGEAR24-BT

  5 Infra B8:BE:BF:15:AF:B0   -36     54.0     1    WPA2 AES    BRCMGUEST

 

End of scan results

 

Next we will join an AP, in this example "BRCMGUEST"

> join BRCMGUEST wpa2 <passphrase>

Joining : BRCMGUEST

Successfully joined : BRCMGUEST

Obtaining IPv4 address via DHCP

Setting IPv6 link-local address

IPv4 network ready IP: 10.16.101.9

 

Now check the status:

> status
WICED Version  : 3.1.2
Platform              : BCM943362WCD4
MAC Address     : 44:39:C4:31:14:83

STA Interface
   MAC Address : 44:39:C4:31:14:83
   SSID               : BRCMGUEST
   IP Addr           : 10.16.101.9
   Gateway         : 10.16.96.1
   Netmask         : 255.255.248.0
AP Interface      : Down
P2P Interface    : Down

 

You can see we have successfully joined the network and received an IP address via the DHCP server.

 

Next we start an AP:

If you type start_ap you will see the correct syntax:

> start_ap

Usage: start_ap <ssid> <open|wpa2|wpa2_aes> <key> <channel> <wps>

 

Let's start an AP with the SSID 'gangi' with WPA2 security and a passphrase of '12345678' on Channel 1

PLEASE NOTE: The AP and STATION need to be on the same channel!  In this case it is 2.4GHz Channel 1.

> start_ap gangi wpa2 12345678 1
Setting IPv6 link-local address
IPv4 network ready IP: 192.168.0.1

 

Look at the Status again:

> status

WICED Version  : 3.1.2

Platform              : BCM943362WCD4

MAC Address     : 44:39:C4:31:14:83

STA Interface
   MAC Address  : 44:39:C4:31:14:83
   SSID                : BRCMGUEST
   IP Addr            : 10.16.101.9
   Gateway          : 10.16.96.1
   Netmask          : 255.255.248.0
AP Interface
   MAC Address  : 44:39:C4:31:14:83
   SSID                : gangi
   IP Addr            : 192.168.0.1
   Gateway          : 192.168.0.1
   Netmask          : 255.255.255.0
P2P Interface     : Down


Now you can see we have a AP interface and a STA Interface simultaneously running.

 

 

You can easily stop the soft AP using 'stop_ap' and leave the AP using the 'leave' command

> stop_ap
> status
WICED Version  : 3.1.2
Platform              : BCM943362WCD4
MAC Address     : 44:39:C4:31:14:83

STA Interface
   MAC Address  : 44:39:C4:31:14:83
   SSID                : BRCMGUEST
   IP Addr            : 10.16.101.9
   Gateway          : 10.16.96.1
   Netmask          : 255.255.248.0
AP Interface      : Down
P2P Interface     : Down

 

 

> leave
> status
WICED Version  : 3.1.2
Platform              : BCM943362WCD4
MAC Address     : 44:39:C4:31:14:83

STA Interface    : Down
AP Interface       : Down
P2P Interface     : Down

 

 

Enjoy. Hope this helps!

 

Please direct questions and comments to:

seyhan and GregG_16

Filter Blog

By date:
By tag: