But when SSP_CLK signal goes to 0 for reading the first bit, I have a “glitch” in the MISO.
It’s seems like an overcurrent in the MISO line (the first bit of the rx buffer is ever 1).
Please see the image (my apologies for the bad quality…):
The upper trace is the SPI CLK, the lower is the MISO.
The code is the same of FreeRTOS/examples/imx7d_val_m4/demo_apps/ecspi_flash_demo
Could you provide the version of the Bsp of your module?
Concerning your issue, could you provide the schematic of SPI connection between iMX7 and FPGA? What is your Spi Clock frequency?
According to your settings, the data from slave (MISO) is sampled at high state of the SPI Clock signal. So if there is glitch when the SPI Clock is Low, this should not create any issues.
Could you also add the Chip select line? Actually three lines are important to measure the SPI Communcation: SPI Clk, MISO and Chip Select.
M4 is the Master, FPGA is the slave.
The connection is on the X3 connector of Colibri Evaluation Board (Rev 3.2) A30: SSP_FRM, B30: SSP_TXD, B31: GND, C29: SSP_CLK, C30: SSP_RXD) – the SPI compatible pins.
I’ve done a similar test with two different iMX6 SOM (Both with WCE2013 and Linux), and the same with the iMX7 in Linux: all work very well.
But with the iMX7 with Linux (the SOM used with M4-test), when I connect the oscilloscope probe to the SPI Clock the communication fault, the data are all wrong; removing the probe, the data is ok.
With the two iMX6 I don’t have problem with the probe.
If the SPI Communication works well with Imx6 and Imx7 Linux, then the only thing which might be a Problem is the drive strength of the Pins. That’s why also the communication is wrong when you put the probe on the pins.
Did you set the same drive strength for M4 core as for the A7 core?
The value ‘0x2’, in the device tree customization,
is
1-0 DSE Drive Strength Field
00 - X1
01 - X4
10 - X2
11 - X6
And, sincerely, I can’t have found references about ‘10 - X2’ means in both Chapter 4 of the Toradex Colibri iMX7 data sheet and Chapter 8 of the NXP®/Freescale i.MX 7 application processor reference manual.