This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LC43x mibspi dma: dmaREG->BTCFLAG!=0x00000001 does not work and block can only be sent once

Hello,

we are working on a redundant system that has to use mibspi with dma for communication between the microcontroller boards.

Our problem is, that we can only send one block and then nothing happens. For testing we checked the block transfer complete flag, but it did not be set and so our send function never finished. We don't know where our mistake is. Could you please help us or explain to us, what to do?

Here is our ccs-project in a 7z archive:


https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/7713.avionik.7z

  • Hi Philipp,

      I briefly looked at your code. When you start mibspiTransfer() the mibSPI will generate a DMA request. Upon receiving the DMA request the DMA will transfer data to the TX shift register. Since you are in a loopback mode, the data is also received in the RX received buffer. When the data is available in the received buffer it generates a DMA request again asking the DMA to move the data out to the CPU RAM. So there are two transfers happen. What might have happened In my opinion is that the BTCFLAG=0x00000003 should be 3 meaning channel0 and channel1 are both complete.

  • Hello Charles,

    thank you for your fast answer. I fixed the check of the bit. But now we are back to our first problem, where only one package can be sent and then nothing happens. In testSPI() we call our function MIBSPI_sendPackage() in a loop. This function calls our function MIBSPI_sendData() which writes the data to the spi-ram and calls
    dmaEnable();
    mibspiTransfer(mibspiREG1, 0);
    I somehow feel that mibspiTransfer is wrong in this position, but don't know where else to put it.
    We checked it in the debugger, the first package is received, but the following packages are not, no further interrupts are thrown either.
    Do you know what could cause the issue, that data is only sent once and then the dma does not react?

    Kind regards,

    Philipp
  • Hi Phil,
    Seems like the MibSPI is not generating the DMA request after one block is complete. Can you check the RXDMAENA and TXDMAENA bit? Are they somehow clear? Please check also the ONESHOT bit in the DMACTRL register? Are you in one shot mode?

    Not sure if you have a chance to read the MibSPI-DMA app note. Please find this app note here. www.ti.com/.../spna231.pdf
  • Thank you very much, it was the oneshot bit, which was set in code we took from an example. I could fix the problem by deactivating oneshot.
  • Hi Phil,
    Glad your problem is resolved.