Skip to content

pico multi booter v0.3

Pre-release
Pre-release

Choose a tag to compare

@cuu cuu released this 26 May 07:03
· 33 commits to master since this release

In this release , flash offset changed from 940k to 152k

re-complied all *mp.bin files

add Default app and Last app

In first boot up ,Default app is PicoMite , if no sd card or no firmware bin files, user can still launch PicoMite as Default app

If other bin has ran , user can launch it as the last ran app from menu [Last app] to avoid repeated flash read and write.

put all bin files into firmware folder on SD Card

changelog:

PicoMite_mp.bin

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d063c10..3deadc0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,14 +7,14 @@ set(PICOCALC true)
 # PicoMite will need to be shifted by this amount, and all references to
 # positions in flash updated to accomodate. THIS OPTION IS NOT READY YET.
 # details: https://github.com/adwuard/Picocalc_SD_Boot
-set(SDBOOT true)
+#set(SDBOOT true)
 
 # Compile for PICO 1 Board
-set(COMPILE PICO)
+#set(COMPILE PICO)
 
 # Compile for PICO 2 Board
 #set(COMPILE PICORP2350)
-#set(COMPILE WEBRP2350)
+set(COMPILE WEBRP2350)
 
 if (COMPILE STREQUAL "HDMI" OR COMPILE STREQUAL "WEBRP2350" OR COMPILE STREQUAL "HDMIUSB"  OR COMPILE STREQUAL "VGARP2350"  OR COMPILE STREQUAL "VGAUSBRP2350"  OR COMPILE STREQUAL "PICORP2350"  OR COMPILE STREQUAL "PICOUSBRP2350" )
 	set(PICO_PLATFORM rp2350)
diff --git a/configuration.h b/configuration.h
index 08b7dac..5b4e809 100644
--- a/configuration.h
+++ b/configuration.h
@@ -162,7 +162,7 @@ extern "C" {
     #ifdef rp2350
         #define HEAP_MEMORY_SIZE (288*1024) 
         #define MAXVARS             768                     // 8 + MAXVARLEN + MAXDIM * 4  (ie, 64 bytes) - these do not incl array members
-        #define FLASH_TARGET_OFFSET (920 * 1024) 
+        #define FLASH_TARGET_OFFSET (832 * 1024) 
         #define MAX_CPU     (rp2350a ? 396000 : 378000)
         #define MAXSUBFUN           512                     // each entry takes up 4 bytes
         #ifdef USBKEYBOARD
@@ -175,7 +175,7 @@ extern "C" {
     #else
         #define HEAP_MEMORY_SIZE (128*1024) 
         #define MAXVARS             512                     // 8 + MAXVARLEN + MAXDIM * 2  (ie, 56 bytes) - these do not incl array members
-        #define FLASH_TARGET_OFFSET (920 * 1024) 
+        #define FLASH_TARGET_OFFSET (832 * 1024) 
         #define MAX_CPU     420000
         #define MAXSUBFUN           256                     // each entry takes up 4 bytes
         #ifdef USBKEYBOARD
diff --git a/memmap_default_rp2040.ld b/memmap_default_rp2040.ld
index 3c5ab0c..a0e1357 100644
--- a/memmap_default_rp2040.ld
+++ b/memmap_default_rp2040.ld
@@ -1,6 +1,6 @@
 MEMORY
 {
-    FLASH(rx) : ORIGIN = 0x10000000 + 152k, LENGTH = 2048k - 152k
+    FLASH(rx) : ORIGIN = 0x10000000 + 256k, LENGTH = 2048k - 256k
     RAM(rwx) : ORIGIN =  0x20000000, LENGTH = 256k
     SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k
     SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k

mp3-player_mp.bin

apply the https://github.com/clockworkpi/PicoCalc/blob/master/Code/MP3Player/320dcf025478994c10930c5d6ffccd511d456b0a.patch
based on current code

in YAHAL_DIR
replace ${YAHAL_DIR}/cmake/boards/rpi-pico.ld with https://github.com/clockworkpi/PicoCalc/blob/master/Code/pico_multi_booter/linker_scripts/rpi-pico.ld

micropython_mp.bin

in micropython/micropython/ports/rp2

diff --git a/ports/rp2/memmap_mp_rp2040.ld b/ports/rp2/memmap_mp_rp2040.ld
index a5799cd88..29ca60f69 100644
--- a/ports/rp2/memmap_mp_rp2040.ld
+++ b/ports/rp2/memmap_mp_rp2040.ld
@@ -23,7 +23,7 @@
 
 MEMORY
 {
-    FLASH(rx) : ORIGIN = 0x10000000, LENGTH = 2048k
+    FLASH(rx) : ORIGIN = 0x10000000 + 152k, LENGTH = 2048k - 152k
     RAM(rwx) : ORIGIN =  0x20000000, LENGTH = 256k
     SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k
     SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k
@@ -42,15 +42,6 @@ SECTIONS
         __flash_binary_start = .;
     } > FLASH
 
-    .boot2 : {
-        __boot2_start__ = .;
-        KEEP (*(.boot2))
-        __boot2_end__ = .;
-    } > FLASH
-
-    ASSERT(__boot2_end__ - __boot2_start__ == 256,
-        "ERROR: Pico second stage bootloader must be 256 bytes in size")
-
     /* The second stage will always enter the image at the start of .text.
        The debugger will use the ELF entry point, which is the _entry_point
        symbol if present, otherwise defaults to start of .text.

ulisp-picocalc.mp.bin

replace ~/.arduino15/packages/rp2040/hardware/rp2040/4.4.1/lib/rp2040/memmap_default.ld
with https://github.com/clockworkpi/PicoCalc/blob/master/Code/pico_multi_booter/linker_scripts/memmap_default.ld.mp.rp2040
The version of arduino-pico may be different, just need to find the corresponding memmap_default.ld ,replace it and re-compile ulisp

mp3-player_mp.bin

Just clone https://github.com/cuu/shapones/tree/for_multi_boot, all patched