bricks/primehub/.ld: keep user script
Until the external user flash is supported, make the SPIKE Prime build work just like the others, with a small user script kept on the main flash.
MEMORY
{
/* Flash size is 1M, bootloader resides in first 32K */
- FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 992K
+ FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 960K
+ USER_FLASH (rx) : ORIGIN = 0x080F8000, LENGTH = 32K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K
}
@@ -46,6 +47,15 @@ SECTIONS
_sidata = _etext; /* This is used by the startup in order to initialize the .data section */
} >FLASH
+ .user :
+ {
+ LONG(0);
+ LONG(MPYSIZE);
+ KEEP(*(.mpy)); /* Compiled main.mpy file. This section will be dropped once external flash is enabled */
+ } >USER_FLASH
+
+ __user_flash_start = ORIGIN(USER_FLASH);
+
/* used by the startup to initialize data */
_sidata = LOADADDR(.data);
