Hi,
I am sharing one SPI device between three different tasks of different priorities and on occasion the device writes out wrong data to one of the slaves. The SPI driver is operating in DMAINTERRUPT mode and I am using the 1.30.1 psp driver. My first guess is that the EDMA is transferring wrong data to the driver. How can I verify that this is what is happening?
I have 3 separate channels for the different tasks. I use the oscilloscope to decode whatever the SPI device is writing out and that is how I detect this error. The three different slave devices I am writing to are ADCs and DACs and the DSP is the master. Usually when I see this error it seems another task interrupts the task with the lower priority which causes it to write out wrong data. The CS, DATA_OUT, DATA_IN and CLK signals all look ok on the scope but the data written out is wrong. How is it possible that the task of lower priority writes out wrong data even before it is interrupted by the higher priority task? On the scope the word from the lower priority task occurs before the higher priority task's words.
Even when I write the same data to the low priority channel everytime, the data eventually gets corrupted with the same value (i.e the output from the SPI device is always the same when this error happens). It is only when I change the values I am writing to the spi channel in the higher priority task that causes a change in the value of the corrupt data written in the lower priority spi channel and this leads me to my initial guess that the EDMA is mixing the data.
Thanks