Code (any language) works so much better on here between [code]... your code here ...[/code] tags.That was the right trigger, thanks. I also noticed you need to adapt for the fact that the data register is 32 bits but only holds a single character:So here I use a stride of 1 to make sure we only advance one byte at a time.Code:
m_controlBlock->TransferInformation = (static_cast<uint32>(dreq) << RPI_DMA_TI_PERMAP_SHIFT) | (RPI_DMA_DEFAULT_BURST_LENGTH << RPI_DMA_TI_BURST_LENGTH_SHIFT) | RPI_DMA_TI_SRC_WIDTH | RPI_DMA_TI_SRC_INC | RPI_DMA_TI_DST_DREQ | RPI_DMA_TI_WAIT_RESP; if (srcStride != 0) { // Writes are always a full 32 bit register, but we want to send a different width // This is a.o. used for UART writes m_controlBlock->TransferInformation |= RPI_DMA_TI_TDMODE; m_controlBlock->TransferLength = length << RPI_DMA_TXFR_LEN_YLENGTH_SHIFT | 1 << RPI_DMA_TXFR_LEN_XLENGTH_SHIFT; } else { m_controlBlock->TransferLength = length; } m_controlBlock->ModeStride2D = 0; m_controlBlock->SourceAddress = ARM_TO_GPU((uintptr)srcAddress); m_controlBlock->DestinationAddress = dstIOAddress; m_controlBlock->NextControlBlockAddress = 0;
Thanks for the help!
Statistics: Posted by DougieLawson — Mon Sep 15, 2025 6:31 am