2025-04-25 1:10 AM
/**
* @brief DMA Linked-list yWaveQ configuration
* @PAram None
* @retval None
*/
HAL_StatusTypeDef MX_yWaveQ_Config(void)
{
HAL_StatusTypeDef ret = HAL_OK;
/* DMA node configuration declaration */
DMA_NodeConfTypeDef pNodeConfig;
/* Set node configuration ################################################*/
pNodeConfig.NodeType = DMA_GPDMA_LINEAR_NODE;
pNodeConfig.Init.Request = GPDMA1_REQUEST_SPI3_TX;
pNodeConfig.Init.BlkHWRequest = DMA_BREQ_SINGLE_BURST;
pNodeConfig.Init.Direction = DMA_MEMORY_TO_PERIPH;
pNodeConfig.Init.SrcInc = DMA_SINC_INCREMENTED;
pNodeConfig.Init.DestInc = DMA_DINC_FIXED;
pNodeConfig.Init.SrcDataWidth = DMA_SRC_DATAWIDTH_BYTE;
pNodeConfig.Init.DestDataWidth = DMA_DEST_DATAWIDTH_BYTE;
pNodeConfig.Init.SrcBurstLength = 2;
pNodeConfig.Init.DestBurstLength = 1;
pNodeConfig.Init.TransferAllocatedPort = DMA_SRC_ALLOCATED_PORT0|DMA_DEST_ALLOCATED_PORT1;
pNodeConfig.Init.TransferEventMode = DMA_TCEM_BLOCK_TRANSFER;
pNodeConfig.TriggerConfig.TriggerMode = DMA_TRIGM_SINGLE_BURST_TRANSFER ;
pNodeConfig.TriggerConfig.TriggerPolarity = DMA_TRIG_POLARITY_RISING;
pNodeConfig.TriggerConfig.TriggerSelection = GPDMA1_TRIGGER_TIM15_TRGO;
pNodeConfig.DataHandlingConfig.DataExchange = DMA_EXCHANGE_NONE;
pNodeConfig.DataHandlingConfig.DataAlignment = DMA_DATA_RIGHTALIGN_ZEROPADDED;
pNodeConfig.SrcAddress = (uint32_t)SpiTable[0];
pNodeConfig.DstAddress = (uint32_t)&(SPI3->TXDR);
pNodeConfig.DataSize = 8;
/* Build DMASpi1 Node */
ret |= HAL_DMAEx_List_BuildNode(&pNodeConfig, &DMASpi1);
/* Insert DMASpi1 to Queue */
ret |= HAL_DMAEx_List_InsertNode_Tail(&yWaveQ, &DMASpi1);
/* Set node configuration ################################################*/
pNodeConfig.SrcAddress = (uint32_t)SpiTable[1];
/* Build DMASpi2 Node */
ret |= HAL_DMAEx_List_BuildNode(&pNodeConfig, &DMASpi2);
/* Insert DMASpi2 to Queue */
ret |= HAL_DMAEx_List_InsertNode_Tail(&yWaveQ, &DMASpi2);
ret |= HAL_DMAEx_List_SetCircularModeConfig(&yWaveQ, &DMASpi1);
return ret;
}
MX_yWaveQ_Config();
HAL_DMAEx_List_LinkQ(&handle_GPDMA1_Channel2, &yWaveQ);
HAL_DMAEx_List_Start(&handle_GPDMA1_Channel2);
__HAL_SPI_ENABLE(&hspi3);
HAL_TIM_Base_Start(&htim15);
There is no output observed at SPI SCK pin.
Any suggestion is welcome.
2025-05-06 6:57 AM
Hello @dh_leslie,
Have you verified that TIM15 is running and generating the trigger signal as expected?
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-05-06 5:47 PM
Yes, TIM15 is running and triggers spi tx periodly as expected. But I cannot solve the delay issue.
2025-05-07 2:10 AM
For the delay issue, ensure that the burst length (SrcBurstLength and DestBurstLength) are optimized for your application, same for data width.
Another path is low spi baudrate? we don't have this information in the code section you provided
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-05-07 4:48 PM
https://community.st.com/t5/stm32-mcus-products/timer-update-event-delay/td-p/797242
Here is the post describing the delay issue.