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.

TM4C129CNCPDT: Can you terminate an already armed DMA transfer request?

Part Number: TM4C129CNCPDT

I have a DMA basic mode function to transfer data from memory to the SSI transmit register. Since it is possible for the receiving device to fail, is it possible to reset the the current transfer request and allow a new request? 

The code below does not work:

void spi_slave_tx_set(uint8_t *tx, uint16_t len) {
	if (uDMAChannelModeGet(SPI_TX_DMA_CHAN | UDMA_PRI_SELECT) != UDMA_MODE_STOP)
	{
			uDMAChannelDisable(SPI_TX_DMA_CHAN);
uDMAChannelTransferSet(SPI_TX_DMA_CHAN | UDMA_PRI_SELECT, UDMA_MODE_STOP,
			&dummy, (void *)(SPI_BASE + SSI_O_DR), 0);
		
	}

	/* rearm the TX DMA */
	uDMAChannelTransferSet(SPI_TX_DMA_CHAN | UDMA_PRI_SELECT, UDMA_MODE_BASIC,
			tx, (void *)(SPI_BASE + SSI_O_DR), len);

	uDMAChannelEnable(SPI_TX_DMA_CHAN);
	SSIDMAEnable(SPI_BASE, SSI_DMA_TX);
}

  • Hi Michael,
    When will you call spi_slave_tx_set()? If the transfer has already started and you call spi_slave_tx_set() in the middle of the transfer then it may be too late as the transfer is expected to continue until the arbitration size boundary.