Getting Started with WiSeConnect™ SDK v3.x and STM32™ Host in NCP Mode#

This guide describes how to get started with developing an application for the SiWx91x™ chipset family using the WiSeConnect™ SDK v3.x with an STMicroelectronics STM32F411RE™ microcontroller unit (MCU) host in Network Co-Processor (NCP) mode, where the application runs on the STM32™ host and the connectivity stack runs on the SiWx91x chipset.

Note: The output images in this guide are for illustration purposes only. Details such as board names and version numbers may not exactly match the product.

Prerequisites#

Note: The hardware and software requirements in this section are specific to the example recommended with this guide in the Open an Example Project section. If you are working with a different example, refer to its README page for the hardware and software requirements. To see the README page of a specific example, click on the Go to README link next to it in the Examples page.

Software#

Note: We recommend using the latest WiSeConnect SDK version.

Hardware#

  • Wi-Fi Access Point (802.11 ax/b/g/n)

  • Silicon Labs BRD4346A - SiWx917 Wi-Fi 6 and Bluetooth LE 4MB Flash Co-Processor Radio Board (hereafter referred to as SiWx917 radio board).

  • Silicon Labs BRD8045C - Shield Adapter Board for SiWx917 Co-Processors (hereafter referred to as adapter board).

  • STMicroelectronics NUCLEO-F411RE - STM32F411RE Nucleo-64 Development Board (hereafter referred to as STM32 development board).

  • Windows PC with a USB port

  • Mini B and type C USB cables compatible with the computer's USB port (for e.g., type C to type A if the computer has a type A USB port).

Install Keil MDK#

You may setup Keil MDK in this section while waiting to receive the hardware.

Download MDK-arm, install it, and set up the development environment by referring to the instructions on the Keil website.

Update SiWx91x Connectivity Firmware#

Note: The SiWx917 connectivity firmware version is tightly coupled with the WiSeConnect 3 extension version. You must update the SiWx917 connectivity firmware when:

  • you first receive an SiWx917 shield expansion kit

  • you first receive an SiWx917 co-processor radio board, or

  • you upgrade or downgrade your github release of the WiSeConnect SDK v3.x.

  1. Clone the WiSeConnect SDK v3.x repo from github to your computer.

  2. Plug the SiWx917 radio board into the radio board connectors of the adapter board as shown for step 11 below.

  3. Make sure the UART switch on the adapter board is in the USB position.

  4. Make sure the PWR MODE switch on the adapter board is in the BUF position.

  5. Connect the USB port of the adapter board to your computer's USB port using a type C USB cable.

  6. Open the TERATERM.INI file present in the Tera Term installation path (for example, C:\Program Files (x86)\teraterm).

  7. Find the KmtLongPacket setting and update it to on if not already set.

    KmtLongPacket=on

    Note: Enabling the Transmit/Receive Extended-length Packets feature (KmtLongPacket) reduces the firmware update time from approximately 7 minutes 15 seconds to approximately 1 minute 35 seconds along with the baud rate settings described in the following steps.

  8. Set up Tera Term. The instructions for setting this up are the same as those for RS9116.

  9. Hold down the RST button on the adapter board.

  10. Hold down the ISP button on the SiWx917 radio board.

  11. Release the RST button followed by the ISP button.

    SiWx917 NCP firmware update mode

  12. Enter the characters |U while holding down the Shift button.

  13. The bootloader menu is displayed.

    BootLoader Menu

  14. Press the b key to change the baud rate of the SiWx917 UART interface.

  15. A menu of available baud rates is displayed.

  16. Press 4 to change the baud rate to 921600.

    Change Baud Rate

  17. Select "Setup > Serial port..." from the Tera Term menu.

  18. Change the Speed to 921600.

  19. Click New setting.

    Change Baud Rate

  20. The dialog will close and you will be returned to the terminal screen.

  21. Press U.

  22. The following message will be displayed: "Baud Rate was updated successfully!"

    Note: With the increased baud rate, the firmware will be flashed and loaded in approximately 1 minute 35 seconds, with a firmware file of approximately 1.6 MB.

  23. Press B to burn new firmware.

  24. A console prompt will be displayed to select the wireless image number.

  25. Press 0 to select the first image.

  26. A console prompt will be displayed to send the firmware image.

    Burn firmware image

  27. Select File > Transfer > Kermit > Send... from the Tera Term menu.

    Send firmware image

  28. Locate and select the firmware file to flash from within the connectivity_firmware sub-folder of the path where you cloned the WiSeConnect SDK v3.x github repo.

    Note: If you don't see any files in the sub-folder, select All files in the file filter field in the Browse dialog.

  29. When the update is complete, the following messages will be seen.

    917 Update Completed

    Note:

    • If the external host communicates with SiWx917 NCP through UART interface, the SiWx917 NCP shall enter into binary mode. If the firmware update is performed with the SiWx917 NCP in binary mode, the output will resemble the below image, and the "Loading done" message will not appear after flashing new firmware.

      917 Update Loading

    • To view the "Loading done" message:

      • Follow the steps 9 to 13 in this section.

      • Press U followed by 1 to exit binary mode.

        917 Exit Binary Mode

