I am trying to run a rust application on an Arduino R4 WiFi. There is a HAL at GitHub - atan2l/ra-hal: Renesas RA HAL, forked from https://git.sr.ht/~az1/ra-hal · GitHub, but the linker script does not appear to be verified. I'm willing to put in the work to create a functional linker script, but I've never done this before; does anyone know where I can find a reference for the memory.x file format so that I can actually know what I'm doing? Thanks in advance!
what do you mean by "verified"? do you mean the memory layout agrees with the specific hardware model?
the memory.x is a config file that is typically provided by the appication developer, and many chip or board support libraries (a.k.a. hal crates) also provides a default config for common use cases, but it can be overriden if the app needs to customize the linking process. also, tools may override the default config for their purpose, one such example is flip-link, you can read the source code to see how it works:
the memory.x file is "include"-ed from the master linker script, which is typically defined in the architecture runtime crate. I looked up ra4m1, and it is a cortex-m4 microcontroller, so the runtime crate should be cortex-m-rt, and here's its documentation about memory.x:
if you want to see the full master linker script, the source code is here. note it's a template because it needs some preprocessing work which is done in build.rs.