Hello All,
I'm currently trying to do a DMA transfer into an eDMA register related to an SPI transfer and it does not seem to be correctly working for some reason. This is on a Vybrid VF6XX processor.
If I manually do:
//DMA30_EEI, DMA30_CEEI, DMA30_CERQ = ignore, DMA30_SERQ = enable SPI DMA
*(uint32_t*)0x40098018 = (30<<24) + 0x808080;
Then the SPI launches no problem
If I use another DMA channel to transfer the memory into 0x40098018, the SPI does not start.
uint32_t test[1];
test[0] = (30<<24) + 0x808080;
transferDescriptor.SRC_ADDR = (uint32_t)((uint32_t *)&(test[0]));
transferDescriptor.DST_ADDR = (uint32_t) (0x40098018);
transferDescriptor.SRC_WIDTH = 4;
transferDescriptor.SRC_MODULO = 0;
transferDescriptor.SRC_OFFSET = 0;
transferDescriptor.DST_MODULO = 0;
transferDescriptor.DST_OFFSET = 0;
transferDescriptor.DST_WIDTH = 4;
transferDescriptor.LOOP_BYTES = 4;
transferDescriptor.LOOP_COUNT = 1;
transferDescriptor.LOOP_SRC_OFFSET = 0;
transferDescriptor.LOOP_DST_OFFSET = 0;
dma_request_enable(transferChannel);
dma_transfer_submit(transferChannel, &transferDescriptor, NULL);
If I use the same DMA channel and do an 8-bit transfer instead of 32-bit transfer, the SPI DOES start.
uint8_t test[1];
test[0] = (30);
transferDescriptor.SRC_ADDR = (uint32_t)((uint32_t *)&(test[0]));
transferDescriptor.DST_ADDR = (uint32_t) (0x4009801b);
transferDescriptor.SRC_WIDTH = 1;
transferDescriptor.SRC_MODULO = 0;
transferDescriptor.SRC_OFFSET = 0;
transferDescriptor.DST_MODULO = 0;
transferDescriptor.DST_OFFSET = 0;
transferDescriptor.DST_WIDTH = 1;
transferDescriptor.LOOP_BYTES = 1;
transferDescriptor.LOOP_COUNT = 1;
transferDescriptor.LOOP_SRC_OFFSET = 0;
transferDescriptor.LOOP_DST_OFFSET = 0;
dma_request_enable(transferChannel);
dma_transfer_submit(transferChannel, &transferDescriptor, NULL);
Does anyone know what's going on here? I need to be able to do this with a 32-bit DMA transfer instead of an 8-bit DMA transfer, so that I can also modify another 32-bit register with an incremented offset.
Thanks everyone.