-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add documentation for creation of custom firmware uf2 files #199
Conversation
There was a problem hiding this 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.
## 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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
## 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: |
There was a problem hiding this comment.
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.
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. |
There was a problem hiding this 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.
Add additional wording for the 'Freezing bytecode instead of source code' section
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! |
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.