I'm using the LPL
https://github.com/lowpowerlab/spiflash library and a MoteinoM0. Flash is declared thus:
SPIFlash flash(SS_FLASHMEM, 0xEF30); //EF30 for 4mbit Windbond chip (W25X40CL)
and then flash.initialize() returns false.
Looking at it with a logic analyzer, I see chip select operating correctly. 0xAB (wakeup/reset) gets sent and flash chip puts 0x00 on MISO. The library waits for 10µs (sufficient for wakeup per chip spec) and then puts 0x9F to read the chip ID. Two problems:
1. When 0x9F is clocked out, the flash chip puts out 0x1F or 0x9F on MISO. It's ok, it's ignored. But unexpected.
2. When the 0x00 0x00 is clocked out, the flash chip fails to write an ID - the MISO line just stays low yielding 0x00 0x00 response.
Has anyone seen this behavior?