I'm planning on using dma on mibspi and currently testing the module, but I'm having hard time understanding how exactly it works.
Mibspi will have to handle data size ranging from 2 bytes at least to 823 bytes at most, and it can vary. The problem is passing 823 bytes packet with dma and I came up with 2 options.
1. Using all 128 word buffer of mibspi, pass it as 128 elements, 7 frame data. In this case, (128*7)-823 = 73 bytes will be redundant. I don't know if I'm being correct, but if DMAxCOUNT is actually number of elements that dma transfers, then I'd be able to stop mibspi and dma when it transmitted(and recieved) 823 bytes of data.
2. Using only 1 word buffer of mibspi, pass it as 1 element, 823 frame data or vise versa. Write to single buffer of tx and read from single buffer of rx.
I tried both options to achieve the goal. Unfortunately, it didn't go very well. Actually I'm not even sure if those are possible. I've tried altering many control values and the most frequent problem is that received data by mibspi rx dma becoming same data(ex: receiving "abcdefgh" becomes "cccccccc"). I wonder if using digital loopback has to do anything with this.
I'll look into it more but I'd like to know if any of those options is possible.
It might be better to use compatible spi for this kind of communication, but spi5 tx/rx and sci tx/rx share same dma request line and since I have to use them both, I'd like to use mibspi5 and use other dma request line for mibspi5.
Thanks for help!