tinygo
tinygo copied to clipboard
Execute code from RAM, on Raspberry pi Pico
Is there currently anyway to mark a TinyGo function as executing from RAM? Something like the //go:inline directive? If not is it possible then is there any way to mark a cgo function as executing from RAM?
I've tried to mark reproduce the __no_inline_not_in_flash_func
macro used in the pico sdk, but the code doesnt seem to get put the the correct location in the elf file produced...
#define __not_in_flash(group) __attribute__((section(".time_critical." group)))
#define __not_in_flash_func(func_name) __not_in_flash(__STRING(func_name)) func_name
#define __no_inline_not_in_flash_func(func_name) __attribute__((noinline)) __not_in_flash_func(func_name)
Correct, we don't support anything like this at the moment. Perhaps we should. Here is a similar issue: https://github.com/tinygo-org/tinygo/issues/2599, and I'm sure I've seen this come up before.
Also related: https://github.com/tinygo-org/tinygo/pull/1759