Skip to content
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

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

Closed
tballmsft opened this issue Mar 12, 2024 · 8 comments

Comments

@tballmsft
Copy link
Contributor

tballmsft commented Mar 12, 2024

  • 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
@tballmsft
Copy link
Contributor Author

tballmsft commented Mar 12, 2024

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
Copy link
Contributor Author

tballmsft commented Mar 12, 2024

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
Copy link
Contributor Author

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
Copy link
Contributor Author

tballmsft commented Mar 12, 2024

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

@tballmsft
Copy link
Contributor Author

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

@tballmsft tballmsft assigned tballmsft and unassigned abchatra and mmoskal Mar 14, 2024
@tballmsft
Copy link
Contributor Author

See #5548

@microbit-carlos
Copy link
Collaborator

  • 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
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants