Skip to content

Commit

Permalink
ports/rp2: Move PSRAM init earlier in startup.
Browse files Browse the repository at this point in the history
Try to avoid causing an upset with USB startup by
detecting PSRAM as early as possible.

Signed-off-by: Phil Howard <[email protected]>
  • Loading branch information
Gadgetoid committed Oct 23, 2024
1 parent e328d4c commit 1585553
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ports/rp2/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ int main(int argc, char **argv) {
SCB->SCR |= SCB_SCR_SEVONPEND_Msk;
#endif

#if defined(MICROPY_HW_PSRAM_CS_PIN) && MICROPY_HW_ENABLE_PSRAM
size_t psram_size = psram_init(MICROPY_HW_PSRAM_CS_PIN);
#endif

pendsv_init();
soft_timer_init();

Expand Down Expand Up @@ -127,7 +131,6 @@ int main(int argc, char **argv) {
mp_cstack_init_with_top(&__StackTop, &__StackTop - &__StackBottom);

#if defined(MICROPY_HW_PSRAM_CS_PIN) && MICROPY_HW_ENABLE_PSRAM
size_t psram_size = psram_init(MICROPY_HW_PSRAM_CS_PIN);
if (psram_size) {
#if MICROPY_GC_SPLIT_HEAP
gc_init(&__GcHeapStart, &__GcHeapEnd);
Expand Down

0 comments on commit 1585553

Please sign in to comment.