Use the SDK XIP cache clean method#7
Open
MichaelBell wants to merge 17 commits intopimoroni:feature/psramfrom
Open
Use the SDK XIP cache clean method#7MichaelBell wants to merge 17 commits intopimoroni:feature/psramfrom
MichaelBell wants to merge 17 commits intopimoroni:feature/psramfrom
Conversation
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 <[email protected]> Co-authored-by: Mike Bell <[email protected]> Signed-off-by: Phil Howard <[email protected]>
Signed-off-by: Phil Howard <[email protected]>
Signed-off-by: Phil Howard <[email protected]>
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 <[email protected]>
Signed-off-by: Mike Bell <[email protected]>
Signed-off-by: Mike Bell <[email protected]>
Signed-off-by: Mike Bell <[email protected]>
Signed-off-by: Mike Bell <[email protected]>
Signed-off-by: Mike Bell <[email protected]>
Try to avoid causing an upset with USB startup by detecting PSRAM as early as possible. Signed-off-by: Phil Howard <[email protected]>
Signed-off-by: Mike Bell <[email protected]>
Signed-off-by: Mike Bell <[email protected]>
Move PSRAM setup to immediately after flash timing setup. Disable interrupts while setting up PSRAM. Signed-off-by: Mike Bell <[email protected]>
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 <[email protected]>
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 <[email protected]> Signed-off-by: Phil Howard <[email protected]>
Signed-off-by: Mike Bell <[email protected]>
Signed-off-by: Mike Bell <[email protected]>
3a7019c to
14b3505
Compare
14b3505 to
bc76694
Compare
c1953a2 to
293d17e
Compare
9cb4d12 to
afdb324
Compare
7441621 to
bc2fb20
Compare
This file contains hidden or 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
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.