Skip to content

Commit b1c5f3b

Browse files
committed
Add Silicon Heaven protocol adaptation into NuttX and SHV examples
This commit marks the end of my GSoC 2025 project in the NuttX section. All changes: - Silicon Heaven protocol (SHV) implementation: The library is cloned from github.com/silicon-heaven/shv-libs4c and compiled here. The library has out-of-the-box support for NuttX and possibly all posix systems. The library is compiled with CONFIG_SHV_LIBS4C_PLATFORM define set to "nuttx". The library's dependancy is Pavel Pisa's ULUT and originates from Michal Lenc's GSoC. - examples/shv-nxboot-updater: An example which constructs a SHV tree with which you can perform firmware updates using a SHV "file node". The file node wraps around NXBoot's update partition. The application also allows for NXBoot confirmation of the images. This application is to be meant used as a "background service", started before any apps, possibly using rcS. The tree is allocated as GAVL (see below). - examples/shv-test: An example which constructs a SHV tree and gives the user the ability to choose which type of construction should be used, either: - GAVL: dynamic SHV tree allocation encapsulated within an AVL tree. - GSA: dynamic SHV tree allocation encapsulated within a continuous array with binary search - GSA_STATIC: SHV tree is defined as static const, this means all the data structures are placed in .rodata. Extremely beneficial for embedded systems, as .rodata is located in flash and embedded systems usually have more flash than sram, thus reducing sram usage. The downside is that the definitions are rather tedious, but can be automated in case of some code generation (like in pysimCoder). All of it is places in a continuous array with binary search. Signed-off-by: Stepan Pressl <[email protected]>
1 parent 61e8292 commit b1c5f3b

File tree

16 files changed

+1546
-0
lines changed

16 files changed

+1546
-0
lines changed

examples/shv-nxboot-updater/Kconfig

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#
2+
# For a description of the syntax of this configuration file,
3+
# see the file kconfig-language.txt in the NuttX tools repository.
4+
#
5+
6+
menuconfig EXAMPLES_SHV_NXBOOT_UPDATER
7+
bool "Silicon Heaven Firmware updates for NXBoot"
8+
depends on NETUTILS_LIBSHVC
9+
default n
10+
---help---
11+
Enable the shv-nxboot-updater application.
12+
13+
if EXAMPLES_SHV_NXBOOT_UPDATER
14+
15+
config EXAMPLES_SHV_NXBOOT_UPDATER_PROGNAME
16+
string "shv-nxboot-updater App Name"
17+
default "shv-nxboot-updater"
18+
---help---
19+
This is the name of the program that will be used when the NSH ELF
20+
program is installed.
21+
22+
config EXAMPLES_SHV_NXBOOT_UPDATER_PRIORITY
23+
int "shv-nxboot-updater task priority"
24+
default 100
25+
26+
config EXAMPLES_SHV_NXBOOT_UPDATER_STACKSIZE
27+
int "shv-nxboot-updater task stack size"
28+
default 4096
29+
30+
endif # EXAMPLES_NX_SHV_FWUPDATER

examples/shv-nxboot-updater/Make.defs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
############################################################################
2+
# apps/examples/shv-nxboot-updater/Make.defs
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more
5+
# contributor license agreements. See the NOTICE file distributed with
6+
# this work for additional information regarding copyright ownership. The
7+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance with the
9+
# License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
############################################################################
20+
21+
ifneq ($(CONFIG_EXAMPLES_SHV_NXBOOT_UPDATER),)
22+
CONFIGURED_APPS += $(APPDIR)/examples/shv-nxboot-updater
23+
endif

examples/shv-nxboot-updater/Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
############################################################################
2+
# apps/examples/shv-nxboot-updater/Makefile
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more
5+
# contributor license agreements. See the NOTICE file distributed with
6+
# this work for additional information regarding copyright ownership. The
7+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance with the
9+
# License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
############################################################################
20+
21+
include $(APPDIR)/Make.defs
22+
23+
MODULE = $(CONFIG_EXAMPLES_SHV_NXBOOT_UPDATER)
24+
25+
PROGNAME += $(CONFIG_EXAMPLES_SHV_NXBOOT_UPDATER_PROGNAME)
26+
PRIORITY += $(CONFIG_EXAMPLES_SHV_NXBOOT_UPDATER_PRIORITY)
27+
STACKSIZE += $(CONFIG_EXAMPLES_SHV_NXBOOT_UPDATER_STACKSIZE)
28+
29+
MAINSRC += shv_nxboot_updater.c
30+
31+
include $(APPDIR)/Application.mk

0 commit comments

Comments
 (0)