InfineonAIROC Wi Fi Bluetooth STM32ExpansionPack UserGuide
InfineonAIROC Wi Fi Bluetooth STM32ExpansionPack UserGuide
Document conventions
Convention Explanation
Bold Emphasizes heading levels, column headings, menus and sub-menus
Italics Denotes file names and paths.
Denotes APIs, functions, interrupt handlers, events, data types, error handlers, file/folder names,
Courier New
directories, command line inputs, code snippets
File > New Indicates that a cascading sub-menu opens when you select a menu item
1
Bluetooth® is a registered trademark owned by Bluetooth SIG Inc.
User guide Please read the "Important Notice" and "Warnings" at the end of this document 002-32903 Rev. *D
www.infineon.com 2023-08-29
AIROC™ Wi-Fi/Bluetooth® STM32 Expansion pack user guide
Table of contents
Table of contents
1 Expansion pack contents......................................................................................................... 4
1.1 Infineon-STM32 Platform Adaptation Layer (PAL) ................................................................................. 5
1.2 Supported STM32 MCUs.......................................................................................................................... 6
1.3 Supported STM32 boards ....................................................................................................................... 7
1.4 Supported connectivity modules ........................................................................................................... 7
1.5 Compatible software............................................................................................................................... 7
2 Download/install/import expansion pack ................................................................................. 8
2.1 Downloading the pack ............................................................................................................................ 8
2.2 Installing/importing the pack ................................................................................................................. 8
3 Hardware setup ....................................................................................................................13
3.1 Using STM32H747 DISCO kit ................................................................................................................. 13
3.2 Using STM32L562E-DK .......................................................................................................................... 18
3.3 Using STM32U575I-EV Evaluation board .............................................................................................. 20
3.4 Using NUCLEO-H563ZI board ............................................................................................................... 24
4 Using example projects ..........................................................................................................25
4.1 Wi-Fi Scan .............................................................................................................................................. 25
4.2 Wi-Fi onboarding with Bluetooth® LE ................................................................................................... 30
4.3 Azure RTOS NetXDuo Wi-Fi UDP echo server ....................................................................................... 34
4.4 Bluetooth® LE Hello Sensor .................................................................................................................. 35
4.5 Wi-Fi TCP keepalive offload .................................................................................................................. 39
5 Manufacture tools .................................................................................................................42
5.1 Tester - Wi-Fi Bluetooth® Console ........................................................................................................ 42
5.2 WLAN manufacturing test application (Wifi-Mfg-Tester) for FreeRTOS .............................................. 49
5.3 Bluetooth® Manufacturing Test Application for FreeRTOS ................................................................. 52
6 Special options and setup ......................................................................................................54
6.1 STM32H7xx – using serial flash ............................................................................................................. 54
6.2 STM32H7xx – using internal flash (BANK2) to store Wi-Fi FW .............................................................. 55
6.3 STM32L562 – using serial flash ............................................................................................................. 56
6.4 STM32L562 – serial flash programming ............................................................................................... 57
7 Create a new project from scratch ...........................................................................................59
7.1 Create a project for specific board ....................................................................................................... 59
7.2 Enable software components from AIROC™ Wi-Fi/Bluetooth® STM32 expansion pack ..................... 60
7.3 Enable Software pack ........................................................................................................................... 62
7.4 Country Code Configuration ................................................................................................................. 63
7.5 FreeRTOS configuration ........................................................................................................................ 64
7.6 MbedTLS configuration ......................................................................................................................... 65
7.7 Wpa3-external-suplicant....................................................................................................................... 70
7.8 Configure resources for Wi-Fi connectivity .......................................................................................... 72
7.9 Configure resources for Bluetooth® connectivity ................................................................................ 76
7.10 Heap and stack configuration............................................................................................................... 81
7.11 Generating code .................................................................................................................................... 81
Table of contents
The PAL integrates the STM32 HAL APIs underneath the Infineon HAL APIs expected by the Infineon
Connectivity Libraries. The following figure shows the architectural intent of the Infineon-STM32 PAL:
• Developers will continue to use STM32CubeMX and/or STM32 HAL APIs to configure STM32 MCU hardware.
• Developers will communicate to the PAL what STM32 hardware that they have selected and configured for
communicating with a CYW43xxx via an initialization API.
• Infineon-STM32 PAL adapts only the minimum set of Infineon HAL APIs to STM32 HAL in order to
communicate and control Infineon's CYW43xxx connectivity device(s).
• The Infineon PAL layer behaves like the Infineon HAL as much as possible to minimize impact to the
Infineon libraries. The Infineon PAL adapts the following STM32 HAL Drivers:
• GPIO
• LPTimer
• SDIO
• SPI
• TRNG
• UART
• CYW43012
• CYW43022
• CYW43439 / CYW43438 / CYW4343W
• CYW4373 / CYW4373/E
• CYW55500
• CYW55572
3. Select From Local…, navigate to the downloaded pack file, and select Open.
5. The tool shows an Infineon tab with the installed Expansion Pack displayed. Click Close.
8. In the Software Package Manager select the pack and click Install Now to start online installation.
Hardware setup
3 Hardware setup
3.1 Using STM32H747 DISCO kit
STM32H747 Disco Kit setup requires three discrete boards to create a setup where an STM32H747 hosts
Infineon's CYW43xxx connectivity device. The three boards and links are:
• STM32H747 Discovery (DISCO) Kit: The STM32H747I-DISCO Discovery kit is a complete demonstration and
development platform for STMicroelectronics STM32H747XIH6 microcontroller, designed to simplify user
application development.
• muRata uSD-M2 Adapter Kit (rev B1): muRata’s uSD-M.2 Adapter Kit with Embedded Artists’ Wi-
Fi/Bluetooth® M.2 Modules enable users with a simple plug-in solution. The Embedded Artists’ Wi-
Fi/Bluetooth® M.2 Modules are based on Murata modules using Infineon's Wi-Fi/Bluetooth® chipsets.
Current Wi-Fi/Bluetooth® EVB support include
• Murata Type 1DX M.2 (CYW4343W)
• Type 1MW (CYW43455)
• Type 1LV M.2 (CYW43012)
• Embedded Artists 1LV M.2 Module: Embedded Artists Type 1LV M.2 EVB is designed to work with the Murata
uSD-M.2 Adapter.
Hardware setup
Note: Switching STM32H747 Disco Kit to operate on 1.8 V affects the functionality of external flash
(MT25QL512ABB8ESF).
Hardware setup
Hardware setup
Hardware setup
Hardware setup
3.2.1 Set Up M.2 Module + CYW9M2ADUSD Adapter Kit for Wi-Fi and
Bluetooth® Connectivity
STM32L562E DK Kit setup for Bluetooth® connectivity requires three discrete boards to create a setup where an
STM32L562E hosts Infineon's CYW43xxx connectivity device. The three boards and links are:
• STM32L562E-DK Discovery kit is a complete demonstration and development platform for Arm® Cortex®-
M33 with Arm® TrustZone® and ARMv8-M mainline security extension core-based STM32L562QEI6QU
microcontroller, with 512 Kbytes of Flash memory and 256 Kbytes of SRAM.
• CYW9M2ADUSD Adapter Kit : adapter which allows you to connect M.2-based CYW43x connectivity modules
into SD-card slot of a various DVKs and EVKs. Please contact sales for order questions.
• Embedded Artists 1LV M.2 Module: Embedded Artists Type 1LV M.2 EVB is designed to work with the Murata
uSD-M.2 Adapter.
Hardware setup
STM32L562E-DK CYW9M2ADUSD
Connection Operation Note
Adapter
Connector STM32 GPIO
VBAT (3.3V) VCC VBAT, GND connected via microSD
CN1 P2 (uSD Connection)
GND GND connector
WL_REG_ON_HOST Wi-Fi CN4.7 PF5 J35.1 Enables/Disables WLAN core: Active High
WL_HOST_WAKE_HOST Wi-Fi CN4.1 PB13 J34.1 WLAN Host Wake: Active Low (OOB IRQ)
PC8, PC9, uSD connector pins: provides Power (VBAT,
SDIO Wi-Fi CN1 PC10, PC11, P2 (uSD Connection) GND) and WLAN-SDIO (DATA0, DATA1,
PC12, PD2 DATA2, DATA3, Clock and Command)
Enables/Disables Bluetooth® core: Active
BT_REG_ON Bluetooth CN12.5 PF4 J35.2
High
UART RX Bluetooth CN19.6 PC5 J14.2 (TX)
UART TX Bluetooth CN12.1 PB10 J14.1 (RX)
UART (USART3)
UART CTS Bluetooth CN12.3 PD11 J14.4 (RTS)
UART RTS Bluetooth CN12.4 PD12 J14.3 (CTS)
Hardware setup
• STM32U575I-EV Evaluation board: This board is a complete demonstration and development platform for
STMicroelectronics STM32U575AII6Q microcontroller, designed to simplify user application development.
• muRata uSD-M2 Adapter Kit (rev B1): muRata’s uSD-M.2 Adapter Kit with Embedded Artists’ Wi-
Fi/Bluetooth® M.2 Modules enable users with a simple plug-in solution. The Embedded Artists’ Wi-
Fi/Bluetooth® M.2 Modules are based on Murata modules using Infineon's Wi-Fi/Bluetooth® chipsets.
Current Wi-Fi/Bluetooth® EVB support include:
• Murata Type 1DX M.2 (CYW4343W)
• Type 1MW (CYW43455)
• Type 1LV M.2 (CYW43012)
• Embedded Artists 1LV M.2 Module: Embedded Artists Type 1LV M.2 EVB is designed to work with the Murata
uSD-M.2 Adapter.
Hardware setup
Note: Switching the STM32U575I-EV Evaluation board to operate on 1.8 V affects the functionality of
external flash (MT25QL512ABB8ESF) and external SRAM (IS61WV102416BLL-10MLI).
• Remove JP10
• Remove JP11
• Remove JP12
• Remove SB38 is shorted (default)
Hardware setup
Hardware setup
Hardware setup
• NUCLEO-H563ZI board: This board is a complete demonstration and development platform for
STMicroelectronics STM32U575AII6Q microcontroller, designed to simplify user application
development.Murata STM32 NUCLEO M.2 Adapter Board (LBEEOZZ2WS): This Board enables users to
connect M.2 Module to NUCLEO-H563ZI Board. The LBEEOZZ2WS board is early ES sample and will be
coming soon to be ordered.
• Embedded Artists 1LV M.2 Module: Embedded Artists Type 1LV M.2 EVB is designed to work with the Murata
uSD-M.2 Adapter.
This setup does not require any wires to be connected. The default pin mapping is described in the following
section.
Note: Ensure you set 1.8V for VDDIO (J13 must be shorted) when using only 1.8V compatible radio.
• Wi-Fi Scan
• Wi-Fi onboarding with Bluetooth® LE
• Azure RTOS NetXDuo Wi-Fi UDP echo server
• Bluetooth® LE Hello Sensor
• Wi-Fi TCP keepalive offload
4.1.1 Hardware
Refer to the section on the STM32 hardware configuration descriptions as appropriate:
• Using STM32H747 DISCO Kit
5. After the code is generated, you will see this dialog. Select Open Project.
4.1.6.1 STM32CubeIDE:
The project should build without errors. There are 10 warnings in the lwIP library.
CYW43xxx detected
WLAN MAC Address : E8:E8:B7:9F:CC:EAWLAN Firmware : wl0: Sep 9 2020 01:22:10 version 13.10.271.253
(c4c4c7c CY) FWID 01-79301becWLAN CLM : API: 18.2 Data: 9.10.0 Compiler: 1.36.1 ClmImport:
1.34.1 Creation: 2020-09-09 01:19:03 WHD VERSION : v1.93.0 : v1.93.0 : IAR 8050009 : 2020-12-21
13:24:03 +0530
----------------------------------------------------------------------------------------------------
# SSID RSSI Channel MAC Address Security
----------------------------------------------------------------------------------------------------
1 Private -72 11 1C:AF:F7:26:8D:A8 WPA2_MIXED_PSK
2 Private -73 11 74:DA:88:29:F2:27 WPA2_MIXED_PSK
----------------------------------------------------------------------------------------------------
# SSID RSSI Channel MAC Address Security
----------------------------------------------------------------------------------------------------
1 Private -68 11 74:DA:88:29:F2:27 WPA2_MIXED_PSK
2 Private -73 11 1C:AF:F7:26:8D:A8 WPA2_MIXED_PSK
Bluetooth® LE GATT Custom Service This example uses custom GATT service and characteristics to
communicate with the Bluetooth® LE GATT client. The files cycfg_gatt_db.c and cycfg_gatt_db.h contain the
GATT DB.
• Wi-Fi SSID: Provides the Wi-Fi SSID from Bluetooth® LE GATT client to the server. The maximum size is 32 as
Wi-Fi limits the SSID name to 32 characters.
• Wi-Fi Password: Provides the Wi-Fi password from the Bluetooth® LE GATT client to the server. The
minimum size is 8 because Wi-Fi encryption requires a minimum of 8 characters for password.
• Wi-Fi Connect: A Boolean characteristic that is used to connect and disconnect from the Wi-Fi AP. This has
a Client Characteristic Configuration Descriptor (CCCD) attached with it. Whenever there is a successful
connection, it will send a notification value of 1 otherwise it will send a notification value of 0 if notifications
are enabled.
4.2.1 Hardware
Refer to section the STM32 hardware configuration descriptions as appropriate:
2. Install a terminal emulator if you don't have one. Instructions in this document use Tera Term.
Once you have copied the example, you can then open it in STM32CubeMX and export to your IDE using the
steps from the Wi-Fi Scan example: Example project start/import, Generate code, Build the project.
4.2.6 Operation
1. Connect the STM32H747 DISCO Kit to your PC.
2. Use your favorite serial terminal application and connect to the ST-LINK (CN2) COM port. Configure the
terminal application to access the serial port using the following settings.
Baud rate: 115200 bps; Data: 8 bits; Parity: None; Stop: 1 bit; Flow control: None; New line for receive data:
Line Feed (LF) or Auto setting.
3. Program the board.
After programming, the application starts automatically. Observe the messages on the UART terminal, and
wait for the device to make all the required connections.
4. To test using the AIROC™ Bluetooth® Connect App mobile app, do the following:
a. Turn ON Bluetooth® on your Android or iOS device.
b. Launch the app.
c. Press the reset switch on the kit to start sending advertisements.
d. Swipe down on the app home screen to start scanning for Bluetooth® LE Peripherals. Your device
("bleProv") appears in the app home screen. Select your device to establish a Bluetooth® LE
connection.
e. Select the GATT DB Profile from the carousel view then select Unknown Service.
f. Select the attribute with the UUID ending in 63. In the ASCII field, type your Wi-Fi SSID in string format.
Do the same for password UUID ending in 64) as described above.
5. Select the attribute with the UUID ending in 65. Select Notify. Write hex value 1 to this characteristic to
connect to the Wi-Fi network. If the connection is successful, then the server will send a notification with
the value 1 or with the value 0.
Once the Wi-Fi SSID and password are provided by the client it is stored in the EEPROM. To delete this data the
user needs to press the User Button.
4.3.1 Hardware
Refer to the section on the STM32 hardware configuration descriptions as appropriate:
Once you have copied the example, you can then open it in STM32CubeMX and export to your IDE using the
steps from the Wi-Fi Scan example: Example project start/import, Generate code, Build the project.
4.3.6 Operation
1. Connect the board to your PC using the provided USB cable through the ST-Link USB connector.
2. Modify the WIFI_SSID and WIFI_PASSWORD macros in Application/User/NetXDuo/console_task.c to match
with those of the Wi-Fi network that you want to connect to.
3. Update the DEFAULT_PORT macro in Application/User/NetXDuo/console_task.c.
4. Open a terminal program and select the ST-Link COM port. Set the serial port parameters to 8N1 and
115200 baud.
5. Program the board using STM32CubeIDE or EWARM.
After programming, the application starts automatically. Observe the messages on the UART terminal, and
wait for the device to make the required connections.
6. Run the echotool utility on a windows console as following:
# echotool.exe <board IP address> /p udp /r <DEFAULT_PORT> /n 10 /d "Hello
World"
Example usage:
echotool.exe 192.168.1.2 /p udp /r 6000 /n 10 /d "Hello World"
4.4.2 Hardware
Refer to the section on the STM32 hardware configuration descriptions as appropriate:
2. Install a terminal emulator if you don't have one. Instructions in this document use Tera Term.
• Bluetooth/btstack
• Bluetooth/bluetooth-freertos
• Platform/pal
• Platform/abstraction-rtos (configured for the FreeRTOS kernel)
• Platform/device
• connectivity-utilities
• pal (minimum interface to ST HAL to enable connectivity)
Once you have copied the example, you can then open it in STM32CubeMX and export to your IDE using the
steps from the Wi-Fi Scan example: Example project start/import, Generate code, Build the project.
4.4.7 Operation
1. Connect the STM32H747 DISCO Kit to your PC.
2. Use your favorite serial terminal application and connect to the ST-LINK (CN2) COM port. Configure the
terminal application to access the serial port using the following settings.
Baud rate: 115200 bps; Data: 8 bits; Parity : None; Stop : 1 bit; Flow control : None; New line for receive
data : Line Feed(LF) or Auto setting
3. Program the board.
4. After programming, the application starts automatically. Observe the messages on the UART terminal. Use
the ST-LINK (CN2) COM port to view the Bluetooth® stack and application trace messages in the terminal
window as shown below:
[0] Hello Sensor Start
[0] wiced_bt_stack_init()
[515] bt_post_reset_cback()
[515] bt_post_reset_cback(): Change baudrate (3000000) for FW downloading
[516] bt_update_controller_baudrate(): 3000000
[521] bt_baudrate_updated_cback(): Baudrate is updated for FW downloading
[522] bt_update_platform_baudrate(): 3000000
[722] bt_start_fw_download(): FW ver = [1428] bt_patch_download_complete_cback():
status=1
[1428] bt_fw_download_complete_cback(): Reset baudrate to 115200
[1429] bt_update_platform_baudrate(): 115200
[1630] bt_fw_download_complete_cback(): Changing baudrate to 3000000
[1630] bt_update_controller_baudrate(): 3000000
[2065] bt_baudrate_updated_cback(): Baudrate is updated for feature
d. Read Battery.
4.5.1 Hardware
Refer to section the STM32 hardware configuration descriptions as appropriate:
• Using STM32H747 DISCO Kit
• Wifi/secure-sockets
• Wifi/LwIP
• Wifi/mbedtls
• Wifi/lpa
• Platform/pal (PAL, HAL, core-lib)
• Platform/abstraction-rtos (configured for the FreeRTOS kernel)
• Platform/device (configured as CYW43012)
• Platform/module(configured as MURATA-1V)
4.5.6 Operation
1. Connect the STM32H747 DISCO Kit to your PC.
2. Open app_config.h and modify the WIFI_SSID, WIFI_PASSWORD, and WIFI_SECURITY_TYPE macros to
match the Wi-Fi network credentials that you want to connect to. All possible security types are defined in
the cy_wcm_security_t structure in cy_wcm.h file.
3. Ensure that your computer is connected to the same Wi-Fi access point (AP) that you configured in Step 2
and Setup a TCP server and the server starts listening for incoming TCP connections.
4. Open a cycfg_connectivity_wifi.c and modify cy_tko_ol_cfg_0, ports, remote_port and remote_ip to
match the TCP server that be set up on your computer;
5. Use your favorite serial terminal application and connect to the ST-LINK (CN2) COM port. Configure the
terminal application to access the serial port using the following settings.
Baud rate: 115200 bps; Data: 8 bits; Parity: None; Stop: 1 bit; Flow control: None; New line for receive
data: Line Feed (LF) or Auto setting
6. Program the board.
Note: For dual cores MCU (e.g STM32H7) the both cores must be programmed.
7. After programming, the application starts automatically. Observe the messages on the UART terminal, and
wait for the device to make all the required connections. application trace messages in the terminal
window as shown:
WLAN MAC Address : 00:A0:50:45:13:81
=====================================================
WHD Stats..
tx_total:73, rx_total:74, tx_no_mem:0, rx_no_mem:0
tx_fail:0, no_credit:0, flow_control:0
Bus Stats..
cmd52:2430, cmd53_read:393, cmd53_write:596
cmd52_fail:7, cmd53_read_fail:0, cmd53_write_fail:0
oob_intrs:0, sdio_intrs:484, error_intrs:0, read_aborts:0
=====================================================
Network is active. Resuming network stack
whd_tko_toggle: Successfully disabled
whd_tko_toggle: Successfully enabled
Manufacture tools
5 Manufacture tools
The following manufacture tool projects are included in the pack:
5.1.1 Hardware
Refer to the section on the STM32 hardware configuration descriptions as appropriate:
Manufacture tools
Once you have copied the example, you can then open it in STM32CubeMX and export to your IDE using the
steps from the Wi-Fi Scan example: Example project start/import, Generate code, Build the project.
Also check in your project workspace that MCU Settings and Preprocessor are configured correctly.
Open Properties
1. Right-click on a project.
2. Select Properties
Manufacture tools
MCU Settings
1. In project Properties select C/C++ Build > Settings > MCU Settings.
2. Check Runtime library should be Reduced C, reduced C++ (--specs=nano.specs)
3. Set tick for Use float with printf and Use float with scanf
Preprocessor
1. In project Properties, select C/C++ Build > Settings > MCU GCC Compiler > Preprocessor .
2. Check if these defines exist:
• HAVE_SNPRINTF
• CY_USING_HAL
• CYBSP_WIFI_CAPABLE
• CY_STORAGE_WIFI_DATA=".whd_fw"
Manufacture tools
5.1.6 Operation
1. Connect the board to your PC using the provided USB cable through the ST-Link USB connector.
2. Modify the WIFI_SSID and WIFI_KEY macros in Application/User/Core/console_task.c to match with those
of the Wi-Fi network that you want to connect to.
4. Configure the TCP window size in iPerf before building the application. See the command console library's
README.md for instructions on how to configure the TCP window size.
5. Open a terminal program and select the ST-Link COM port. Set the serial port parameters to 8N1 and
115200 baud.
6. Program the board using STM32CubeIDE or EWARM. After programming, the application starts
automatically. Observe the messages on the UART terminal, and wait for the device to make the required
connections.
7. The application connects to the configured Wi-Fi access point (AP) and obtains the IP address. When the
device is ready, the > prompt appears.
8. Run iPerf commands (client and server) against a remote peer device.
• See Running iPerf client and server against a remote peer device.
Manufacture tools
Note: On the peer iPerf device (host PC), start iPerf as a TCP client to send the TCP data.
Manufacture tools
iperf -c <server_ip_addr> -t <time in sec>
Sample command:
iperf -c 192.168.0.100 -t 60
Note: On the peer iPerf device (host PC), start iPerf as a TCP server.
Note: On the peer iPerf device (host PC), start iPerf as a UDP client to send the UDP data.
Note: On the peer iPerf device (host PC), start iPerf as a UDP server.
Manufacture tools
5.1.9.3 Results
STM32H747 DISCO + CYW43012
Throughput, Mbit/s
TCP/ UDP Command
2.4G 5G
TCP TX 35.3 42.7 iperf -c <ip> -t 60
TCP RX 35.7 39.2 iperf -s
UDP TX 52.4 52.4 iperf -c <ip> -t 60 -u -b 50M
UDP RX 50.0 50.0 iperf -s -u
Test configuration: Iperf app run on STM32H747 CM7/400Mhz, GCC, Wi-Fi router: Asus RT-AX56U.
STM32L5-DK + CYW43012
Throughput, Mbit/s
TCP/ UPD Command
2.4G 5G
TCP TX 20.2 20.5 iperf -c <ip> -t 60
TCP RX 20.6 20.8 iperf -s
UDP TX 31.0 31.1 iperf -c <ip> -t 60 -u -b 50M
UDP RX 25.7 24.7 iperf -s -u
Test configuration: Iperf app run on STM32L5 CM33/110Mhz, GCC, Wi-Fi router: Asus RT-AX56U.
STM32U575I-EV + CYW43012
Throughput, Mbit/s
TCP/ UPD Command
2.4G 5G
TCP TX 26.5 27.4 iperf -c <ip> -t 60
TCP RX 25.3 26.1 iperf -s
UDP TX 36.5 36.6 iperf -c <ip> -t 60 -u -b 50M
UDP RX 33.8 33.9 iperf -s -u
Test configuration: Iperf app run on STM32U5 CM33/160Mhz, GCC, Wi-Fi router: Asus RT-AX56U.
Test configuration: Iperf app run on STM32H747 CM7/400Mhz, GCC, Wi-Fi router: NEC Aterm WX7800 (11ax).
Manufacture tools
Throughput, Mbit/s
TCP/ UDP Command
2.4G 5G
TCP RX 30,1 39,3 iperf -s
UDP TX 78,8 80 iperf -c <ip> -t 60 -u -b 80M
UDP RX 62,3 63,7 iperf -s -u
Test configuration: Iperf app run on STM32H747 CM7/400Mhz, GCC, Wi-Fi router: NEC Aterm WX7800 (11ax).
Test configuration: Iperf app run on STM32H747 CM7/400Mhz, GCC, Wi-Fi router: NEC Aterm WX7800 (11ax).
The wl tool binaries for testing the WLAN firmware are also included in this application repository.
This example demonstrates how an STM32H7 can be used to host CYW43xxx connectivity devices.
5.2.1 Hardware
Refer to the section on the STM32 hardware configuration descriptions as appropriate: Using STM32H747
DISCO Kit
Test setup is shown below:
Manufacture tools
Once you have copied the example, you can then open it in STM32CubeMX and export to your IDE using the
steps from the Wi-Fi Scan example: Example project start/import, Generate code, Build the project.
5.2.6 Operation
1. Go to the WL tool directory:
# cd wl-tool-bin
Manufacture tools
Manufacture tools
5.3.1 Hardware
Refer to the section on the STM32 hardware configuration descriptions as appropriate:
• Using STM32H747 DISCO Kit
Manufacture tools
Once you have copied the example, you can then open it in STM32CubeMX and export to your IDE using the
steps from the Wi-Fi Scan example: Example project start/import, Generate code, Build the project.
5.3.6 Operation
1. Go to WMBT tool directory
2. Reset the Board by pressing Reset button
3. Run the command on Windows Host for the proper BT Chip on target board.
4. Observe the output of the command
List of wmbt commands with Bluetooth® LE function which can be retrieved by typing --help Partial output
of the command and display is below.
wmbt reset COMx
Success
Close Serial Bus
2. Linker script has section name defined where Wi-Fi stack will be located during linkage:
.whd_fw :
{
__whd_fw_start = .;
KEEP(*(.whd_fw))
__whd_fw_end = .;
} > OSPI
5. Programming of the Serial Flash should be performed with appropriate Flash Loader selection:
b. Define the whd_fw section where the Wi-Fi FW will be located during linkage:
.whd_fw :
{
__whd_fw_start = .;
KEEP(*(.whd_fw))
__whd_fw_end = .;
} >WIFI_FLASH
2. Linker script has section name defined where WiFi stack will be located during linkage:
.whd_fw :
{
__whd_fw_start = .;
KEEP(*(.whd_fw))
__whd_fw_end = .;
} > OSPI
With given setup, the compiler and linker will split a resulting image into two pieces, which will reside in both –
internal and external memory of an STM32L562E-DK.
Select the external loader (see steps illustrated in the following image).
2. Select a board.
Note: Platform components are required for each type of application – either Wi-Fi-only, Bluetooth-only
or combined.
a. For the ‘Platform / device’ component, select the appropriate connectivity device for your system
(CYW43012, CYW4343W or CYW43438, etc.).
b. For the ‘Wifi / network-interface’ component, select the appropriate network interface for your system
(LwIP or NetxDuo).
c. For the ‘Wifi / wcm’ component, select the appropriate variant (WCM or WCM /WPS/MBEDTLS).
• WCM Variant compiles only Wi-Fi connection manager files, which provide a set of APIs that can be
used to establish and monitor Wi-Fi connections on Infineon platforms that support Wi-Fi
connectivity.
• WCM /WPS/MBEDTLS Variant also includes APIs to connect to a Wi-Fi network using Wi-Fi Protected
Setup (WPS) methods which uses MBED TLS security stack.
6. Click OK.
Under Tasks and Queues, configure Default task and its stack size.
Navigate to Select Components, select Middleware and then select MBEDTLS for target device and select the
Enabled check box.
Ensure that the following features and modes are enabled by performing appropriate steps:
MBEDTLS_ENTROPY_HARDWARE_ALT
MBEDTLS_AES_ROM_TABLES
MBEDTLS_CIPHER_MODE_CBC
MBEDTLS_NO_PLATFORM_ENTROPY
MBEDTLS_ENTROPY_FORCE_SHA256
MBEDTLS_AES_C
MBEDTLS_SHA256_C
Note: Set "Not defined" for unneeded modes to reduce memory consumption and eliminate unused
code.
The IP modules listed above must be enabled (Activated) from the "Security" section of STM32CubeMX
configurator.
To enable HW acceleration the following literals have to be defined for mbedTLS (should be done in
STM32CUbeMX configurator):
MBEDTLS_AES_ALT
MBEDTLS_CCM_ALT
MBEDTLS_GCM_ALT
MBEDTLS_MD5_ALT
MBEDTLS_SHA1_ALT
MBEDTLS_SHA256_ALT
MBEDTLS_ENTROPY_HARDWARE_ALT
After these steps, source files marked with *_alt suffixes (meaning "alternative", not the original mbedTLS
version) will be added into the user's project. They will provide an interface between the mbedTLS crypto
functions and its HAL HW counterpart.
The tool will add hardware_rng.c source file to the user's project.
This will provide the mbedtls_hardware_poll() implementation, which relies on the devices' HW RNG IP block.
A call to the standard STM32 HAL RNG API (HAL_RNG_GenerateRandomNumber()) will be used by the system to
fulfill the mbedTLS entropy pool.
7.7 Wpa3-external-suplicant
Library wpa3-external-suplicant supports WPA3 SAE authentication using HnP (Hunting and Pecking Method)
using RFC https://datatracker.ietf.org/doc/html/rfc7664 and H2E (Hash to Element Method) using RFC
https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-10 and following 802.11 spec 2016.
This library required mbedTLS version 2.25.0. To enable wpa3-external-suplicant supports:
Navigate to Infineon Pack's components, then Wifi and enable wpa3-external-supplicant and mbedTLS.
Navigate to Select Components, select Security and then select RNG for target device and select the Enabled
check box, and enable Activated check box.
After generating your code copy mbedtls_user_config.h folder from Infineon pack to your project directory
(e.g. CORE/Inc folder):
C:\Users\<USER>\STM32Cube\Repository\Packs\Infineon\Connectivity-
STM32\1.3.0\Middlewares\Third_Party\configs\ mbedtls_user_config.h
Add implementation for Mbedtls entropy, as shown in the following example for STM32H7 RNG:
#include "mbedtls_user_config.h"
#ifdef MBEDTLS_ENTROPY_HARDWARE_ALT
#include "main.h"
#include "string.h"
#include "stm32h7xx_hal.h"
#include "mbedtls/entropy_poll.h"
int mbedtls_hardware_poll( void *Data, unsigned char *Output, size_t Len, size_t *oLen )
{
uint32_t index;
uint32_t randomValue;
return 0;
}
#endif /*MBEDTLS_ENTROPY_HARDWARE_ALT*/
7.8.1 SDIO
SDIO is used as an interface with Infineon Connectivity devices.
The SDMMC HAL component is required for STM32 host MCU to access/control Infineon connectivity device(s).
1. Add the API call at initialization with appropriate handle passed in:
SD_HandleTypeDef SDHandle = { .Instance = SDMMC1 };
cy_rslt_t result = stm32_cypal_wifi_sdio_init(&SDHandle);
7.8.2.1 WL_REG_ON
A power pin that shuts down the device WLAN section. WL_REG_ON must be configured as output with
following parameters:
7.8.2.2 WL_HOST_WAKE
Host MCU Wake signal from WLAN section. WL_HOST_WAKE must be configured in External Interrupt mode /
EXTI with following parameters:
1. Configure in STM32CubeMX:
3. EXTI Callback handler must be overwriting in application and call stm32_cyhal_gpio_irq_handler function:
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
stm32_cyhal_gpio_irq_handler(GPIO_Pin);
}
7.9.1 UART
1. Enable UART block in STM32CubeMX > Pinout & Configuration > Connectivity.
2. Configure Mode as Asynchronous.
3. Configure Hardware Flow Control (RS232) as CTS/RTS.
4. Enable UART interrupt in NVIC Settings.
5. Add DMA for RX and TX in DMA Settings. Use default settings for RX/TX.
7.9.2 LPTIMER
1. Enable LPTIMER block in STM32CubeMX > Pinout & Configuration > Timers.
2. Configure Mode as Counts internal clock events.
3. Enable LPTIMER interrupt in NVIC Settings.
Host wake-up. Signal from the CYW43xx to the host indicating that the
CYW43xx requires attention.
• Asserted: host device must wake-up or remain awake.
• De-asserted: host device may sleep when sleep criteria are
BT_DEV_WAKE CYBSP_BT_DEVICE_WAKE met.
The polarity of this signal is software configurable and can be asserted
HIGH or LOW
Note: BT_DEV_WAKE is not used in current version of PAL.
7.9.3.1 BT_REG_ON
A power pin that shuts down the device Bluetooth® section. BT_REG_ON must be configured as output with the
following parameters:
Configuration in STM32CubeMX:
3. Update the following fields in the cybsp.h file to match the configurations done in the Configuring Control
pins section
/** These names are explicitly referenced in the support libraries */
#define CYBSP_WIFI_WL_REG_ON ***
#define CYBSP_WIFI_HOST_WAKE ***
• Enter/select the board number (STM32L4R9I-DISCO) and click on your selected board.
• Select Start Project.
3. Select Software Components from the AIROC™ Wi-Fi/Bluetooth® STM32 Expansion Pack
2. stm32_cyhal_sdio_ex.h
3. stm32_cyhal_gpio.c
Define "exti_table" based on the IRQn_Type defined in the stm32l4r9xx.h.
3. GPIO Interrupt handler must be overwriting in application and call stm32_cyhal_gpio_irq_handler function:
void HAL_GPIO_EXTI_Callback (uint16_t GPIO_Pin)
{
stm32_cyhal_gpio_irq_handler (GPIO_Pin);
}
• cyhal_sdio_bulk_transfer
• stm32_cyhal_sdio_irq_handler
2. Add Linker script with section name defining where WiFi Firmware needs to be placed:
.whd_fw :
{
__whd_fw_start = .;
KEEP(*(.whd_fw))
__whd_fw_end = .;
} > OSPI
Miscellaneous Information
9 Miscellaneous Information
9.1 Muli-Core MCU: STM32H747I-DISCO
Some MCUs (e.g. STM32H7) have multiples cores: Cortex-M7(CM7) and Cortex-M4(CM4). Although a Wi-
Fi/Bluetooth® application uses only the CM7, please make sure to build and flash the CM4 application at the
very beginning. ST Micro pre-installs demo applications on both CM7 and CM4. So, if you flash only the CM7
application, your CM7 Wi-Fi application and pre-installed CM4 demo application access to SDIO bus and Wi-Fi
application will not work correctly.
However, in some cases, code is not generated appropriately. Please apply the following workaround for such
cases.
Miscellaneous Information
Case 1
After generating a STM32CubeIDE project on STM32CubeMX, please check the include paths as follows. You
might see include paths of firmware/nvram/clm of default device in addition to selected device as follows.
Select Project > Properties > path and Symbols.
You should remove include paths of default device (43012) and keep them for selected device (43439).
Miscellaneous Information
Case 2
After generating a STM32CubeIDE project on STM32CubeMX, you might see include paths of
firmware/nvram/clm of only default device. (default =43012, selected device=4373 in the following case).
In this case, delete the entire project folder, copy the project folder again, and modify it as follows:
1. Rename <application>\STM32CubeIDE folder to <application>\STM32CubeIDE.org.
2. Select Device/Modules on STM32CubeMX.
3. Push “Generate Code” button on STM32CubeMX.
4. STM32CubeMX newly creates <application>\STM32CubeIDE folder for selected device/module.
5. Restore Linker script; Copy <application>\STM32CubeIDE.org\CM7\STM32XXXX_FLASH.ld to
<application>\STM32CubeIDE\CM7\STM32XXXX _FLASH.ld (in the case of multi-core),
or
Copy <application>\STM32CubeIDE.org\STM32XXXX _FLASH.ld to
<application>\STM32CubeIDE\STM32XXXX _FLASH.ld (in the case of single core).
6. If application uses floating point variables with printf/scanf (e.g. wifi_bt_tester), enable floating point with
printf/scanf library as follows:
Miscellaneous Information
Select Project > Properties > Settings > MCU Settings > Use float with printf/scanf.
Miscellaneous Information
• BLHS_SUPPORT
Select Project > Properties > C/C++ Build > Settings > MCU/GCC Compiler > Preprocessor.
Revision history
Revision history
Date Version Description
2021-03-25 ** Initial release.
2022-11-14 *A Updated from version 1.1.0 to version 1.2.0.
2022-12-22 *B Updated from version 1.2.0 to version 1.3.0.
2023-07-14 *C Updated to version 1.5.0.
2023-08-29 *D Updated to version 1.5.1.