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

Add documentation for creation of custom firmware uf2 files #199

Merged
merged 7 commits into from
Nov 29, 2022
Merged

Add documentation for creation of custom firmware uf2 files #199

merged 7 commits into from
Nov 29, 2022

Conversation

redoxcode
Copy link
Contributor

This PR adds documentation for creation of custom firmware uf2 files as discussed in #194. It also documents the process automated in #198 once it is merged.

Copy link
Collaborator

@awonak awonak left a comment

Choose a reason for hiding this comment

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

I added a few optional comments. Feel free to implement or ACK. Send a note when you're done and I'll merge.

software/create_custom_firmware_uf2.md Outdated Show resolved Hide resolved
software/create_custom_firmware_uf2.md Outdated Show resolved Hide resolved
Comment on lines 105 to 107
## Freezing bytecode instead of source code
By default the files from the modules dir will be frozen (included in the firmware) as python source files (.py).
To freeze the generated bytecode instead you can modefy the manifest.py file to look like this:
Copy link
Collaborator

Choose a reason for hiding this comment

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

[optional] Could you add a line or to explaining why you would want to freeze the bytecode? I was unclear what benefits this feature offers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Idk what to write. The link explains the benefits in more detail. I am not 100% sure if any performance gains are that significant for europi tho. One thing that I noticed: It is possible to extract frozen modules from a firmware uf2 again. Freezing as byte code can be used to protect the source code to some extend. However this is not that interesting for an open source software. I still would like to mention this as it caused some confusion for me. I thought I was freezing bytecode fronm the start, and just found out later, that I was not...
So let me know what you'd like to see here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If the main advantage is to protect the source code by providing binary files instead of source .py files, then I think we're safe to omit this section from the EuroPi repo since we wouldn't use this feature. Definitely a good thing for maintainers to know, but not relevant to the EuroPi audience. So the link to full documentation satisfies access to this information in that context.

fixed the issue in main.py and tidied stuff up
Comment on lines 105 to 107
## Freezing bytecode instead of source code
By default the files from the modules dir will be frozen (included in the firmware) as python source files (.py).
To freeze the generated bytecode instead you can modefy the manifest.py file to look like this:
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the main advantage is to protect the source code by providing binary files instead of source .py files, then I think we're safe to omit this section from the EuroPi repo since we wouldn't use this feature. Definitely a good thing for maintainers to know, but not relevant to the EuroPi audience. So the link to full documentation satisfies access to this information in that context.

@redoxcode
Copy link
Contributor Author

Well, that's certainly not the main point. I guess the main points are that you save the execution time where micropython would compile the python code during runtime and that you use less RAM memory.

Copy link
Collaborator

@awonak awonak left a comment

Choose a reason for hiding this comment

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

Thanks for explaining the part I was missing (binary performance vs. interpreter performance). I added some suggested language to that section that help explain this. Let's keep that section included along with whatever you'd like to take from my suggested edits.

software/create_custom_firmware_uf2.md Outdated Show resolved Hide resolved
Add additional wording for the 'Freezing bytecode instead of source code' section
@awonak
Copy link
Collaborator

awonak commented Nov 29, 2022

Thank you again for taking the time to teach us how to compile the EuroPi firmware into a uf2 binary distributable file and for adding the documentation. This is a huge step forward in simplifying the process for getting EuroPi users up and running!

@awonak awonak merged commit 84cf452 into Allen-Synthesis:main Nov 29, 2022
@redoxcode redoxcode deleted the instructions-on-firmware-creation branch November 30, 2022 09:28
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.

[Project Suggestion] Create custom firmware image that enables drag and drop setup
2 participants