Skip to content

Conversation

@fgr-17
Copy link
Contributor

@fgr-17 fgr-17 commented Nov 8, 2025

Description

Currently, the ocre containers are embedded into the final binary that's going to be flashed by converting the content of the *.wasm file into a C header file with an array, dumping all the bytes in hex format (using xxd tool).

This PRs replaces that mechanism by using some strategies (mainly intended/tested for Zephyr targets):

  • Instead of using RAM memory to store the array, put it in the flash. For that, it needs a partition for now called wasm_binary_partition

  • Instead of using a C header with an array inside, make use of objcopy to convert the .wasm file into something that can be flashed
    Also, please list any issue that this PR is intended to fix.

  • Fixes issue #

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code cleanup/refactoring
  • This change requires a documentation update
  • CI system update
  • Test Coverage update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration including the following required details.

Only tested with a single .wasm (created with the Ocre SDK) file by using the following command:

./build.sh -t z -r -f ../ocre-apps/blinky.wasm 

Test Configuration (required):

  • Host OS type, version, and arch: Docker container in macOS
  • Developer Board make & model: native_sim

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Currently, the ocre containers are embedded into the final binary that's
going to be flashed by converting the content of the `*.wasm` file into
a C header file with an array, dumping all the bytes in hex format
(using `xxd` tool).

This PRs replaces that mechanism by using some strategies (mainly
intended/tested for Zephyr targets):

- Instead of using RAM memory to store the array, put it in the flash.
  For that, it needs a partition for now called `wasm_binary_partition`
- Instead of using a C header with an array inside, make use of
  `objcopy` to convert the `.wasm` file into something that can be
  flashed
@fgr-17 fgr-17 force-pushed the froux/refactor-wasm-injection branch from a55de72 to 842a5cc Compare November 8, 2025 20:42
@fgr-17 fgr-17 changed the title [DRAFT] Refactor ocre binary generation with objcopy WIP: Refactor ocre binary generation with objcopy Nov 18, 2025
@fgr-17 fgr-17 closed this Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant