Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

Fixes exceptions resulting from using SPI0Command

Open mhightower83 opened this issue 1 year ago • 3 comments

Resolves exceptions occurring when using experimental::SPI0Command for flash write operations such as: Write Status Register-1, Sector Eraser, etc.

  • https://github.com/esp8266/Arduino/issues/9139#issue-2299471911

Moved PRECACHE_END to ensure Wait_SPI_Idlep and xt_wsr_ps are included in the iCache.

Added SPIUCSSETUP to give more settling time for #CS.

mhightower83 avatar May 16 '24 15:05 mhightower83

Let's put this on hold. I need to look closer at the sequence of calls used when doing write enabled by other examples. Some examples poll the status register until bit WEL is set before continuing.

mhightower83 avatar May 29 '24 20:05 mhightower83

Let's put this on hold. I need to look closer at the sequence of calls used when doing write enabled by other examples. Some examples poll the status register until bit WEL is set before continuing.

Still on hold?

Is this related to a specific flash chip? Or does this happen at random (or not so forced random) on any hardware?

mcspr avatar Jun 19 '24 21:06 mcspr

It looks ready. I haven't found any more issues.

Is this related to a specific flash chip? Or does this happen at random (or not so forced random) on any hardware?

This may be me overanalyzing and being over-cautious. The BootROM's SPI_write_enable() is consistently used to enable WEL. This appears to be the case in NONOS SDK and RTOS examples. And, that function likes to spin until the WEL bit is set. This kind of coding reminds me of some of the anomalies workarounds I have seen.

mhightower83 avatar Jun 19 '24 23:06 mhightower83