Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

picosystem SDK uses default pico SDK memory map #54

Closed
og-syn opened this issue Oct 29, 2021 · 1 comment · Fixed by #55
Closed

picosystem SDK uses default pico SDK memory map #54

og-syn opened this issue Oct 29, 2021 · 1 comment · Fixed by #55
Labels
bug Something isn't working

Comments

@og-syn
Copy link

og-syn commented Oct 29, 2021

(At least) when installed according to instructions, the picosystem SDK builds using the default pico SDK memory map (pico-sdk/src/rp2_common/pico_standard_link/memmap_default.ld).

This specifies 2k of flash:

 MEMORY
 {
    FLASH(rx) : ORIGIN = 0x10000000, LENGTH = 2048k

This limits the .rodata section of ELF files to 2M of memory. This limitation seems to come from the standard Pi Pico. However, Picosystems have a 16 MB flash memory which can hold much more. Bumping up the length to e.g. 8192k (or more, up to 16384k I guess) allows building much larger projects.

This is especially important when #include'ing bitmaps, sprites or similar. It would be super nice if the picosystem SDK shipped with a custom memory map which fixes this problem.

Tested: up to 8192k seems to be working just fine. ELF files with e.g. ~3.8 MB of .rodata usage just work after the flash length is edited to accommodate.

Workarounds: I suppose it's possible, though much less convenient, to manually attach binary data at the end of a UF2 file (or directly on the device) with picotool or equivalent.

@Gadgetoid Gadgetoid added the bug Something isn't working label Oct 29, 2021
@Gadgetoid
Copy link
Member

I thought building with "-DPICO_BOARD=pimoroni_picosystem" would handle this.

Looks like we have to ship our own linker script and use pico_set_linker_script:

https://github.com/raspberrypi/pico-sdk/blob/bfcbefafc5d2a210551a4d9d80b4303d4ae0adf7/src/rp2_common/pico_standard_link/CMakeLists.txt#L35-L39

Gadgetoid added a commit that referenced this issue Oct 29, 2021
Allow PicoSystem SDK applications to use 12MiB of the 12MiB flash. 4MiB reserved for FAT (32blit SDK only).
Gadgetoid added a commit that referenced this issue Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants