STM Cortex M7 memory map
The Cortex-M hab certainly execute code from RAM, so "code space" can be RAM. In fact, the "ITCM" is a RAM block specifically designed to contain (performance-critical) code which the processor can access efficiently. Since the RAM is of course volatile, the application has to initialize it with code e.g. from flash or some other external source before executing it.