Skip navigation
Home > All Places > Software Forums > WICED Studio Wi-Fi/Combo > WICED Studio Wi-Fi/Combo Forums > Blog > Authors SeyhanA_31

WICED SDK could be connected to the STM32Fx-Discovery board (in this case STM32F4-Discovery board is used) with JTAG debugger.


Connect the JTAG debugger to the STM32F4-Discovery board using the following connections.

ScreenHunter_105 Jan. 02 22.49.jpg

To build an application and run it on the target STM32F4-Discovery board add the following to the Make Target built command:

     For Olimex:     JTAG=Olimex_ARM-USB-TINY-H

     For Segger:     JTAG=jlink


     <WicedApplication>-<YourPlatform> JTAG=Olimex_ARM-USB-TINY-H download run


For sample interface of interfacing SN8000 WiFi module to the STM32F4-Discovery board please check out this link SN8000 WiFi Module with STM Discovery Board.

Here is an example of interfacing the BCM43362 based SN8000 WiFi module (from Murata) with STM32F4-Discovery board (with STM32F407 MCU).


The schematic below illustrates the connections required to connect the SN8000 to the STM32F4-Discovery board. Since the SN8000 comes as a module to connect to a PCB, a carrier board is needed to connect the module to the STM32F4-Discovery board.

ScreenHunter_95 Jan. 02 16.15.jpg


If you have the SN8000 module mounted on a SDIO carrier board, which comes with the SN800 evaluation board, the following connection schema can be used to connect the module to the STM32F4-Discovery board.

ScreenHunter_97 Jan. 02 16.19.jpg


For terminal interface between the STM32F4-Discovery board and host PC the following serial (RS232) connection is needed.

To connect a JTAG debugger (Olimex_ARM-USB-TINY-H) to the STM32F4-Discovery board follow the below connection.

For more information please take a look at this link: Interfacing STM32Fx-Discovery with WICED using JTAG Debugger


After setting up the hardware connections WICED SDK-3.x should be updated to run WICED applications on STM32F4-Discovery board with SN8000 WiFi module. Unzip the attached file with the following expected updates.


The STM32F407 directory goes to .../WICED/platform/MCU/STM32F4xx/GCC directory of the WICED SDK.


The STDiscovery407_BCM43362 platform files goes to .../platforms directory of the WICED SDK.

ScreenHunter_104 Jan. 02 22.35.jpg


To build and run application using WICED SDK following Make Target could be used;

     <Application>-STDiscovery407_BCM43362 JTAG=Olimex_ARM-USB-TINY-H download run


To build and run a sample scan app use the following Make Target:

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

Here is a patch for ThreadX for WICED SDK-3.1.x version.


The following is the patch for .../WICED/RTOS/ThreadX/WWD/wwd_rtos.c:


