Skip to content

Commit 978378c

Browse files
Devika-Raju-Zjerome-pouiller
authored andcommitted
samples: siwx917_ota: http/s OTAF application
This application demonstrates the support for OTA firmware upgrade. Signed-off-by: Devika Raju <Devika.Raju@silabs.com>
1 parent aa5f5db commit 978378c

File tree

6 files changed

+735
-0
lines changed

6 files changed

+735
-0
lines changed

samples/siwx91x_ota/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2025 Silicon Laboratories Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
cmake_minimum_required(VERSION 3.20.0)
5+
6+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
7+
project(siwx91x_ota)
8+
9+
target_sources(app PRIVATE src/main.c)

samples/siwx91x_ota/Kconfig

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (c) 2025 Silicon Laboratories Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
mainmenu "SiWx91x OTA Configuration"
5+
6+
menu "SiWx91x OTA application options"
7+
8+
config OTA_WIFI_SSID
9+
string "WiFi SSID"
10+
default "your_ssid"
11+
help
12+
WiFi SSID for the network to connect to.
13+
14+
config OTA_WIFI_PSK
15+
string "WiFi PSK"
16+
default "your_psk"
17+
help
18+
WiFi PSK (password) for the network to connect to.
19+
20+
config OTA_UPDATE_URL
21+
string "OTA update URL"
22+
default "https://example.com:443/firmware.rps"
23+
help
24+
The full URL for the OTA firmware update.
25+
26+
endmenu
27+
28+
source "Kconfig.zephyr"

samples/siwx91x_ota/README.rst

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Copyright (c) 2025 Silicon Laboratories Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
.. zephyr:code-sample:: siwx91x_ota
5+
:name: HTTP OTA Firmware Update on SiWx917
6+
:relevant-api: wifi
7+
8+
Demonstrates HTTP/HTTPS OTA firmware update using SiWx917 on Zephyr.
9+
10+
Overview
11+
********
12+
13+
Application demonstrates how to perform HTTP/HTTPS OTA firmware updates on the
14+
SiWx917 platform using Zephyr RTOS. It connects to a Wi-Fi network, establishes
15+
an HTTPS connection, and downloads and flashes firmware updates from a remote
16+
server. The application showcases secure connectivity, secure boot, signature
17+
checks, and HTTP/HTTPS OTA update mechanisms for IoT devices.
18+
19+
This application supports signed images. More information about the signing
20+
process is available on :ref:`west-sign`.
21+
22+
Requirements
23+
************
24+
25+
* SiWx917 development board with Wi-Fi support
26+
* HTTP server
27+
28+
Configurations
29+
**************
30+
31+
The following configurations can be modified in ``prj.conf``:
32+
33+
* Wi-Fi Settings
34+
* ``CONFIG_OTA_WIFI_SSID`` - Network name
35+
* ``CONFIG_OTA_WIFI_PSK`` - Network password
36+
* ``CONFIG_OTA_UPDATE_URL`` - OTA update URL
37+
38+
Building and Running
39+
********************
40+
41+
1. Configure required settings
42+
2. Build and Flash
43+
44+
.. zephyr-app-commands::
45+
:app: siwx91x_ota
46+
:board: siwx917_rb4338a
47+
:goals: build flash
48+
49+
3. Run HTTP/HTTPS server
50+
51+
Test the Application
52+
********************
53+
54+
1. After flashing the SiWx91x, the device will scan for the specified AP and
55+
attempt to connect if found.
56+
2. Once connected, the SiWx91x will initiate an HTTP/S connection to the specified
57+
server and download the firmware binary.
58+
3. The OTA update process will be logged to the serial console.
59+
60+
Note
61+
****
62+
63+
This application is not for production.

samples/siwx91x_ota/prj.conf

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright (c) 2025 Silicon Laboratories Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Network Stack Configuration
5+
CONFIG_NETWORKING=y
6+
CONFIG_NET_TCP=y
7+
CONFIG_NET_IPV4=y
8+
CONFIG_NET_IPV6=y
9+
10+
# WiFi Configuration
11+
CONFIG_WIFI=y
12+
CONFIG_NET_DHCPV4=y
13+
# Memory and Threading
14+
CONFIG_MAIN_STACK_SIZE=4098
15+
16+
# Socket Support
17+
CONFIG_NET_SOCKETS=y
18+
19+
# HTTP Client Configuration
20+
CONFIG_HTTP_CLIENT=y
21+
CONFIG_HTTP_PARSER_URL=y
22+
23+
# TLS Security Configuration
24+
CONFIG_MBEDTLS=y
25+
CONFIG_MBEDTLS_BUILTIN=y
26+
CONFIG_NET_SOCKETS_SOCKOPT_TLS=y
27+
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=4096
28+
29+
# TLS Protocol and Cipher Configuration
30+
CONFIG_MBEDTLS_TLS_VERSION_1_2=y
31+
CONFIG_MBEDTLS_CIPHER_ALL_ENABLED=y
32+
CONFIG_MBEDTLS_HASH_ALL_ENABLED=y
33+
34+
CONFIG_ASSERT=y
35+
36+
# DNS configuration
37+
CONFIG_DNS_RESOLVER=y
38+
39+
CONFIG_SIWX91X_FIRMWARE_UPGRADE=y
40+
CONFIG_REBOOT=y

samples/siwx91x_ota/sample.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) 2025 Silicon Laboratories Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
sample:
5+
name: HTTP/HTTPS OTA
6+
description: HTTP/HTTPS OTA firmware update application for SiWx917
7+
tests:
8+
sample.net.http_otaf:
9+
harness: net
10+
filter: CONFIG_SOC_FAMILY_SILABS_SIWX91X
11+
tags:
12+
- net
13+
- wifi
14+
- http
15+
- tls
16+
integration_platforms:
17+
- siwx917_rb4338a

0 commit comments

Comments
 (0)