It is not possible to write to Flash when the stack is located in PSRAM, and it is not possible to write PSRAM buffers into Flash when malloc can not be used.