• AVR Freaks

Hot!SPI with DMA maximum transfer size

Author
Fadi Hammoud
Starting Member
  • Total Posts : 47
  • Reward points : 0
  • Joined: 2015/02/03 03:59:45
  • Location: 0
  • Status: offline
2018/10/27 11:00:09 (permalink)
5 (1)

SPI with DMA maximum transfer size

I've got some code that will write out data to a GLCD via Harmony, using SPI and DMA. I ran across a problem- whenever I made my transfer array greater than 2048 bytes, the code would fail. I had set via the configurator to have a block transfer size of 8K (8192 bytes).
 
Looking deeper into it, I think I found the issue- there is a value set in drv_spi_internal.h of 
#define PLIB_DMA_MAX_TRF_SIZE 2048
The spi driver (generated by Harmony) refuses to make DMA transfers larger than 2048 bytes. It seems like the request is divided into series of 2048bytes transfers but is failing somewhere.
Any ideas as to why this particular limit? I can changed PLIB_DMA_MAX_TRF_SIZE to 8192 and everything is working just fine. Any ideas on why is the DMA transfers limited and what are the risks/ side effects on changing PLIB_DMA_MAX_TRF_SIZE ?
#1

0 Replies Related Threads

    Jump to:
    © 2019 APG vNext Commercial Version 4.5