pxt-microbit
pxt-microbit copied to clipboard
use of settings consumes more flash (V2) - need to reflect this in available flash for app
- Context: the use of the settings feature (from pxt-common-packages) in pxt-jacdac reduces the amount of flash for the user code
- Problem: the web app and compiler are likely unaware of this, so may produce a binary (that uses settings) and overwrites the setting area in flash.
- Solution: need a way to adjust the amount of available flash in compile check for "user code too large", when settings is included in binary
There are target-specific settings for end of flash
"compile": {
"flashCodeAlign": 4096,
"flashUsableEnd": 487424,
"flashEnd": 524288
},
There is no way to override on a package basis, so we would need some special case coding somewhere for this... or we just hard code the limit, assuming settings is used.
Note that the above flashUsableEnd already is incorrect, as it doesn't reflect the memory map: https://github.com/lancaster-university/codal-microbit-v2/blob/master/docs/MemoryMap.md.
From the memory map for the V2, the flashUsableEnd is now 0x73000, which is 471,040.
Subtracting 32k for settings get us down to 0x6b000 = 438,272
On further reflection, it seems rather severe to take away 32k for settings. On the other hand, most micro:bit programs are tiny! Thoughts?
@abchatra - Do we have a set of test programs we can benchmark on?
@carlosperate - can you please give me a set of the largest MakeCode programs for the micro:bit.
See https://github.com/microsoft/pxt-microbit/issues/5548
- the use of the settings feature (from pxt-common-packages) in pxt-jacdac reduces the amount of flash for the user code
Is that the CODAL MicroBitStorage (or similar) settings.
If not, this could be also related:
- https://github.com/microsoft/pxt-microbit/issues/5403
@carlosperate - can you please give me a set of the largest MakeCode programs for the micro:bit.
I don't have anything specifically created for this purpose, mostly just encountered some examples (also from your own testing) like these:
- https://github.com/microsoft/pxt-microbit/issues/5396
- https://github.com/microsoft/pxt-microbit/issues/4788
I am assuming this doesn't need to be tracked as an issue. Closing. If not let me know.