8000 tools/boards.txt.py rewrite by mcspr · Pull Request #8595 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

tools/boards.txt.py rewrite #8595

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

Draft
wants to merge 37 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b66848e
some reworking of boards.txt.py
mcspr Feb 8, 2022
e45a85b
same names as original map
mcspr Feb 14, 2022
1883f03
Merge remote-tracking branch 'origin/master' into nosizeconf-amend
mcspr Apr 25, 2022
f5f5233
argparse, calc tests, regions
mcspr Apr 30, 2022
6ac142f
doctest prints these
mcspr Apr 30, 2022
b3e74af
invalid crc location?
mcspr Apr 30, 2022
61cdbfe
ide means app size, total size is different
mcspr Apr 30, 2022
f4d9f8e
.ld locations were wrong
mcspr Apr 30, 2022
f1b8589
more descriptive
mcspr Apr 30, 2022
27318e9
...even more descriptive
mcspr Apr 30, 2022
e8756f8
also an example of pprint
mcspr Apr 30, 2022
1028983
names
mcspr Apr 30, 2022
5040cd3
normalize paths
mcspr Apr 30, 2022
b341be9
remember 512k boards
mcspr Apr 30, 2022
bef7b9f
encoding!
mcspr Jun 7, 2022
fe2750f
KB and MB in menu entries
mcspr Jun 7, 2022
6681c40
finalize .txt and .ld generator
mcspr Jun 7, 2022
123057f
separate .json for boards, use slurpfile
mcspr Jun 7, 2022
80911f0
dashes, fix outputs
mcspr Jun 7, 2022
b705420
boards rst was not sorted
mcspr Jun 7, 2022
9228301
boards json aligned
mcspr Jun 7, 2022
92d06a0
some qol changes
mcspr Jun 8, 2022
488e2bc
names
mcspr Jun 8, 2022
30aaa9d
fix ld output
mcspr Jun 8, 2022
8fbf159
doc doc
mcspr Jun 8, 2022
a405c41
fix comment, always store cmdline
mcspr Jun 8, 2022
6f2e52b
choice-based selection of output
mcspr Jun 8, 2022
046f813
consistent quoting in code, formatting
mcspr Jun 8, 2022
71dacc8
consistent quoting
mcspr Jun 8, 2022
a00b355
extra escape
mcspr Jun 8, 2022
0e5e48d
shorter line width
mcspr Jun 8, 2022
afb4110
relax size adjustment when not even
mcspr Jun 8, 2022
a1fec47
names, only use the basename in cmdline comment
mcspr Jun 9, 2022
51cdcaf
revert to the original way template gets our boards list
mcspr Jul 13, 2022
887f681
Merge remote-tracking branch 'origin/master' into nosizeconf-amend
mcspr Jul 13, 2022
6eb9edc
formatter does not like multiline strings
mcspr Jul 13, 2022
58b7a80
words
mcspr Jul 13, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
...even more descriptive
  • Loading branch information
mcspr committed Apr 30, 2022
commit 27318e915a59203b80abca37189b946c597a6bcb
18 changes: 7 additions & 11 deletions tools/boards.txt.py
< 46A8 td id="diff-512c399e1c2f6601fd15e0dccfe0665cd7134cf4da6f763cb4e8e1096aead8b0R1849" data-line-number="1849" class="blob-num blob-num-context js-linkable-line-number js-blob-rnum">
Original file line number Diff line number Diff line change
Expand Up @@ -1828,28 +1828,24 @@ def flash_map (flash_size, fs_size = Bytes(0), name = ''):
# ref. elf2bin.py, 1st flash sector is
# - 8 bytes of header
# - bootloader until the end of the sector
bootloader_header = Region.fromStart(layout.region, Bytes(8))
bootloader = Region.after(bootloader_header, SPI_SECTOR - Bytes(8))

# 2nd flash sector starts with
# - 8 bytes of header
# - 4 bytes of crc len
# - 4 bytes of crc value
app_header = Region.after(bootloader, Bytes(8))
crc = Region.after(app_header, Bytes(4) + Bytes(4))

reserved = Region("Bootloader + CRC", bootloader_header.start, crc.end)
reserved = SPI_SECTOR + Bytes(8) + Bytes(4) + Bytes(4)
sketch = layout.add("Sketch", nearest.start - (layout.start + reserved))

sketch = Region("Sketch", layout.start + reserved.size, nearest.start)
layout.push(sketch)
layout.push(reserved)
layout.add("", Bytes(8))
layout.add("CRC", Bytes(4) + Bytes(4))
layout.add("Bootloader", SPI_SECTOR - Bytes(8))
layout.add("", Bytes(8))

assert(layout.free == 0)

ld = f'eagle.flash.{humanize_flash(flash_size)}{humanize_fs(expected_fs_size)}.ld'.lower()
menu = f'.menu.eesz.{humanize_flash(flash_size)}{humanize_fs(expected_fs_size)}'

max_upload_size = Megabytes(1) - reserved.size
max_upload_size = Megabytes(1) - reserved
if empty:
max_ota_size = empty.size
else:
Expand Down
0