I have now tried about every serialflash library available to platformio to try and access the W25QXX128 flash chip on the Sparkfun ESP32 Micromod board. Whatever the problem the chip just reboots when accessing the begin method. It prints:
ets Jul 29 2019 12:21:46
and reboots. It would reboot whether the SPI init code was there or not. The library I am currently using is paulstoffregen/SerialFlash@0.0.0-alpha+sha.2b86eb1e43. I have also tried the Sparkfun library with the same results.
The test code is:
#include <Arduino.h>
#include <SerialFlash.h>
#include <SPI.h>
const byte W25X_SELECT = 11;
void setup()
{
Serial.begin(115200);
Serial.println("Serial flash test");
// Sparkfun ESP32 micromod
// sck - sck 6 unchanged
// miso - sdo 7
// mosi - sdi 8
// ss - swp 10
// scs - CS 11
//
SPI.begin(6, 7, 8, 10);
SPI.setFrequency(1000000);
SPI.setDataMode(SPI_MODE0);
if (SerialFlash.begin(W25X_SELECT) == false)
{
Serial.println("Unable to access flash chip");
}
else
{
Serial.println("W25Q connected");
}
}