diff options
| author | Alex Evans <715855+mmalex@users.noreply.github.com> | 2024-11-06 18:03:54 +0000 |
|---|---|---|
| committer | Alex Evans <715855+mmalex@users.noreply.github.com> | 2024-11-06 18:03:54 +0000 |
| commit | 78a4df6ca67f937cda8462d43cbd9547994b6474 (patch) | |
| tree | 9f6d56d5eb0f47606e3b13e71c1095f2b3976503 /binmaker.py | |
| parent | 7852372b15f850a46a02d1aa991215619096ad50 (diff) | |
| download | plinky-78a4df6ca67f937cda8462d43cbd9547994b6474.tar.gz | |
bump version number and update binmaker to also output a bootloader
Diffstat (limited to 'binmaker.py')
| -rw-r--r-- | binmaker.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/binmaker.py b/binmaker.py index ee98fa9..c48e572 100644 --- a/binmaker.py +++ b/binmaker.py @@ -49,6 +49,24 @@ def main(): import uf2conv uf2conv.uf2conv(uf2args) + # read 'bootloader/Release/plinkybl.bin', pad to 64k, and write it back + try: + with open("bootloader/Release/plinkybl.bin", "rb") as f1: + bl_content = f1.read() + if len(bl_content) < 65536: + bl_content += b'\xff' * (65536 - len(bl_content)) + with open("bootloader/Release/plinkybl.bin", "wb") as f1: + f1.write(bl_content) + print('padded bootloader to 64k') + except IOError as e: + print(f"Failed to open file: {e}") + exit(2) + uf2args.input='bootloader/Release/plinkybl.bin' + uf2args.base='0x20008000' + uf2args.output=f"boot{ver1}{ver2}{ver3}.uf2" + uf2conv.uf2conv(uf2args) + + if __name__ == "__main__": main() |