Connect the Boards to a Computer#

  1. Plug the SiWx917 radio board into the radio board connectors of the adapter board as shown below.

    Connect 917 Radio Board

  2. Connect the adapter board to the CN6, CN5, and CN9 headers of the STM32 development board.

  3. Connect the STM32 development board to your computer using a mini B USB cable.

    Setup Connections

Note: The following table describes the connections between the adapter board (BRD8045C) and STM32 development board:

Signal Name

STM32 Pin Number

BRD8045C Pin Number

Description

5V Power Supply

CN6.5

P102.5

Power supply from STM32 to BRD8045C

3V3 Power Supply

CN6.4

P102.4

Power supply from STM32 to BRD8045C

GND

CN6.6

P102.6

Ground connection

SPI Clock

CN5.6 / PA5

P101.6

SPI connection - clock synchronization

SPI MISO

CN5.5 / PA6

P101.5

SPI connection - data transfer from SiWx917 to STM32

SPI MOSI

CN5.4 / PA7

P101.4

SPI connection - data transfer from STM32 to SiWx917

SPI CS

CN5.3 / PB6

P101.3

SPI connection - client selection

Reset

CN5.2 / PC7

P101.2

STM32 uses this to reset the SiWx917

GPIO Interrupt

CN5.1 / PA9

P101.1

SiWx917 uses this to initiate data transfer to STM32

Sleep / Wake Indication

CN9.5 / PB5

P103.5

SiWx917 uses this to indicate sleep / wake state to STM32

Sleep / Wake Request

CN9.3 / PA10

P103.3

STM32 uses this to send sleep / wake requests to SiWx917

Note: The PWR MODE switch on the adapter board supports the following modes of powering up the SiWx917 chipset:

  • HOST position: When the switch is in this position, the SiWx917 chip draws current from the 3.3V source of the STM32 development board without the intervention of the adapter board's voltage buffer.

  • BUF position (default): When the switch is in this position, the voltage buffer of the adapter board draws current from the 5V source of the STM32 development board, converts it to 3.3V, and supplies it to the SiWx917 chip.

Open an Example Project#

Note: Before opening an example project, clone the WiSeConnect SDK v3.x github repo if not already done.

  1. Open the Keil µVision integrated development environment (IDE) tool.

  2. Select Project > Open Project... from the menu.

    Open a Project

  3. Navigate to the path where you cloned the WiSeConnect SDK v3.x github repo.

  4. Navigate to the keil_project sub-folder of an STM32 example available with the WiSeConnect SDK v3.x.

    Note: See the STM32 Host column in the Examples page to find an STM32 example, then click on the GO to README link next to it. The keil_project folder will be in the same location as the README page.

    Note: We recommend using the Wi-Fi - Throughput example with this guide.

  5. Select the .uvprojx file in the folder and click Open.

    Select Project

Configure an Application#

Configure the settings for your example. For Wi-Fi - Throughput (the recommended example for this guide), see the Application Build Environment section in the README page for configuration instructions.

Build an Application#

To build an application, select Project > Build Target from the menu or alternatively, click the Build button in the toolbar.

Build the application

Flash an Application#

  1. Open Tera Term on your computer and connect the serial COM port of the STM32 development board to your computer's USB port.

  2. Click the Download code to flash memory button on the toolbar.

    Flash the application

  3. The application output will be displayed in the Tera Term window.

  4. For Wi-Fi - Throughput (the recommended example for this guide), refer to the Test the Application section of the README page to explore its output. The other sections of the README like the Purpose/Scope section and Overview section (not present in some README's) provide more information about the example.

Note: See the Examples page to explore all available examples and view their README pages.

Debug an Application#

  1. Select Debug > Start/Stop Debug Session from the menu.

    • You may also click the Start/Stop Debug Session button in the toolbar.

    Debug the application

  2. The Keil µVision IDE switches to the Debug perspective and the execution halts at the main() function in the application.

  3. Click the Run button in the toolbar.

    Debug mode

  4. You may halt the execution at desired lines of code in the application by setting a breakpoint. See the Keil µVision User Guide.