The RP2040 on my board (Seeeduino XIAO) comes with 2MB of flash ram.
How can I store an array that is too large to fit into RAM in flash, using C and the pico sdk?
As the array exceeds a certain size, the linker throws errors like this one:
[ 0%] Linking CXX executable test.elf
/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: test.elf section `.data' will not fit in region `RAM'
/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: region RAM overflowed
/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: region `RAM' overflowed by 182056 bytes
With Arduino, I could just add PROGMEM
like so and be done with it:
const PROGMEM uint8_t samples[] = { ... }
This does however not work with the pico sdk.