HiFive1 Rev B copy from flash to RAM

FE310 manual reads the following:

FE310-G000 fetches the first instruction out of reset from 0x1000. The instruction stored there
jumps straight to OTP at 0x2_0000, and will either enter a trap loop if the OTP is not programmed,
or start running the OTP code.

I see my application is stored at 0x2001_0f84 (freedom studio environment, Jilnk, MacOS) which belongs to external flash in memory map & I also see flash in schematics. So OTP (primary boot loader) set things up and jumps into flash. Is it right?

Further, is this XIP? (from address, it seems to be but seek confirmation)
what changes would copy my application from SPI Flash to RAM and execute from RAM?

Hi,

Your linker script file (.lds) controls the map of your code so if you are running on the Arty and building your code with metal.default.lds this will map things to SPI flash. You can alternatively use metal.scratchpad.lds to place your code into RAM. When using Freedom Studio this linker script selection is found in the Makefile like this: LINK_TARGET = default. Change this to LINK_TARGET = scratchpad and code will be placed in RAM and the debugger tools will download and start executing there.

Thanks