I was playing around with the SPItoFTDI example and noticed some odd behavior. If you try to make the first buffer be anything other than 5 bytes, that buffer gets ignored. What am I missing? I attached screenshots below.
For DMA mode operation of the SPI, the buffer length must be an even number of bytes. With the additional payload bytes, your buffer of 6 makes the total length odd. If you add an additional byte, I would expect that you will see the response you expect.
* For ADuCM350 SPI DMA mode (which is 16-bit based), \a DataSize is rounded up to an * even number by the DMA hardware, as only even numbers of 8-bit data is transacted * (as 16-bit elements). This improves DMA efficiency and reduces DMA interrupt overhead. * Though the byte-centric API is retained (for compatibility with previous integrations), * the DMA mode processes all data as 16-bit. Please insure evenly sized transmit and receive * buffers allocations are used in DMA mode. Do not use the DMA mode for odd-byte count * transfers. To effect an odd-byte transfer, either start it in DMA mode (with an even * number of bytes) and end it with an odd-byte amount in proframmed I/O (non-DMA) mode, * or use programmed I/O mode for the entire the transfer. Odd-sized data byte counts * (\a DataSize) in DMA mode cause data buffer overruns; in ADI_DEBUG builds, this is * flagged as an error.
Good catch, it works now. (I thought I had tested it with two fewer bytes, but I guess I did something else wrong.)
Retrieving data ...