[FEATURE] GSoC 2025 - Silicon Heaven Integration into the NuttX mainline
Dear NuttX community,
I created this issue to serve as a place for the reporting of progress concerning my GSoC 2025 project Firmware Upgrades over Silicon-Heaven Protocol for NXboot Demonstrated on pysimCoder (link here). I will try to post regularly about my progress.
The primary goal of this project is to develop a practical firmware updater for NuttX that leverages the NXBoot bootloader. The updater will transfer firmware over the Silicon Heaven (SHV) protocol, a remote procedure call system. Another key objective is to implement SHV support for memory-constrained devices and adapt it for integration into NuttX, making it available for any application that utilizes SHV for remote procedure calls. The firmware updater will also be integrated into the pysimCoder project—a rapid control prototyping suite capable of generating NuttX-compatible code for control applications. This integration will simplify the development workflow and make rapid control prototyping more convenient.
More details can be found in this email I sent to the NuttX mailing list.
Hello,
I am reporting on the state of the shv lib. I have taken the sources from my nx-shv-fwupdater repository and manually merged it into the main shv-libs4c repository which will be the library used in NuttX. Most of the sources originate from Michal Lenc's implementation of SHV in pysimCoder.
The first task was to divide the sources into suitable directories. The first sublibrary is called libshvchainpack which contains the low level serialization procedures. The second sublibrary is called libshvtree, the core you are expected to include in your application - it allows for the creation of the remote procedure call tree with various methods. The dependancy is Pavel Píša's ulut library as a git submodule, providing a "C-style" containers you are used to from C++ with low footprint.
The second task was to adapt the build system. Since NuttX uses Makefiles and CMake, we expect to use both systems. As I am still struggling a bit with CMake, currently the library can be built and linked against a dummy main.c file using the OMK makefiles, created and recommended to by Pavel Píša. It actually allows for very nice declarative features like in CMake while, in my opinion, being much less cryptic than CMake (currently my biggest nemesis). As the OMK build system are essentially makefiles, integrating it into NuttX should be of no hassle. Also, I introduced some abstraction in the whole library so it can be adapted to any system (linux, nuttx, my own embedded system with no os).
In next report I expect to finish the integration with the CMake build system. Also I want to make the application which was present in my nx-shv-fwupdater working. The next steps are: some cleanup, adding more communication types (currently, TCP/IP is supported but Serial could be supported, too), adding more features in compliance with the shv protocol specification, integration into NuttX.
Hello, everyone, I'm sorry for not reporting on the project not that often. But locally, I have integrated the Silicon Heaven lightweight C implementation into NuttX. The implementation of the protocol is implemented as a library (you can find more here: https://github.com/silicon-heaven/shv-libs4c/tree/dev-zdebanos). The library resides in apps/netuitils, you can have a look here: https://github.com/zdebanos/nuttx-apps/tree/nuttx-250430-samocon/netutils/libshvc.
The outcome of my project is to have a stable implementation of Silicon Heaven on memory constrained devices (which builds upon Michal Lenc's and Pavel Pisa's implementation in pysimCoder) but with enhacements, bug fixes, etc. While the implementation is still not completed, I have a working Silicon Heaven firmware uploader for NuttX, which utilizes the SHV API to send data to a flash memory, utilized by NXBoot. For that purpose, I've made a video you can have a look at, showcasing my work so far, here: https://owncloud.cesnet.cz/index.php/s/6Tl8tQDytAWWycn. The password is nuttxgsoc2025.
Thank you.
Dear NuttX community,
this is my last comment regarding the Silicon Heaven adaptation to NuttX. Soon, I'm going to create a PR that will feature two commits:
- SHV library under
apps/netutils/libshvc: only adds Make.defs and Makefile, because the whole library shall be downloaded from here: https://github.com/silicon-heaven/shv-libs4c. - Documentation regarding the SHV API and its usage in NuttX.
- An example under
apps/examplesshowcasing the application I was about to implement in pysimCoder (https://nuttx.apache.org/docs/latest/guides/pysimcoder.html) - using the SHV to send data to a flash update partition and then using NXBoot to perform firmware update. - a simpler SHV application showcasing a the node tree creation and how to use it with custom functions that are essentially callbacks into your application.
Still I'm doing to mark the PR as draft, as I have agreed with Pavel Pisa to change the Makefile (still, it needs some changes) so that the SHV's dependancy (ulut) will be included as a separate library, because now it's used as a submodule (see here: https://github.com/silicon-heaven/shv-libs4c/tree/master/submodule).
Best regards.
Created PR in apps! https://github.com/apache/nuttx-apps/pull/3170
Not really a NuttX commit, but still part of my GSoC and NuttX related: https://github.com/robertobucher/pysimCoder/pull/118
Dear NuttX maintainers, thank you for the merging of the Silicon Heaven integration in nuttx-apps. I am looking forward to NuttX international workshop, where I'll showcase the usage in NuttX. The presentation name is Using the Silicon Heaven protocol in NuttX. I am about to add documentation into the NuttX mainline.