microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
713 stars 588 forks source link

use of settings consumes more flash (V2) - need to reflect this in available flash for app #5535

Closed tballmsft closed 2 months ago

tballmsft commented 6 months ago
tballmsft commented 6 months ago

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.

tballmsft commented 6 months ago

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

tballmsft commented 6 months ago

On further reflection, it seems rather severe to take away 32k for settings. On the other hand, most micro:bit programs are tiny! Thoughts?

tballmsft commented 6 months ago

@abchatra - Do we have a set of test programs we can benchmark on?

tballmsft commented 6 months ago

@carlosperate - can you please give me a set of the largest MakeCode programs for the micro:bit.

tballmsft commented 6 months ago

See https://github.com/microsoft/pxt-microbit/issues/5548

microbit-carlos commented 6 months ago
  • 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:

@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:

abchatra commented 2 months ago

I am assuming this doesn't need to be tracked as an issue. Closing. If not let me know.