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

setting size and flash top config #10414

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from
Draft

Conversation

tballmsft
Copy link
Contributor

@tballmsft tballmsft commented Mar 7, 2025

this PR has two major changes to allow more efficient use of flash memory

  1. the ability to configure the size of the libs/settings extension via Static TypeScript (using getConfig)
  2. communication of the top of usable flash from the CODAL/C++ toolchain to MakeCode (as under different compile options to C++, we may get different top of flash)

the second part puts the top of flash (FLASH_TOP from compile) into the PXT shim table

#define PXT_SHIMS_BEGIN                                                                            \
    namespace pxt {                                                                                \
    const uintptr_t functionsAndBytecode[]                                                         \
        __attribute__((aligned(0x20))) = {0x08010801, 0x42424242, 0x08010801, 0x8de9d83e, FLASH_TOP,

This requires changes to hexfile.ts to extract FLASH_TOP from the hex file (or ELF) produced by the C++ compiler tool chain

Related PRs:

TODO:

  • make sure this works also for pxt-arcade

@tballmsft tballmsft marked this pull request as draft March 7, 2025 17:19
@tballmsft tballmsft changed the title Tball/setting size config setting size and flash top config Mar 12, 2025
@tballmsft tballmsft requested a review from mmoskal March 12, 2025 21:18
Copy link
Member

@mmoskal mmoskal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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

Successfully merging this pull request may close these issues.

2 participants