Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions samples/siwx91x_ota/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2025 Silicon Laboratories Inc.
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(siwx91x_ota)

target_sources(app PRIVATE src/main.c)
28 changes: 28 additions & 0 deletions samples/siwx91x_ota/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (c) 2025 Silicon Laboratories Inc.
# SPDX-License-Identifier: Apache-2.0

mainmenu "SiWx91x OTA Configuration"

menu "SiWx91x OTA application options"

config OTA_WIFI_SSID
string "WiFi SSID"
default "your_ssid"
help
WiFi SSID for the network to connect to.

config OTA_WIFI_PSK
string "WiFi PSK"
default "your_psk"
help
WiFi PSK (password) for the network to connect to.

config OTA_UPDATE_URL
string "OTA update URL"
default "https://example.com:443/firmware.rps"
help
The full URL for the OTA firmware update.

endmenu

source "Kconfig.zephyr"
60 changes: 60 additions & 0 deletions samples/siwx91x_ota/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Copyright (c) 2025 Silicon Laboratories Inc.
# SPDX-License-Identifier: Apache-2.0

.. zephyr:code-sample:: siwx91x_otas
:name: HTTP OTA Firmware Update on SiWx917
:relevant-api: wifi

Demonstrates HTTP/HTTPS OTA firmware update using SiWx917 on Zephyr.

Overview
********

Application demonstrates how to perform HTTP/HTTPS OTA firmware updates on the
SiWx917 platform using Zephyr RTOS. It connects to a Wi-Fi network, establishes
an HTTPS connection, and downloads firmware
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-flow the text

updates from a remote server. The application showcases secure connectivity and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

download and flash. Maybe you can mention secure boot and signature checks.

OTA update mechanisms for IoT devices.

Requirements
************

* SiWx917 development board with Wi-Fi support
* HTTP server

Configurations
**************

The following configurations can be modified in ``prj.conf``:

* Wi-Fi Settings
* ``CONFIG_OTA_WIFI_SSID`` - Network name
* ``CONFIG_OTA_WIFI_PSK`` - Network password
* ``CONFIG_OTA_UPDATE_URL`` - OTA update URL

Building and Running
********************

1. Configure required settings
2. Build and Flash

.. zephyr-app-commands::
:app: siwx917_ota
:board: siwx917_rb4338a
:goals: build flash

3. Run HTTP/HTTPS server

Test the Application
********************

1. After flashing the SiWx91x, the device will scan for the specified AP and
attempt to connect if found.
2. Once connected, the SiWx91x will initiate an HTTP/S connection to the specified
server and download the firmware binary.
3. The OTA update process will be logged to the serial console.

Note
****

This application is not for production.
47 changes: 47 additions & 0 deletions samples/siwx91x_ota/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright (c) 2025 Silicon Laboratories Inc.
# SPDX-License-Identifier: Apache-2.0

# Network Stack Configuration
CONFIG_NETWORKING=y
CONFIG_NET_TCP=y
CONFIG_NET_IPV4=y
CONFIG_NET_IPV6=y

# WiFi Configuration
CONFIG_WIFI=y
CONFIG_NET_DHCPV4=y
# Memory and Threading
CONFIG_MAIN_STACK_SIZE=4098

# Socket Support
CONFIG_REQUIRES_FULL_LIBC=y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why you required this parameter?

CONFIG_NET_SOCKETS=y

# HTTP Client Configuration
CONFIG_HTTP_CLIENT=y
CONFIG_HTTP_PARSER_URL=y

# TLS Security Configuration
CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_BUILTIN=y
CONFIG_MBEDTLS_HEAP_SIZE=60000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it required?

CONFIG_NET_SOCKETS_SOCKOPT_TLS=y
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=4096

# TLS Protocol and Cipher Configuration
CONFIG_MBEDTLS_TLS_VERSION_1_2=y
CONFIG_MBEDTLS_CIPHER_ALL_ENABLED=y
CONFIG_MBEDTLS_HASH_ALL_ENABLED=y

CONFIG_ASSERT=y

# DNS configuration
CONFIG_DNS_RESOLVER=y


## OTA Configuration
CONFIG_SIWX91X_FIRMWARE_UPGRADE=y
CONFIG_REBOOT=y

CONFIG_OTA_WIFI_SSID="<AP-SSID>"
CONFIG_OTA_WIFI_PSK="<AP-PASSWORD>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You provide samples values in Kconfig and sample values in prj.conf. We probably want to keep them in only one place. I suggest to remove default attribute in Kconfig and add a default value for OTA_UPDATE_URL in prj.conf

18 changes: 18 additions & 0 deletions samples/siwx91x_ota/sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2025 Silicon Laboratories Inc.
# SPDX-License-Identifier: Apache-2.0

sample:
name: HTTP/HTTPS OTA
description: HTTP/HTTPS OTA firmware update application for SiWx917
tests:
sample.net.http_otaf:
harness: net
platform_allow:
- siwx917_rb4338a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test also work with siwx917_rb4342a and dh2605a.
Maybe:

filter: CONFIG_SOC_FAMILY_SILABS_SIWX91X

tags:
- net
- wifi
- http
- tls
integration_platforms:
- siwx917_rb4338a
Loading
Loading