Why wouldn't a crash message ""Access to PSRAM, but PSRAM not available" help?
To properly add this to CrashReport, wouldn't we need to configure the MPU to disallow access to the FlexSPI2 memory range?
While possible, one complication is we turn on the MPU pretty early in the startup process, so we can start enjoying the cache speedup. External RAM is detected much later. Code would be needed in the configure_external_ram() function do the FlexSPI2 MPU config.
If this were done somehow, then yes, it would be quite worthwhile to add more text to the CrashReport class to advise that an access violation in that range is regarding non-functional PSRAM.
And only helps when user knows : if ( CrashReport) Serial.print( CrashReport);
... especially not having useful documentation.
Yes, today few people know of CrashReport and it is (so far) only documented on a blog post and some forum conversations.
To consider connected flash memory (does it actually work with EXTMEM?? Never tried that) you can also simply declare the memory area as readonly.
EXTMEM can be used anyway only meaningfully if something is written in at some point in the beginning. So readonly is also ok.
Currently we are using EXTMEM only for RAM, and only for the 16MB range 7000,0000 to 70FF,FFFF.
Except for some very early beta test code, we're not accessing flash on FlexSPI2 as memory mapped. Flash access is always done using the FlexSPI2 "IPS Bus" path.
The 3 reasons for this design are:
1: IPS Bus allows access to 512MB, compared to only 224MB as memory mapped.
2: Memory mapped access drains away cache from actual variables
3: Writing can't be done by memory mapped access, only by IPS Bus