From 2acf3815289b41a1347857e71cb82b937e1b8210 Mon Sep 17 00:00:00 2001 From: Lume <141330891+Kniffler@users.noreply.github.com> Date: Sun, 26 Apr 2026 18:02:50 +0100 Subject: [PATCH] Modify stack pointer validation range Updated the stack pointer validation to allow an additional 8KB for the scratch banks --- Code/pico_multi_booter/sd_boot/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/pico_multi_booter/sd_boot/main.c b/Code/pico_multi_booter/sd_boot/main.c index 6ea102d..c6a3884 100644 --- a/Code/pico_multi_booter/sd_boot/main.c +++ b/Code/pico_multi_booter/sd_boot/main.c @@ -190,7 +190,8 @@ static bool is_valid_application(uint32_t *app_location) { // Check that the initial stack pointer is within a plausible RAM region (assumed range for Pico: 0x20000000 to 0x20040000) uint32_t stack_pointer = app_location[0]; - if (stack_pointer < 0x20000000 || stack_pointer > MAX_RAM) + + if (stack_pointer < 0x20000000 || stack_pointer > MAX_RAM + 2*4*1024) // MAX_RAM + 8KB { return false; }