2025-02-15 06:53 AM
Good day Folks,
I am hoping you are able to shed some light on this odd XSPI clock behaviour. I have connected XSPI2 to a W25Q64 Flash in QSPI mode.
There are 'preamble' clocks present prior to the NCS being asserted. I've noticed that the number of preamble clocks depends on the frequency of the bus. The least I have seen is 150 clocks. As you can see below it's 641 clocks, prior to the NCS falling.
I am guessing the clock is used internal by the XSPI peripheral, however the 'noise' on the bus certainly is undesirable.
This prevents me from using a NCS other than the dedicated NCS pin. Other than that it looks like it creates additional delays in the XSPI transaction, with the reads maxing out about every 30us.
This is with a XSPI read being done in a while(1) loop.
The data is being correctly read when the NCS is low, expected Byte of 0x16:
When the SCK preamble clocks are present I can see the data lines (e.g. IO0 below) go high impedance and rise to the external pullup, until the NCS is asserted.
If you are able to advise on a solution to hide these preamble clocks, it would be great!
I'm assuming that they are also contributing to additional Delays in the successive XSPI reads.
I've attached a super simple project with a XSPI Read in the while(1).
Kindest regards
Solved! Go to Solution.
2025-02-17 06:27 AM - edited 2025-02-17 07:06 AM
Hello @exarian
The clock cycles SCK that you observe before the memory access phase (when NCS1 is low) correspond to the automatic calibration phase of the high-speed interface. There is a description in RM0486 Rev2, in section 28.4.19 XSPI high-speed interface and calibration. This is automatic and occurs in the following three cases:
So if you change the prescaler value between HCLK and XSPI, it is normal that you observe a varying number of clock cycles. This calibration is transparent to the user as it occurs only once (if you do not change the prescaler with XSPI_DCR2) and you cannot disable it.
Best regards
Romain,
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-02-17 06:27 AM - edited 2025-02-17 07:06 AM
Hello @exarian
The clock cycles SCK that you observe before the memory access phase (when NCS1 is low) correspond to the automatic calibration phase of the high-speed interface. There is a description in RM0486 Rev2, in section 28.4.19 XSPI high-speed interface and calibration. This is automatic and occurs in the following three cases:
So if you change the prescaler value between HCLK and XSPI, it is normal that you observe a varying number of clock cycles. This calibration is transparent to the user as it occurs only once (if you do not change the prescaler with XSPI_DCR2) and you cannot disable it.
Best regards
Romain,
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-02-17 07:03 AM
Thank you @RomainR.