Skip to content
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

build: generate mnfb at build time rather than runtime #30

Closed
cfriedt opened this issue Dec 14, 2020 · 1 comment
Closed

build: generate mnfb at build time rather than runtime #30

cfriedt opened this issue Dec 14, 2020 · 1 comment
Assignees
Labels
build enhancement New feature or request
Milestone

Comments

@cfriedt
Copy link
Owner

cfriedt commented Dec 14, 2020

It was originally unclear how to generate code (from say, a binary file) and include it as a C array before.

The correct cmake function to use is here and is called generate_inc_file.

We will also need to create a function (along with a python script) to convert the flattened .dts to a .mnfs file.

Once that is done, we can convert the .mnfs to a .mnfb, and call generate_inc_file to include the binary .mnfb directly in C.

@cfriedt cfriedt added enhancement New feature or request build labels Dec 14, 2020
@cfriedt cfriedt added this to the Beta milestone Dec 14, 2020
@cfriedt cfriedt self-assigned this Dec 14, 2020
@cfriedt
Copy link
Owner Author

cfriedt commented Dec 14, 2020

Now that I'm thinking about this a bit more, it really just makes sense to evolve my fork of projectara/manifesto.

I already have a PR for an .mnfb parser here so that would get pulled in.

The manifesto repository could just be pulled in as a git submodule of this project.

The only additional code needed would be to parse the devicetree_unfixed.h that is produced by Zephyr, populate a Manifest object with it, write the string representation of the Manifest object to build/zephyr/misc/generated and then call generate_inc_file() to produce a C header with that.

cfriedt added a commit that referenced this issue Dec 29, 2020
This change adds cfriedt/manifesto as a submodule of
greybus-for-zephyr at the path scripts/manifesto/.

It removes a lot of unecessary code that was used for
assembling the manifest at runtime.

Rather than using C code and consuming microcontroller RAM
and resources at runtime, we can now link in the Greybus
Manifest into ROM as a static const unsigned char[].

Fixes #30

Signed-off-by: Christopher Friedt <[email protected]>
cfriedt added a commit that referenced this issue Dec 29, 2020
This change adds cfriedt/manifesto as a submodule of
greybus-for-zephyr at the path scripts/manifesto/.

It removes a lot of unecessary code that was used for
assembling the manifest at runtime.

Rather than using C code and consuming microcontroller RAM
and resources at runtime, we can now link in the Greybus
Manifest into ROM as a static const unsigned char[].

Fixes #30

Signed-off-by: Christopher Friedt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant