SQI: Mode 0 and 2 of half-duplex receive mode in Standard Motorola SPI (1-bit) mode not working properly

Bug

When SPI Mode 0 or 2 is selected (i.e. ‘sqi_cr0’ register bit ‘sck_phase’ = 0) in Standard Motorola SPI (1-bit) mode (i.e. the sqi_tcr register bits ‘mode’ = ‘00’) and a transfer is started in half-duplex receive mode (i.e. sqi_tcr register bit ‘start_transfer’ bit is set to ‘1’ with ‘duplex’ sqi_tcr register bits = ‘01’), later transfers could fail.

The following error could occur then:

A later Standard Motorola SPI (1-bit) send-transfer (i.e. sqi_tcr register bit ‘start_transfer’ bit is set to ‘1’ with the sqi_tcr register bits ‘mode’ = ‘00’ and ‘duplex’ sqi_tcr register bits = ‘10’ or ‘11’) could transmit invalid data or even one word too much.

The error does not occur when the SQI module is disabled after the half-duplex receive transfer.

Operations and modes that are not touched by this problem are:

  • Dual and Quad SPI mode
  • SQIROM/XiP mode
  • Mode 1 or 3 of Standard Motorola SPI (1-bit).
Workaround

This problem can be worked around by one of the following methods:

  1. Do not use the half-duplex receive mode in Standard Motorola SPI (1-bit) mode. Use the full-duplex mode and send dummy-data instead.
  2. Use SPI mode 1 or 3, if the connected device supports it.
  3. Disable and re-enable the SQI module after a half-duplex receive transfer (by using the ‘sqi_cr1’ register bit ‘sqi_en’). You must ensure that the last transfer finished before disabling the module.