Commit a173d93
pbio/platform/build_hat: Reclaim bootloader RAM for the GC heap.
The linker script limited RAM to 240k because the Build HAT bootloader
(BHBL) uses the top 16 KiB while it loads the firmware. Once BHBL jumps
to the firmware it is no longer running, so the firmware is free to use
that RAM.
Extend RAM to 256k so the GC heap, which runs to the end of the
RAM region, gains the 16 KiB. Add a link-time ASSERT that
the loaded image (.text through .data) still ends below 0x2003C000,
since that is the part BHBL copies in while it is still using the RAM
above. The .bss section and heap may extend past that address because
the firmware zeroes .bss itself after the jump. Replace the header
comment with an explanation of the layout.
Verified on a Build HAT loaded from a Raspberry Pi 5:
micropython.mem_info() GC total 80256 -> 96256 bytes.
Firmware size: 152188 -> 152188 bytes (unchanged).
Fixes pybricks/support#24841 parent 9d2a823 commit a173d93
1 file changed
Lines changed: 19 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
5 | 17 | | |
6 | 18 | | |
7 | 19 | | |
| |||
28 | 40 | | |
29 | 41 | | |
30 | 42 | | |
31 | | - | |
| 43 | + | |
32 | 44 | | |
33 | 45 | | |
34 | 46 | | |
| |||
251 | 263 | | |
252 | 264 | | |
253 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
254 | 271 | | |
255 | 272 | | |
256 | 273 | | |
0 commit comments