Specialist Supplier of Crystals & Frequency Control Componentssales@mecxtal.com.cn0755-26500570
MERLIN home / Rednote / System Validation and Replacement

Quad SPI reads fail at higher speed. Change dummy cycles or the half-cycle sample shift?

A board reads a fixed pattern at low speed. At a higher XSPI clock, the first bytes are consistently displaced by half a byte. Another revision returns the right alignment but occasionally flips individual bits when hot. The controller exposes dummy cycles and sample shift. They solve different problems. Dummy cycles establish when data begins. Sample shift changes when a value is captured within the transfer. Changing both can hide one mistake behind another.

Dummy clocks belong to the command

ST's external-memory configuration and HAL type reference distinguish command dummy cycles from sampling phase. For each NOR command, consult its instruction, address, mode, wait and data phases. Determine the required wait at the current rate and in the flash's actual configuration. Flash and controller have to agree on the first data group. If the flash starts after eight clocks and the controller waits nine, a four-line SDR interface can miss the first four bits. The actual symptom depends on direction, protocol and word assembly. Use nonrepeating leading bytes to reveal a fixed shift.

Eight cycles take 160 ns at 50 MHz and 80 ns at 100 MHz. The count is unchanged but the flash gets half the time. If the flash's high-speed mode requires ten clocks, use ten and the corresponding flash configuration. A different command can include mode bits before dummy cycles. Do not combine both fields solely by counting the time between address and data. Save a phase diagram for the exact command, identifying lane count, edges and the first data group.

Sample shift moves the capture point

At 100 MHz SDR, a cycle is 10 ns. A half-cycle sample shift moves capture about 5 ns without changing the command or number of transmitted bits. That can put capture further inside the valid window, but it can also reduce margin to the next transition. Use controller and flash timing and the real trace paths. Modes using both edges, a data strobe, or another delay unit require their own timing definitions. Verify which settings the actual controller supports.

Establish command, address, mode bits and lanes at low speed. Confirm the first valid group with distinct bytes. Increase clock only within supported settings and observe whether failures are fixed in position or isolated bit errors near operating limits. A missing first group calls for reviewing the wait and turnaround phases. Correct alignment with voltage- or temperature-dependent errors points to input timing and signal quality. All-zero and all-one patterns may pass despite a floating line or displaced data.

Preserve a test across addresses and modes

Use known patterns of different lengths and starting addresses and cross a page boundary. Capture the first memory-mapped access and the first after reentering that mode. Account for caches so the application actually issues the read. Save clock, chip select, and enough I/O to identify first data. Test maximum permitted frequency and supply and temperature limits. For each approved flash, keep part number, command, dummy count, physical bus width and sampling setting. Record both where valid data begins and whether it is sampled reliably.

Compare the boot stage and the application stage on the production startup path. A bootloader may read the ID at the default speed before the application switches commands. Trigger on its first high-speed read and verify that the flash configuration matches the controller. Check the known pattern on both sides of that transition.

Also test the first read after leaving continuous-read mode. A flash that retained its previous protocol state can produce a repeatable boundary error when the controller has reverted to the normal command.

References

WeChat

MERLIN · TIMING COMPONENTS

Scan with WeChat to contact Sales

Add our WeCom contacts from your usual WeChat app.

On desktop, scan with your phone. On mobile, save the QR image and select it from your album in WeChat Scan.