2021-10-08 12:32 AM
i see in stm32u5xx_hal_dma.c that only normal mode ofr dma is compliant. How can I manage the ciricular mode ?
2021-10-08 12:54 AM
Show us the code, speciall atention to the function initialising the DMA where you pass the RXbuffer
2021-10-08 01:48 AM
HAL_StatusTypeDef ResultHal = HAL_OK;
pDMAHandle->Instance = pDMAChannel;
pDMAHandle->Init.Request = DMARequest;
pDMAHandle->Init.Direction = DMADirection;
if (pDMAHandle->Init.Direction == DMA_PERIPH_TO_MEMORY)
{
pDMAHandle->Init.SrcInc = DMA_SINC_FIXED;
pDMAHandle->Init.DestInc = DMA_DINC_INCREMENTED;
}
else
{
pDMAHandle->Init.SrcInc = DMA_SINC_INCREMENTED;
pDMAHandle->Init.DestInc = DMA_DINC_FIXED;
}
pDMAHandle->Init.SrcDataWidth = DMA_SRC_DATAWIDTH_BYTE;
pDMAHandle->Init.DestDataWidth = DMA_DEST_DATAWIDTH_BYTE;
pDMAHandle->Init.Mode = DMA_NORMAL;
pDMAHandle->Init.Priority = DMA_LOW_PRIORITY_LOW_WEIGHT;
pDMAHandle->Init.TransferAllocatedPort = DMA_SRC_ALLOCATED_PORT0 | DMA_DEST_ALLOCATED_PORT1;
pDMAHandle->Init.SrcBurstLength = 1;
pDMAHandle->Init.DestBurstLength = 1;
pDMAHandle->Init.TransferEventMode = DMA_TCEM_LAST_LL_ITEM_TRANSFER;
if ( pDMAHandle->Init.Mode == DMA_NORMAL )
{
ResultHal = (HAL_StatusTypeDef) HAL_DMA_Init( pDMAHandle );
}
else
{
}
works well
but How can I change DMA_NORMAL to use circular DMA in my app
2021-10-08 03:26 AM
are you using CUBEMX?
2021-10-08 04:37 AM
yes , i can use it, just to create and understand the strcuture
2021-10-08 04:54 AM
well, good news, CUBEMX has an option for you :D
2021-10-08 06:56 AM
thx , i will try this evening