Hi Wolf
I have used the Atmel AT45dbxxx devices and the ST STM25Pxxx devices with the QSPI. Here are some comments.
I use PQSPAR = 0x0015 - just the SPI lines, CS lines controlled via GPIO (I don't see any advantage of letting the QSPI control the CS lines automatically in this specific case - the code overhead is higher) - you are configuring all CS lines.
I use QMR = 0xa002 for highest speed (check the clock and phase settings - the SPI FLASH chip possibly adapts itself though).
QWR = 0x0100 configures to send 2 bytes - the first 0x05 (I presume the command to read the status).
When the SPIF flag is set it means that the transmission (and reception) has completed.
QAR = 0x0010 is setting the address pointer to the first byte in the RX queue.
I think that you basic problem is that you are reading the first byte in the queue - this will be returned while the status command byte is being transfered. Probably you don't have a pull up on the RX line and so the value is 0x00.
What you need to do is read the second byte in the RX queue, which will have been set when the second byte was transfered (the second TX byte is not being defined by your code - I tend to ensure that always 0xff is sent to keep the TX line stable when reading).
Therefore if you do
MCF_QSPI_QAR = 0x0010;
dummy = MCF_QSPI_QDR;
printf("\nData[%d]: %d\n", 1, MCF_QSPI_QDR);
You might find that the value is then as expected.
Also checking the CS and data on the SPI bus with an oscilloscope or logic analyser will ensure that the chips is
basically responding.
BTW. Keep all lines as short as possible. It may even be advisabe to terminate the clock line.
It may not be as sensitive with the SPI FLASH that you are using but the ones above don't tolerate any ringing.
Even connecting a scope to the clock line can be enough to stop it working correctly!!
Regards
Mark
www.uTasker.com