Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8621

SDK • Re: boot_stage2 in rp2350 vs rp2040

$
0
0
I'd like to give you a quick reply about how I fixed it. First, I did not use the PICO_EMBED_XIP_SETUP=1 option; I just jumped at the start of the binary.

So the code for RP2040 and RP2350 is as follows:

Code:

#ifdef RP2350A            __asm__ __volatile__(                "mov r0, %[start]\n"                "ldr r1, =%[vtable]\n"                "str r0, [r1]\n"                "ldmia r0, {r0, r1}\n"                "msr msp, r0\n"                "bx r1\n"                :                : [start] "r"(XIP_BASE + USBDRIVE_APP_OFFSET), [vtable] "X"(PPB_BASE + M33_VTOR_OFFSET)                :);#else            __asm__ __volatile__(                "mov r0, %[start]\n"                "ldr r1, =%[vtable]\n"                "str r0, [r1]\n"                "ldmia r0, {r0, r1}\n"                "msr msp, r0\n"                "bx r1\n"                :                : [start] "r"(XIP_BASE + USBDRIVE_APP_OFFSET + 256), [vtable] "X"(PPB_BASE + M0PLUS_VTOR_OFFSET)                :);#endif

I build two different versions, one for each architecture.

Statistics: Posted by logronoide — Fri Mar 14, 2025 11:23 am



Viewing all articles
Browse latest Browse all 8621

Trending Articles