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
ports/rp2: PSRAM linker script. #6
Open
MichaelBell
wants to merge
30
commits into
pimoroni:feature/psram-and-wifi
Choose a base branch
from
MichaelBell:feature/psram-and-wifi
base: feature/psram-and-wifi
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
ports/rp2: PSRAM linker script. #6
MichaelBell
wants to merge
30
commits into
pimoroni:feature/psram-and-wifi
from
MichaelBell:feature/psram-and-wifi
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
Signed-off-by: Peter Harper <[email protected]>
Signed-off-by: Peter Harper <[email protected]>
Stop using soft timer for mp_wfe_or_timeout. Now uses the alarm pool again as issues with this code have been fixed. This resolves the "sev" issue that stops the rp2 port going idle. Change the sleep code to use the hardware timer library and alarm 2 as alarm 3 is used by the alarm pool Signed-off-by: Peter Harper <[email protected]>
As cyw43 pins might be dynamic, add a function that returns if a pin is reserved. This is used by MICROPY_HW_PIN_RESERVED Signed-off-by: Peter Harper <[email protected]>
Signed-off-by: Peter Harper <[email protected]>
This reverts commit b42bb91. Signed-off-by: Peter Harper <[email protected]>
Signed-off-by: Peter Harper <[email protected]>
The cyw43 pins used to be hardcoded and CYW43_PIN_WL_HOST_WAKE and CYW43_PIN_WL_REG_ON were in the pico_w.h board header. This has been changed so the board header just defines the "default version of the pins, e.g. CYW43_DEFAULT_PIN_WL_HOST_WAKE, CYW43_DEFAULT_PIN_WL_REG_ON etc. Set the pin values in cyw43_configport.h so cyw43-driver sees them and allow them to be changed at runtime (dynamic) if required. Signed-off-by: Peter Harper <[email protected]>
Signed-off-by: Peter Harper <[email protected]>
Support configuring wireless on arbitrary GPIO pins. e.g. import network wlan = network.WLAN(network.STA_IF, pin_on=2, pin_cs=3, pin_dat=4, pin_clock=5, div_int=3) Signed-off-by: Peter Harper <[email protected]>
When building allow the port to be configured on the command line by passing a value for CMAKE_ARGS. Signed-off-by: Peter Harper <[email protected]>
Signed-off-by: Peter Harper <[email protected]>
Signed-off-by: Peter Harper <[email protected]>
Signed-off-by: Peter Harper <[email protected]>
The "init" code can now be added to rp2_network_cyw43_make_new. Signed-off-by: Peter Harper <[email protected]>
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]>
Move PSRAM setup to immediately after flash timing setup. Disable interrupts while setting up PSRAM. Signed-off-by: Mike Bell <[email protected]>
Signed-off-by: Mike Bell <[email protected]>
For pico_w and pico2_w. This had inadvertently been removed. Signed-off-by: Peter Harper <[email protected]>
or else nothing will work! Signed-off-by: Peter Harper <[email protected]>
Gadgetoid
force-pushed
the
feature/psram-and-wifi
branch
from
November 18, 2024 09:48
47746da
to
f1ef163
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.
The main aim of this change is to expose a PSRAM data section from the linker, but (IMO) it also tidies up some things, especially only compiling the rp2_psram module in PSRAM builds.
However, this does require that the board config sets MICROPY_HW_ENABLE_PSRAM to ON in the cmake, instead of defining it to 1 in the C header, so there is some impact on existing builds.
Currently variables put in the
.psram_data
section are uninitialized, but that could potentially be fixed.Additionally, because there's now a separate linker script for the PSRAM build, the requirement for 128kB GC heap in the non-PSRAM build could potentially be re-instated, but I haven't done that here.