1.
SPI Flash cannot be set to work with 80MHz clock. The flash chip is detected as GigaDevice, Manufacturer ID 0xc8 chip ID 0x6016.
QUIO and DIO modes can be selected with 40MHz and works.
If 80Mhz clock is configured, boot fails with the message:
E (83) qio_mode: Failed to set QIE bit, not enabling QIO mode (only if QUIO mode is configured)
E (102) esp_image: image at 0x1000 has invalid magic byte
E (121) boot: failed to load bootloader header!
I've checked all GigaDevice 32Mb spi falsh data sheets and the chip should work with 80MHz clock.
As a consequence, SPIRAM can also be configured only for 40MHz operation.
2.
spiram works as expected. I've measured the speed with simple memset and memcmp functions and got the following results:
Code: Select all
======= PSRAM Test =======
Allocating 2 memory buffers (2 * 1048576 bytes) with "malloc"
free heap (before alloc): 4483068
free heap (after alloc): 2385900
memset time: 270 ms; 7.407407 MB/sec
memcmp time: 200 ms; 5.000000 MB/sec
3.
Some libraries do not work if SPIRAM is enabled and malloc() can also allocate in SPI SRAM is selected with default parameters.
For example:
If using wear leveling fat fs, it fails with the message:
Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed)
If using SD Card (sdmmc library), mount fails with:
W (1616) vfs_fat_sdmmc: failed to mount card (13)
Both issues can be solved by setting Always put malloc()s smaller than this size, in bytes, in internal RAM to some larger value, for example 32768.