STM32U5 hspi fifo
Greetings!
I'm working with an STM32U5G9 processor, trying to communicate to a HyperBus psram over the hspi peripheral. My initial simple test is to try to do an indirect read of the psram 16 bit id register at register space address 0.
I am capturing the HyperBus communication with a logic analyzer and everything looks as expected, except for an extra clock pulse at the end of the transaction.
My problem is that I am not seeing the expected fixed Id register contents when I read the HSPI_DR. The expected Id register value is seen on the bus with the logic analyzer. I have dug in enough to understand that the DR read actually pulls from a 64 byte fifo, and that the number of bytes in the fifo are indicated by the contents of HSPI_SR:FLEVEL[0:6]. I have checked the fifo level before initiating a 2 byte HperBus read, and see 0. I initiate the transfer by writing the HSPI_AR register and immediately after the transfer, FLEVEL indicates 30 bytes in the fifo.
A bit of test code to pull these 30 bytes into a debug array shows 28 bytes of 0, with the expected psram ID value in the last two bytes of the fifo. I have 7 clocks specified for tacc = initial access latency (STM RM0456 Rev 5, Figure 169). The psram holds RWDS high to request a second set of 7 latency clocks. This gives 14 latency clocks, or 28 clock edges. If I increase the number of latency clocks, the number of extra bytes in the fifo increase correspondingly.
It looks like the hspi in HyperBus indirect mode is receiving data on the latency clock pulses and storing in the DR fifo. Has anyone else seen this, or been able to get hspi HyperBus indirect register space access to work on the STM32U5G9?
My project and test code are largely generated by CubeMX 6.12.1, using STM32Cube_FW__U5_V1.6.0.
Thanks for any insight that can be offered.
-Rob
