STM32U5 SAI DMA
I'm trying to get SAI working with DMA on a NUCLEO-U575ZI-Q but have not been successful.
I've tried using both standard request mode and linked-list mode, but the DMA configuration code is never generated.
On an older STM32L4 project, the bottom of `HAL_SAI_MspInit` looked like:
hdma_sai1_a.Instance = DMA2_Channel1;
hdma_sai1_a.Init.Request = DMA_REQUEST_1;
hdma_sai1_a.Init.Direction = DMA_PERIPH_TO_MEMORY;
hdma_sai1_a.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_sai1_a.Init.MemInc = DMA_MINC_ENABLE;
hdma_sai1_a.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
hdma_sai1_a.Init.MemDataAlignment = DMA_MDATAALIGN_WORD;
hdma_sai1_a.Init.Mode = DMA_CIRCULAR;
hdma_sai1_a.Init.Priority = DMA_PRIORITY_LOW;
if (HAL_DMA_Init(&hdma_sai1_a) != HAL_OK)
{
Error_Handler();
}
/* Several peripheral DMA handle pointers point to the same DMA handle.
Be aware that there is only one channel to perform all the requested DMAs. */
__HAL_LINKDMA(saiHandle,hdmarx,hdma_sai1_a);
__HAL_LINKDMA(saiHandle,hdmatx,hdma_sai1_a);With the U5, that code is never generated. Then whenever I call `HAL_SAI_Receive_DMA`, the device crashes since it tries to access `hsai->hdmarx->....` but since hdmarx is still NULL, it's dereferencing a NULL pointer.
/* Set the SAI Rx DMA Half transfer complete callback */
hsai->hdmarx->XferHalfCpltCallback = SAI_DMARxHalfCplt;
/* Set the SAI Rx DMA transfer complete callback */
hsai->hdmarx->XferCpltCallback = SAI_DMARxCplt;
/* Set the DMA error callback */
hsai->hdmarx->XferErrorCallback = SAI_DMAError;
/* Set the DMA Rx abort callback */
hsai->hdmarx->XferAbortCallback = NULL;What do I need to do to generate the appropriate initialization code?
Here are some screenshots of the cubemx config in Standard Request Mode. I'm also attaching the CubeMx .ioc file.
I'm using STM32CubeMx v6.6.1 with STM32Cube_FW_U5 v1.1.1

Thank you!
Alvaro
