Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8609

General • Re: How can i put a file .h in another section of memory? rp2040

$
0
0
That's surprising. Putting const in front of every large array was supposed to keep them in flash.
Try static const instead of just const.

Or use:
4.5.16.4.12. __in_flash
#define __in_flash(group) __attribute__((section(".flashdata." group)))
Section attribute macro for placement in flash even in a COPY_TO_RAM binary.
For example a uint32_t variable explicitly placed in flash (it will hard fault if you attempt to write it!)

Code:

uint32_t __in_flash("my_group_name") foo = 23;
The section attribute is .flashdata.<group>
Parameters
group a string suffix to use in the section name to distinguish groups that can be linker garbage-collected
independently
I'll try the first :D

Statistics: Posted by Xiran64 — Sun May 25, 2025 12:33 am



Viewing all articles
Browse latest Browse all 8609

Trending Articles