Skip to content

Conversation

zdebanos
Copy link
Contributor

This commit marks the end of my GSoC 2025 project in the NuttX section.

Currently creating as a draft pull request.
I have agreed with Pavel Pisa to separate the library's dependancy named ulut from the shv-libs4c repository (located currently here https://github.com/silicon-heaven/shv-libs4c/tree/master/submodule). This will require more time for me. Also, I have discussed with Karel Koci from Elektroline a.s. about the posibilities of the exports of external libraries - something that I somehow solved in this commit: #3154.
In the end we have agreed that this should be considered as "hacking the whole Makefile system" and I should rather come up with a better solution, and thus I'm postponing it. Since I require the export for the GSoC, I'd be glad to leave it here as draft until I solve all the issues already mentioned.

I am about to add documentation into the nuttx repo, too.

Summary

Please look into the commit's verbose message :-).

Impact

Adds the Silicon Heaven protocol implementation. A framework designed to register your callbacks into your application. The callbacks are organized into nodes and the nodes can form a tree structure.

Testing

The testing was done on my custom samv7 board. In nuttx:
tools/configure.sh myboard/myconfig - configuration OK
make - downloads the shv-libs4c repo from github, and compiles OK

DISCLAIMER: in my GSoC, I was using make export. But with the solution used here (https://github.com/zdebanos/pysimCoder/tree/shv-refactor) I succesfully compiled against automatically generated source code in pysimCoder.

.method = shv_fwstable_confirm
};

static const shv_method_des_t * const shv_dev_fwstable_dmap_items[] =
Copy link
Contributor

Choose a reason for hiding this comment

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

there should also be fwStable:get method that returns true or false based on fw status.

int rid)
{
shv_unpack_data(&shv_ctx->unpack_ctx, 0, 0);
shv_send_int(shv_ctx, rid, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
shv_send_int(shv_ctx, rid, 1);
shv_send_int(shv_ctx, rid, 3);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm about to add a .app node into shv-libs4c library. After the fix, I shall remove the .app node definition.

'-i', '--image',
dest='image',
type=str,
default='update.img',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
default='update.img',
default='nuttx.nximg',

@cederom cederom moved this to In Progress in Apache NuttX GSoC Aug 31, 2025
@cederom cederom changed the title Add Silicon Heaven protocol adaptation into NuttX and SHV examples [GSoC2025] Add Silicon Heaven protocol adaptation into NuttX and SHV examples Aug 31, 2025
@zdebanos zdebanos force-pushed the gsoc2025-shv-libs4c-final branch 2 times, most recently from ad61dea to 12f3c4f Compare September 1, 2025 00:35
@zdebanos zdebanos force-pushed the gsoc2025-shv-libs4c-final branch 3 times, most recently from ae76556 to b46e8ce Compare September 1, 2025 05:13
…xamples

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]>
@zdebanos zdebanos force-pushed the gsoc2025-shv-libs4c-final branch from b46e8ce to b657b39 Compare September 1, 2025 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants