Add .ramfunc attribute to flash_with_bootloader.ld to enable keeping functions in RAM #339
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For some use cases, e.g. re-flashing the Arduino during runtime via OTA updates, it is useful to enable certain functions to be kept in RAM so that the underlying flash memory may be replaced with new firmware while the program is running. An approach to accomplishing this is to prefix function definitions with the .ramfunc attribute:
__attribute__ ((long_call, section (".ramfunc")))
However, to get this to work, we needed to add a section specifying how to handle
.ramfunc
to the relevantflash_with_bootloader.ld
for our hardware.Is this the correct entry point? If so, is this few line addition appropriate for inclusion in this repository? In this PR, I've only added the line to the
feather_m4
variant, though it could also be added for architectures.