Skip to main content
DShekter
Associate II
September 9, 2021
Question

STM32H7 1.9.0 MDMA request not initialized

  • September 9, 2021
  • 3 replies
  • 1361 views

Specifically I've noticed it with the octospi, but it's also impacted at least software requests.

For example, my MDMA config has

 hmdma_octospi1_fifo_th.Instance = MDMA_Channel1;
 hmdma_octospi1_fifo_th.Init.TransferTriggerMode = MDMA_BUFFER_TRANSFER;
 hmdma_octospi1_fifo_th.Init.Priority = MDMA_PRIORITY_VERY_HIGH;
 hmdma_octospi1_fifo_th.Init.Endianness = MDMA_LITTLE_ENDIANNESS_PRESERVE;
 hmdma_octospi1_fifo_th.Init.SourceInc = MDMA_SRC_INC_BYTE;
 hmdma_octospi1_fifo_th.Init.DestinationInc = MDMA_DEST_INC_DISABLE;
 hmdma_octospi1_fifo_th.Init.SourceDataSize = MDMA_SRC_DATASIZE_BYTE;
 hmdma_octospi1_fifo_th.Init.DestDataSize = MDMA_DEST_DATASIZE_BYTE;
 hmdma_octospi1_fifo_th.Init.DataAlignment = MDMA_DATAALIGN_RIGHT;
 hmdma_octospi1_fifo_th.Init.BufferTransferLength = 1;
 hmdma_octospi1_fifo_th.Init.SourceBurst = MDMA_SOURCE_BURST_SINGLE;
 hmdma_octospi1_fifo_th.Init.DestBurst = MDMA_DEST_BURST_SINGLE;
 hmdma_octospi1_fifo_th.Init.SourceBlockAddressOffset = 0;
 hmdma_octospi1_fifo_th.Init.DestBlockAddressOffset = 0;
 if (HAL_MDMA_Init(&hmdma_octospi1_fifo_th) != HAL_OK)
 {
 Error_Handler();
 }
 
 __HAL_LINKDMA(ospiHandle,hmdma,hmdma_octospi1_fifo_th);

But what it's missing is the Init.Request. So I had to add

 /* USER CODE BEGIN OCTOSPI1_MspInit 0 */
	 hmdma_octospi1_fifo_th.Init.Request = MDMA_REQUEST_OCTOSPI1_FIFO_TH;
 /* USER CODE END OCTOSPI1_MspInit 0 */

and that fixed everything. a similar thing was needed for the software request, however there are no USER CODE sections in the init function.

Code was generated with the STM32CubeIDE, version 1.7.0.

This topic has been closed for replies.

3 replies

Amel NASRI
ST Technical Moderator
September 10, 2021

Hi @Community member​ ,

Thanks for bringing this issue to our attention.

I let our Expert @Khouloud ZEMMELI​ ​ review it and take the required corrective actions, if needed.

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
Khouloud ZEMMELI
ST Employee
September 10, 2021

Hello @Community member​ ,

Could you please share your ioc file to check your case?

Thanks, Khouloud

DShekter
DShekterAuthor
Associate II
September 10, 2021

Sure. I've attached an IOC that shows the issue for software and OCTOSPI requests. For me, the initializations look like:

static void MX_MDMA_Init(void)
{
 
 /* MDMA controller clock enable */
 __HAL_RCC_MDMA_CLK_ENABLE();
 /* Local variables */
 
 /* Configure MDMA channel MDMA_Channel0 */
 /* Configure MDMA request hmdma_mdma_channel40_sw_0 on MDMA_Channel0 */
 hmdma_mdma_channel40_sw_0.Instance = MDMA_Channel0;
 hmdma_mdma_channel40_sw_0.Init.TransferTriggerMode = MDMA_BUFFER_TRANSFER;
 hmdma_mdma_channel40_sw_0.Init.Priority = MDMA_PRIORITY_LOW;
 hmdma_mdma_channel40_sw_0.Init.Endianness = MDMA_LITTLE_ENDIANNESS_PRESERVE;
 hmdma_mdma_channel40_sw_0.Init.SourceInc = MDMA_SRC_INC_BYTE;
 hmdma_mdma_channel40_sw_0.Init.DestinationInc = MDMA_DEST_INC_BYTE;
 hmdma_mdma_channel40_sw_0.Init.SourceDataSize = MDMA_SRC_DATASIZE_BYTE;
 hmdma_mdma_channel40_sw_0.Init.DestDataSize = MDMA_DEST_DATASIZE_BYTE;
 hmdma_mdma_channel40_sw_0.Init.DataAlignment = MDMA_DATAALIGN_PACKENABLE;
 hmdma_mdma_channel40_sw_0.Init.BufferTransferLength = 1;
 hmdma_mdma_channel40_sw_0.Init.SourceBurst = MDMA_SOURCE_BURST_SINGLE;
 hmdma_mdma_channel40_sw_0.Init.DestBurst = MDMA_DEST_BURST_SINGLE;
 hmdma_mdma_channel40_sw_0.Init.SourceBlockAddressOffset = 0;
 hmdma_mdma_channel40_sw_0.Init.DestBlockAddressOffset = 0;
 if (HAL_MDMA_Init(&hmdma_mdma_channel40_sw_0) != HAL_OK)
 {
 Error_Handler();
 }
 
 /* MDMA interrupt initialization */
 /* MDMA_IRQn interrupt configuration */
 HAL_NVIC_SetPriority(MDMA_IRQn, 0, 0);
 HAL_NVIC_EnableIRQ(MDMA_IRQn);
 
}

and

/* OCTOSPI1 MDMA Init */
 /* OCTOSPI1_FIFO_TH Init */
 hmdma_octospi1_fifo_th.Instance = MDMA_Channel1;
 hmdma_octospi1_fifo_th.Init.TransferTriggerMode = MDMA_BUFFER_TRANSFER;
 hmdma_octospi1_fifo_th.Init.Priority = MDMA_PRIORITY_LOW;
 hmdma_octospi1_fifo_th.Init.Endianness = MDMA_LITTLE_ENDIANNESS_PRESERVE;
 hmdma_octospi1_fifo_th.Init.SourceInc = MDMA_SRC_INC_BYTE;
 hmdma_octospi1_fifo_th.Init.DestinationInc = MDMA_DEST_INC_BYTE;
 hmdma_octospi1_fifo_th.Init.SourceDataSize = MDMA_SRC_DATASIZE_BYTE;
 hmdma_octospi1_fifo_th.Init.DestDataSize = MDMA_DEST_DATASIZE_BYTE;
 hmdma_octospi1_fifo_th.Init.DataAlignment = MDMA_DATAALIGN_PACKENABLE;
 hmdma_octospi1_fifo_th.Init.BufferTransferLength = 1;
 hmdma_octospi1_fifo_th.Init.SourceBurst = MDMA_SOURCE_BURST_SINGLE;
 hmdma_octospi1_fifo_th.Init.DestBurst = MDMA_DEST_BURST_SINGLE;
 hmdma_octospi1_fifo_th.Init.SourceBlockAddressOffset = 0;
 hmdma_octospi1_fifo_th.Init.DestBlockAddressOffset = 0;
 if (HAL_MDMA_Init(&hmdma_octospi1_fifo_th) != HAL_OK)
 {
 Error_Handler();
 }
 
 __HAL_LINKDMA(hospi,hmdma,hmdma_octospi1_fifo_th);