forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 3
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 the SDK XIP cache clean method #7
Open
MichaelBell
wants to merge
17
commits into
pimoroni:feature/psram
Choose a base branch
from
MichaelBell:patch-psram-cache-clean
base: feature/psram
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Use the SDK XIP cache clean method #7
MichaelBell
wants to merge
17
commits into
pimoroni:feature/psram
from
MichaelBell:patch-psram-cache-clean
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add PSRAM support with auto detection. Performs a best-effort attempt to detect attached PSRAM, configure it and *add* it to the MicroPython heap. If PSRAM is not present, should fall back to use internal RAM. Introduce two new port/board defines: * MICROPY_HW_ENABLE_PSRAM to enable PSRAM. * MICROPY_HW_PSRAM_CS_PIN to define the chip-select pin. Changes: ports/rp2/rp2_psram.c/h: Add new PSRAM module. ports/rp2/main.c: Add optional PSRAM support. ports/rp2/CMakeLists.txt: Include rp2_psram.c. ports/rp2/rp2_flash.c: Add buffered write to avoid reads from PSRAM. ports/rp2/mpconfigport.h: Enable MICROPY_GC_SPLIT_HEAP for boards that set MICROPY_HW_ENABLE_PSRAM. Co-authored-by: Kirk Benell <kirk.benell@sparkfun.com> Co-authored-by: Mike Bell <mike@mercuna.com> Signed-off-by: Phil Howard <phil@gadgetoid.com>
Signed-off-by: Phil Howard <github@gadgetoid.com>
Signed-off-by: Phil Howard <github@gadgetoid.com>
My tests found issues when PSRAM is combined with the existing RAM in a split-heap configuration. Since this option is not enabled by default on RP2 I have changed it to be optional. PSRAM will be used exclusively if MICROPY_GC_SPLIT_HEAP == 0, it will be added to RAM if MICROPY_GC_SPLIT_HEAP == 1, and the system will fall back to RAM only if it's not detected. Signed-off-by: Phil Howard <github@gadgetoid.com>
Signed-off-by: Mike Bell <mdb036@gmail.com>
Signed-off-by: Mike Bell <mdb036@gmail.com>
Signed-off-by: Mike Bell <mdb036@gmail.com>
Signed-off-by: Mike Bell <mdb036@gmail.com>
Signed-off-by: Mike Bell <mdb036@gmail.com>
Try to avoid causing an upset with USB startup by detecting PSRAM as early as possible. Signed-off-by: Phil Howard <github@gadgetoid.com>
Signed-off-by: Mike Bell <mdb036@gmail.com>
Signed-off-by: Mike Bell <mdb036@gmail.com>
Move PSRAM setup to immediately after flash timing setup. Disable interrupts while setting up PSRAM. Signed-off-by: Mike Bell <mdb036@gmail.com>
Enable split heap if PSRAM is enabled. This allows both the internal SRAM and PSRAM to be used as heap. Signed-off-by: Phil Howard <github@gadgetoid.com>
GC stack was overflowing and causing the GC to scan through the entire memory pool, which is a particularly pathological case with 8MB PSRAM. This caused noticable slowdowns during GC. This change takes the stack from 256 to 4096 bytes to avoid overflow. Co-authored-by: Kirk Benell <kirk.benell@sparkfun.com> Signed-off-by: Phil Howard <github@gadgetoid.com>
Signed-off-by: Mike Bell <mdb036@gmail.com>
Signed-off-by: Mike Bell <mdb036@gmail.com>
Gadgetoid
force-pushed
the
feature/psram
branch
from
December 19, 2024 11:59
3a7019c
to
14b3505
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR picks up the CMake and linker script changes from #6, and additionally switches to using the new pico-sdk 2.1 method for cleaning the XIP cache.