Skip to content

Commit 1585553

Browse files
committed
ports/rp2: Move PSRAM init earlier in startup.
Try to avoid causing an upset with USB startup by detecting PSRAM as early as possible. Signed-off-by: Phil Howard <[email protected]>
1 parent e328d4c commit 1585553

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ports/rp2/main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ int main(int argc, char **argv) {
8686
SCB->SCR |= SCB_SCR_SEVONPEND_Msk;
8787
#endif
8888

89+
#if defined(MICROPY_HW_PSRAM_CS_PIN) && MICROPY_HW_ENABLE_PSRAM
90+
size_t psram_size = psram_init(MICROPY_HW_PSRAM_CS_PIN);
91+
#endif
92+
8993
pendsv_init();
9094
soft_timer_init();
9195

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

129133
#if defined(MICROPY_HW_PSRAM_CS_PIN) && MICROPY_HW_ENABLE_PSRAM
130-
size_t psram_size = psram_init(MICROPY_HW_PSRAM_CS_PIN);
131134
if (psram_size) {
132135
#if MICROPY_GC_SPLIT_HEAP
133136
gc_init(&__GcHeapStart, &__GcHeapEnd);

0 commit comments

Comments
 (0)