@@ -84,7 +84,7 @@ wwd_result_t host_rtos_create_thread_with_arg( /*@out@*/ host_thread_type_t* thr
     tx_thread_stack_error_notify( wiced_threadx_stack_error_handler );
#endif /* ifdef DEBUG */

-    status = tx_thread_create( thread, (char*) name, (void(*)( ULONG )) entry_function, arg, stack, (ULONG) stack_size, (UINT) priority, 0, TX_NO_TIME_SLICE, (UINT) TX_AUTO_START );
+    status = tx_thread_create( thread, (char*) name, (void(*)( ULONG )) entry_function, arg, stack, (ULONG) stack_size, (UINT) priority, (UINT) priority, TX_NO_TIME_SLICE, (UINT) TX_AUTO_START );

@@ -266,7 +266,7 @@ wwd_result_t host_rtos_delay_milliseconds( uint32_t num_ms )
         uint32_t time_reference = host_platform_get_cycle_count( );
-        int32_t wait_time       = (int32_t)num_ms * CPU_CLOCK_HZ / 1000;
+        int32_t wait_time       = (int32_t)num_ms * (int32_t)CPU_CLOCK_HZ / 1000;
         while ( wait_time > 0 )
             uint32_t current_time = host_platform_get_cycle_count( );


The .../WICED/RTOS/ThreadX/WWD/wwd_rtos.c source file is also attached.

This application snippet demonstrates the I2C device interface using WICED SDK-3.x.


The sample application sets up the I2C device interface and send commands to the I2C device then receives replies, if any, from the I2C device.


For this example "BlinkM - I2C Controlled RGB LED" ( I2C device is used to test the code. It could be any other I2C device chosen for your platform as well.


For BCM943362WCD4 evaluation platform update the platform.c and platform.h files for I2C device.


Update the .../platforms/BCM943362WCD4/platform.c file by adding the following changes to the file:

const platform_i2c_t platform_i2c_peripherals[] =
    [WICED_I2C_1] =
        .port                    = I2C1,
        .pin_scl                 = &platform_gpio_pins[WICED_GPIO_11],
        .pin_sda                 = &platform_gpio_pins[WICED_GPIO_12],
        .peripheral_clock_reg    = RCC_APB1Periph_I2C1,
        .tx_dma                  = DMA1,
        .tx_dma_peripheral_clock = RCC_AHB1Periph_DMA1,
        .tx_dma_stream           = DMA1_Stream7,
        .rx_dma_stream           = DMA1_Stream0,
        .tx_dma_stream_id        = 7,
        .rx_dma_stream_id        = 0,
        .tx_dma_channel          = DMA_Channel_1,
        .rx_dma_channel          = DMA_Channel_1,
        .gpio_af                 = GPIO_AF_I2C1


For platforms/BCM943362WCD4/platform.h file add the WICED_I2C_1 to the wiced_i2c_t as below:

typedef enum
} wiced_i2c_t;


The platform files for BCM943362WCD4 are attached.


For BCM943341WCD1 I2C device of WICED_I2C_1 is already defined in the platform files. For completeness the platform files are attached. The I2C device of WICED_I2C_1 for BCM943362WCD1 is already defined in the platform files. For completeness the platform files are attached.



Your application specific platform files can be updated as above to interface the chosen I2C device to the WICED SDK 3.x platform.


1. To run the test, connect the I2C device to the evaluation board as following:


Connection setup for I2C device to STM32F4xx based WICED evaluation board

I2C-Device   BCM943341WCD1 J7 Header

      -                    J7-27

     +                    J7-28

     SDA               J7-26

     SCL               J7-25


Connection setup for I2C device to STM32F2xx based WICED evaluation board

I2C-Device   BCM943362WCD4 J7 Header

     -                         J7-2

     +                        J7-1

     SDA                   J7-7

     SCL                   J7-6


2. Unzip and copy the attached files to the WICED SDK-3.x version.

For I2C LED application snippet:

     Copy the content of the i2c_led.7z source to .../apps/snip/i2c_led


For BCM943362WCD4:

     Copy the content of the BCM943362WCD4.7z source to .../platforms/BCM943362WCD4


For BCM943341WCD1:

     Copy the content of the BCM943341WCD1.7z source to .../platforms/BCM943341WCD1


3. To build, download and run the application below

For STM32F4xx MCU BCM943341WCD1:

     snip.i2c_led-BCM943341WCD1-debug download run


For STM32F2xx MCU BCM943362WCD4:

     snip.i2c_led-BCM943362WCD4-debug download run



This is the modified STM32F4xx MCU BCM943341WCD1 WICED evaluation board:


NOTE: There are no hardware nor platform file changes needed on the BCM943341WCD1 evaluation because the already defined I2C lines ,with pull-up resistors, are used.


This is the modified STM32F2xx MCU BCM943362WCD4 Wiced evaluation board:


NOTE: On BCM943362WCD4 evaluation board, SDA and SCL signals needs 4.7K pull up resistors.

This application snippet demonstrates the e-mail capability based on the state changes on the selected input.


The selected input could be discrete or analog input. Input could be the current temperature, security device going off, PIR detector, reed switch output, etc. For this example discrete input is used and the input is toggled by the push button switch (SW1) on the evaluation board.


To setup the application, please download the attached push2email snipped application and copy it to the WICED -SDK. For example the .../apps/snip directory of the WICED SDK.


Using .../apps/snip/push2email/wifi_config_dct.h, update the wi-fi configuration for WICED target platform board to connect to your network.

     Change the CLIENT_AP_SSID with your access point SSID.

     Change the CLIENT_AP_PASSPHRASE with your access point's security code.


You should change the "" email address with your own email address, in the push2email.c file. This should first be changed after #define RECIPIENT (line 48) and then again in the section to setup email account (line 168).


Build the push2email application and download it to your target

     snip.push2email-<YourPlatform> download run


For BCM943362WCD4 WICED evaluation board make target would be as following:

     snip.push2email-BCM943362WCD4 download run


When the push2email application runs on the target, the initial state of the LED1, based on the state of the SW1 switch, is sent as an email to the recipient. The following would be received by the email recipient: "WICED device is up initial LED state is ON."


As the SW1 switch is pressed to toggle the LED1 state, the state changes of the LED1 are sent to email recipient.


With new smtp signin security added by the mail service providers, embedded devices sign-in is prevented. The email address is created for demo purposes and the sign-in is set to access for less secure apps. Similar sign-in setup may require to send mail using your own smtp server. To receive email no such setup is required but Wiced device generated emails may end up in spam folder.

Here are the platform files for USI-09 module based evaluation board (BCM9WCDUSI09) for WICED SDK-3.x.


Unzip the attached files to .../platforms directory of the WICED SDK.


You should have the following structure on the SDK .../platform directory for BCM9WCDUSI09:
bcm9wcdusi09 platform files for sdk-3.x

One of the UART (USART6) on the BCM943341 evaluation board (BCM943341WCD1) is routed to USB bridge chip and the serial port brought out over the USB port. A second UART (USART2) is routed out of the module and brought out to the breakout header of the evaluation board.

UART2 pin outs on module:

Base board breakout header:

Base board UART2 pins are on the breakout header as listed below:

     J7 Pin-9   : UART2_RXD

     J7 Pin-10 : UART2_TXD

     J7 Pin-11 : UART2_CTS

     J7 Pin-12 : UART2_RTS

For this example only the UART2 Rx and Tx pins are used because the RS232 adapter board on hand  does not have CTS and RTS connections. It is possible to utilize CTS and RTS by updating the WICED_UART_2 section of the platform_uart_peripherals[...] definitions in .../platforms/BCM943341WCD1/platform.c file as following:

.cts_pin = &platform_gpio_pins[WICED_GPIO_15],
.rts_pin = &platform_gpio_pins[WICED_GPIO_16],

(found at lines 165/166)

Set up UART2 as the stdio terminal for the WICED board. Update the STDIO_UART definition in .../platforms/BCM943341WCD1/platform.h with WICED_UART_2 to map the UART2 as stdio UART.


/* UART port used for standard I/O */
#define STDIO_UART                       ( WICED_UART_2 )

(found at lines 203/204)

Serial port characteristics, such as baudrate, parity, stop bit, etc could be changed in stdio_config definitions of the module's platform.c file.

Connect your RS232 serial terminal connection to BCM943341 evaluation board as following:

The updated platform files for BCM943341WCD1 evaluation board are attached. Copy the attached files to .../platforms/BCM943341WCD1 directory. Build the application and download the image to the target WICED board. Setup your serial terminal to 115200, 8, N, 1 or as defined in the stdio_config to display messages from WICED board.

Sample application of scan could be run as following:

     snip.scan-BCM943341WCD1 download run


After successfully associating the IoT device as a client to a known network, the device connects to the associated network after each reset. This works fine for the most part, but if the known network credentials are changed, the device needs to be reconfigured with the new network.

The following application switches the device from client mode to access point (AP) mode for future configurations so that the device can be associated with a new network to communicate.



Press and hold the push button switch (SW1) on the evaluation board which initiates switching from client mode to AP mode. This is the same as using the webpage hosted by the evaluation board.

1. Right-click on the project and using "Team -> Apply Patch" apply the attached patch to the SDK.

The client2ap demo application is added to .../Apps/demo/client2ap.

The client2ap resource file is added to .../Resources/apps/client2ap.



2. Build and download the client2ap application by adding the following to Make Target.

    demo.client2ap-<Your Platform> download run

For example if you are using a BCM943362WCD4 platform:

    demo.client2ap-BCM943362WCD4 download run

3. Next you need to connect the WICED device to your network. 

The console output will show you the IP address of where the configuration page is being hosted.  In this case:

Navigate to this page from any browser (obviously connected to same AP.)

Follow the browser instructions to associate and pass your credentials to the WICED device:


Here is WicedSerial output after connecting to the selected network.

4. Once the device is associated to your network, it will always try to connect to the same network after resets,  however; in the background your WICED device is hosting a Webpage. At anytime you can navigate to this webpage from a device on the same subnet.

5. If you would like to get back into AP mode (to pass new credentials for example), use your browser to navigate to the IP address, in this case, and click on "Switch To AP Mode" to restart the configure AP mode.

6. Alternatively; you can press and hold the SW1 on the WICED eval board for 3 seconds to switch to AP mode.

7. After switching to AP mode the WICED device reboots. Here is the console output after switching to AP mode.  Now are are back at Step 3:

Use BCM9WCD1EVAL1 base evaluation board with BCM943362WCD4 module to interface with UART to send and receive messages. WICED evaluation board UART1 or UART2 is configured to receive data into the ring buffer. Data received from the ring buffer (Rx) is forwarded to the webpage served by the WICED evaluation board. Outgoing messages (Tx) are initiated by the webpage and sent on the UART selected.


The "#define USE_UART2_AS_SERIAL_PORT" definition controls the UART selection at compilation.

If USE_UART2_AS_SERIAL_PORT is defined then the UART2 is utilized to send and receive serial port data. If it is not defined then the UART1 is used for serial port send and receive.

In either case, the UART1 is used for displaying log messages.


1. To connect the UART2 to PC the below setup is used. Note that it is not a complete schematic.


For UART1 connection, WICED evaluation board implements the UART1 connection to PC via USB connection and drivers already located at Wiced SDK .../Drivers/BCM9WCD1EVAL1_Drivers location.


2. You need to create directory structure as shown below:


Then paste the files from the attached zip file to the corresponding directories.


3. Update .../Apps/snip/uart_rxtx/wifi_config_dct.h to be able to connect to your WiFi AP.

     #define CLIENT_AP_SSID                    "CLIENT_AP_SSID"



4. In "Make Target" window Build and download the UART sample application to the target.

     snip.uart_rxtx-BCM943362WCD4 download run


So you will now have a "Make Target" like the above picture.


5. Setup serial terminal application on PC to connect UART1 and UART2 of the WICED evaluation board.

Below is an example of TeraTerm:


Since the WicedSerial.exe serial terminal app is not setup to echo typed characters on the terminal, perhaps other terminal applications could be used with echo turned on.


6. Build, download, and run the application by double clicking "snip.uart_rxtx-BCM943362WCD4 download run" in "Make Target".


7. Below is the setup and run using the UART2 of the WICED evaluation board where USE_UART2_AS_SERIAL_PORT is defined, "#define USE_UART2_AS_SERIAL_PORT".


Hardware setup used:


Here is the user interface after sending and receiving UART2 messages via webpage.



8. Below is the setup and run using the UART1 of the WICED evaluation board where USE_UART2_AS_SERIAL_PORT is NOT defined by simply commenting it out, "//#define USE_UART2_AS_SERIAL_PORT".


Hardware setup used:


Here is the user interface after sending and receiving UART1 messages via webpage.


Use BCM9WCD1EVAL1 (P402) base evaluation board with BCM943362WCD4 module to re-purpose GPIO pins utilized for serial flash and thermistor.


1. Remove the serial flash (U8) and thermistor (TH1) from the breakaway board. The breakaway board could simply be broken, but because the push button switches and LEDs are used in this demo only some components are removed.


2. Using ULN2803A transistor array, make the connections described in the following schematics.

3. Update SDK with attached code as shown below.

Update .../include/default_wifi_config_dct.h as following or your choice of name and pass phrase.

     #define CONFIG_AP_SSID     "WICED Motor Control"

     #define CONFIG_AP_PASSPHRASE     "12345678"


4. Start the WicedSerial.exe serial port application to observe messages from WICED device.


5. Build and download the motor control sample application to the target.

     demo.motor_control-BCM943362WCD4_MTR download run


In this case the BCM943362WCD4_MTR is a new platform derived from WICED evaluation board.


6. Connect your wireless web browser supported device (PC or smart phone) to 'WICED Motor Control" with "12345678" pass phrase.


7. Using your web browser go to or directly go to to connect to your network.

8. Get the WICED board's IP address from the serial terminal and use your browser connect to WICED webpage.


Use ON/OFF to control the motors or your device connected to the re-purposed GPIO.

Use LED Brightness + and - to control LED1 (D1) and LED2 (D2) brightness on the evaluation board.

LED1 brightness could also be controlled using SW1 and SW2 on the evaluation board as well as from the remote webpage.


Here is modified evaluation board to drive DC motors.


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

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


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


Insert the following text into the eclipse.desktop file:

[Desktop Entry]











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 –”.

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

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 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:



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.




Segger J-link Plus


WiFi Module Pin


Pin 1



Pin 5



Pin 7



Pin 9



Pin 13



Pin 20



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


     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:

Copy the WicedSDK source where you like. For this example the WicedSDK is copied into the C:\MyWicedSDKs2.4.1 directory.


1. Create an eclipse workspace at C:\MyWicedSDKs2.4.1.

Select "File" -> "Switch Workspace" -> "Other..."


2. Select the directory where the WicedSDK is located.


3.Create a new “C Project” by selecting “File” -> “New” -> “C Project”.

Project type: select “Empty Project” under “Makefile project”.

Project Name: enter MyWicedSDK then select “Finish”.

4. Select MyWicedSDK on “Project Explorer” tab then select “Project” -> “Properties”.

5. Select “C/C++ Build” then deselect “Use default build command” and update “Build command” to “${workspace_loc:/MyWicedSDK}/make.exe” for Windows.

Then select “OK”.


6. Select MyWicedSDK on “Project Explorer” tab then select “Project” -> “Make Target” -> “Create…”


For “Target name” type “clean” then select “OK”.


In the "Make Target" tab, the folder icon should be selected (if it is not by default) to show the “Clean” target command under “Make Target” tab.


7. Double click on icon to run “make clean” command for MyWicedSDK project.


8. To verify everything is working, let's use step 6 from above to create a sample scan application target:

For “Target name:” instead of "clean" enter “snip.scan-BCM943362WCD4 download run”.

Connect the appropriate hardware BCM943362WCD4 to the host PC.

Double click on “snip.scan-BCM943362WCD4 download run” to build download and run the scan test application.

For versions: 2.4.0, 2.4.1 and 3.1.2


To create or edit the debug configuration click on the down arrow next to the green bug icon and select “Debug Configurations…”.


If none exist, create a new debug configuration by selecting “GDB Hardware Debugging” then selecting “New launch configuration” icon. If the debug configuration already exists, select the debug configuration you would like to update:


Select the “Main” tab and set the selections as below:

You may update the default name as you like.  In this example the name “WICED debug” is used.


Select the “Main” tab and select a project to debug if more than one project is present.


Select the “Debugger” tab and set “GDB Command” to “<Wiced Project Dir>\Tools\ARM_GNU\bin\Win32\arm-none-eabi-gdb.exe” then set the rest as below:


Select the “Startup” tab and set the selections as below:



Select the “Source” tab and set the selections as below:


Select the “Common” tab and set the selections as below:

Filter Blog

By date:
By tag: