utility/spi_com.h error when compiling Marlin for Arduino mega with Ramps 1.4
trying to load Marlin 2.0.x onto Arduino Mega

I have no specific knowledge of Marlin.
For the moment, I'm ignoring the fact that it seems to be looking for STM32 files which would seem to play no role on an Arduino Mega.
I cloned the Marlin github repo and found no mention of a file &quot;MarlinSPI.h&quot; in the 2.0.x branch.  There is however a MarlinSPI.h in tag 1.1.9.1
You appear to be working with the code for the wrong version (or branch) of Marlin.