Hello
Hope you are well.
It is possible to do it but we need to be careful about certain aspects.
This can be achieved through the linker files or in project properties under C/C++Build -> MCU Settings on Memory details.
You can share the flash to execute and store data but you need to execute the drivers in RAM and stop any other XiP access during such operations. So it is important to use Non-XIP mode so that after boot the code runs in RAM and the remaining space can be used for the file system.
Having a flash capable of using RWW(Read While Write) can make this easier, you might refer to this AN: Implement RWW on i.MX RT Series (nxp.com)
Best regards,
Omar