Skip to content

Commit 1b8ada9

Browse files
committed
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 b3bf84f commit 1b8ada9

File tree

6 files changed

+957
-0
lines changed

6 files changed

+957
-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_otas
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 firmware
16+
updates from a remote server. The application showcases secure connectivity and
17+
OTA update mechanisms for IoT devices.
18+
19+
Requirements
20+
************
21+
22+
* SiWx917 development board with Wi-Fi support
23+
* HTTP server
24+
25+
Configurations
26+
**************
27+
28+
The following configurations can be modified in ``prj.conf``:
29+
30+
* Wi-Fi Settings
31+
* ``CONFIG_OTA_WIFI_SSID`` - Network name
32+
* ``CONFIG_OTA_WIFI_PSK`` - Network password
33+
* ``CONFIG_OTA_UPDATE_URL`` - OTA update URL
34+
35+
.. _signed image generation:
36+
https://docs.zephyrproject.org/latest/kconfig.html#CONFIG_SIWX91X_SIGN_KEY
37+
38+
Building and Running
39+
********************
40+
41+
1. Configure required settings
42+
2. Build and Flash
43+
44+
.. zephyr-app-commands::
45+
:app: siwx917_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: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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_REQUIRES_FULL_LIBC=y
18+
CONFIG_NET_SOCKETS=y
19+
20+
# HTTP Client Configuration
21+
CONFIG_HTTP_CLIENT=y
22+
CONFIG_HTTP_PARSER_URL=y
23+
24+
# TLS Security Configuration
25+
CONFIG_MBEDTLS=y
26+
CONFIG_MBEDTLS_BUILTIN=y
27+
CONFIG_MBEDTLS_HEAP_SIZE=60000
28+
CONFIG_NET_SOCKETS_SOCKOPT_TLS=y
29+
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=4096
30+
31+
# TLS Protocol and Cipher Configuration
32+
CONFIG_MBEDTLS_TLS_VERSION_1_2=y
33+
CONFIG_MBEDTLS_CIPHER_ALL_ENABLED=y
34+
CONFIG_MBEDTLS_HASH_ALL_ENABLED=y
35+
36+
CONFIG_ASSERT=y
37+
38+
# DNS configuration
39+
CONFIG_DNS_RESOLVER=y
40+
41+
42+
## OTA Configuration
43+
CONFIG_SIWX91X_FIRMWARE_UPGRADE=y
44+
CONFIG_REBOOT=y
45+
46+
CONFIG_OTA_WIFI_SSID="<AP-SSID>"
47+
CONFIG_OTA_WIFI_PSK="<AP-PASSWORD>"

samples/siwx91x_ota/sample.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
platform_allow:
11+
- siwx917_rb4338a
12+
tags:
13+
- net
14+
- wifi
15+
- http
16+
- tls
17+
integration_platforms:
18+
- siwx917_rb4338a

0 commit comments

Comments
 (0)