-
Notifications
You must be signed in to change notification settings - Fork 23
samples: siwx917_ota: http/s OTAF application #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Devika-Raju-Z
wants to merge
1
commit into
SiliconLabsSoftware:main
Choose a base branch
from
Devika-Raju-Z:https_otaf
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+918
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
jerome-pouiller marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| source "Kconfig.zephyr" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| updates from a remote server. The application showcases secure connectivity and | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| 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. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? |
||
| 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 | ||
| CONFIG_NET_SOCKETS_SOCKOPT_TLS=y | ||
jerome-pouiller marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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>" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| tags: | ||
| - net | ||
| - wifi | ||
| - http | ||
| - tls | ||
| integration_platforms: | ||
| - siwx917_rb4338a |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.