2013-07-17 04:40 AM
2013-07-17 07:26 AM
But the internal memory just receive the SPI2->DR without increment the SPI memory address. So we have always the same data copied.
Did you checked that the data in SPI2->DR is correctly updated? May be the problem isn't in DMA side. -Mayla-
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.
2013-07-17 11:10 AM
Well you'd have to generate some outbound SPI traffic to be able clock back data from the slave device.
DMA1 Stream4 Channel0 is SPI2_TX (OUTBOUND) To SPI2->DR DMA1 Stream3 Channel0 is SPI2_RX (INBOUND) From SPI2->DR So you're using the wrong stream for inbound data ie SPI to FSMC You will need to fix the stream you have configured, and create a second one2013-07-18 01:18 AM
Thank you for your replies.
@ Mayla : The SPI->DR is not updated, it's always the same data. But we don't understand how increment the memory adress to progress into.The SPI protocol is OK, we can write in our memory where we want, but the SPI protocol with the DMA protocol is NOK.@clive1 : If we try the other stream (DMA1 Stream3 Channel0 is SPI2_RX (INBO
UND) From SPI2->D
R)
, the data isn't copied into our board (variable in soft to do SPI -> Flash). But we agree with you, we use the bad DMA ! But it works with the bad.And why do you want to create a second DMA ? We can't use only one DMA to do SPI -> FSMC ?2013-07-18 05:02 AM
The SPI master (STM32) only generates an SPI clock for out bound data, the in bound received data is clocked back as a side effect of this singular clock. Reading SPIx->DR does not generate clocks, it just returns the value in a holding register. You said it keeps reading the same value, which wouldn't be surprising if it never clocks the interface.
2013-07-19 01:09 AM
OK, it's our problem.
So how can we increment the adresss pointer of the SPI-DR by the DMA? DMA doesn't be able to command the clock of the Rx data of SPI ?2013-07-19 01:56 AM
You don't increment the SPIx->DR, it's an STM32 side register. The process you describe is one of streaming data from an SPI memory, which presumably auto-increments it's internal address register as you keep reading data from it.
Without wading into the documentation there might be a data streaming command, or block/pages you can read in a burst. The usual mechanisms for such memories is to send a command/address and then to read back one or multiple bytes. You must remember that SPI is a symmetrical interface, you must stuff data in, to get data out, the data going in might only need to be junk or undefined, and the data coming back might be ignored. It depends on the device and the mode/command being used.