-
-
Notifications
You must be signed in to change notification settings - Fork 17
Add script to generate json containing information to run fwuploader tool #38
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
Conversation
generator/generator.py
Outdated
|
||
|
||
# Generate and copy all firmware binary data for specified board | ||
def create_firmware_data(simple_fqbn, binary, module, version): |
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.
def create_firmware_data(simple_fqbn, binary, module, version): | |
def create_firmware_data(binary, module, version): |
not used
generator/generator.py
Outdated
for l in boards_txt: | ||
board_id = fqbn.split(":")[2] | ||
if l.startswith(f"{board_id}.upload"): | ||
(k, v) = l.strip().split("=", maxsplit=1) | ||
k = ".".join(k.split(".", maxsplit=1)[1:]) | ||
board_upload_data[k] = v |
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.
Maybe this and code L98-102 could be put in a function since is basically the same code?
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.
LGTM 🚗
The
generator.py
script creates aboard_index.json
file that will be used by the FirmwareUploader tool to gather all the information necessary to run correctly, list of firmwares for each supported board, upload command to run, binary to loader Sketch. It also copies the necessary firmware and loader Sketch binaries in structured folders ready to be uploaded in the download server.As of now it uses a
raw_board.json
file that has been created using some information obtained using the--get_available_for
flag that returns all available firmware for all each supported board.In the future we can use the
board_index.json
currently in use as a base and add new information if necessary.The script assumes the Arduino CLI is installed and all supported boards' core too, it fails in case neither is found.
The script can be easily run like this:
It must be run inside the
generator
folder where theraw_boards.json
file is stored. All generated folders and files will be saved in that same folder.