2023-07-09 10:19 PM
Dear Community,
for my application I use the STM32H723VGTx where I'm using the OSPI interface as a SPI and QSPI to control a external sensor (MCU SPI master, sensor SPI slave). Now I face some issues with this communication interface, for debugging reasons I did some logic analyzer measurement, which I've attach to this post.
The problem is that while reading the sensor registers in QSPI mode the CLK (green signal) of the STM32 has some breaks like you can see in the following screenshots.
This behavior is shown only for larger reading operations, like you can see for a shorter reading operation in the following screenshot. But here I have also a question: why is there this last Low -> High -> Low change for the DIO3 shortly after CSN (red) is went HIGH again?
In single line SPI mode there are no such problem with the CLK, here the CLK is running without breaks while CSN is Low like you can see in this screenshot:
The interface settings are like this:
2023-07-10 04:12 AM
Without attempting to gain deeper understanding, isn't it simply the case that the processor can't read out data from QSPI fast enough to keep the clock continuous?
JW
2023-07-12 06:40 AM
Hello JW,
thank you for your anwser!
I've tested my code with a lower CLK frequency (<20 MHz) and now I get a continuous CLK!
Now I have a question based on this, I made further tests where i use these QSPI read operations with provided MDMA for the OSPI interface, Here I would have expected that I get a continuous CLK with a 50 MHz CLK again, because the processor is unloaded.
Now I wonder what the specified maximum data rate/ CLK frequency is for the STM32H723 for a SDR communication, because in the Application Note OSPI I it is not specified for the MCU I'm using.
Are there any settings that allow to implement a reliable QSPI interface for a CLK frequency >20 MHz?
Best regards,
Jurni_JasteD
2023-07-12 07:00 AM
Hello @Jurni_JasteD ,
Thank you for bringing this typo to our attention.
I confirm that ,for STM32H72x/3x, the Max OCTOSPI speed Regular-command SDR mode / Regular-command DTR mode with DQS HyperBus protocol with single-ended clock (3.3 V) values are missing in AN5050 rev8 table2.
The correct Max OCTOSPI speed values for:
-Regular-command SDR mode is 140MHz.
-Regular-command DTR mode with DQS HyperBus protocol with single-ended clock (3.3 V) is 100MHz.
This issue is reported internally.
Internal ticket number: 154620 (This is an internal tracking number and is not accessible or usable by customers).
Kaouthar
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.
2023-07-12 07:01 AM
Perhaps deepen the FIFO ?
2023-07-12 11:07 AM - edited 2023-07-12 11:07 AM
hospi1.Init.FreeRunningClock = HAL_OSPI_FREERUNCLK_DISABLE; // Turns it off when not active
Memory Mapped mode should allow for a saturated read operation to the maximal bandwidth of the memory, less whatever other contention, and interrupts, etc you're dealing with.
2023-07-16 12:08 AM
The "glitch" on DIO3 is most likely a result of dynamic switching capability between 1-line and 4-line mode. In 1-line mode, the pin DIO3 is nHOLD for the flash chip (note again: the QSPI interface had been designed with memory devices in mind), so its inactive state is '1', whereas the inactive state for DIO2 is '0' as it nWP for the flash.
So after a 4-line transfer phase, the pins probably return to default state for 1-line mode, and are deactivated only then. However, that's not a deficiency nor a bug, as ST does assure functionality for memory devices only, and for these, this glitch is irrelevant as it occurs with sufficient delay after CS goes inactice.
For devices other than memory I'm afraid it's just like this: YMMV