Showing results for 
Search instead for 
Did you mean: 

How to properly configure DMA in order to use linked list in non secure Application (TZEN = 1) on STM32U585

Associate III


our porject use TZEN =1;

A custom Bootlaoder (secure app) is executed at begin and after we call a non secure Application.

The non secure Application as already been tested/validated with TZEN = 0.

This application use GPDAM channel 10 ro read data from ADC4.

With TZEN = 1 , HAL_ADC_Start_DMA is not wroking.

I Put GPDMA register config arround __HAL_DMA_ENABLE

0693W00000WL5hyQAD.pngDMA return USEF error.

Does anyone has an idea of why it fail?

SRAM 1-2-3 are configure as non secure (application can read/write inside it).

All peripheral are configured as non secure from Bootloader


This is DMA node configuration :

pNodeConfig.NodeType = DMA_GPDMA_LINEAR_NODE;
  pNodeConfig.Init.Request = GPDMA1_REQUEST_ADC4;
  pNodeConfig.Init.BlkHWRequest = DMA_BREQ_SINGLE_BURST;
  pNodeConfig.Init.Direction = DMA_PERIPH_TO_MEMORY;
  pNodeConfig.Init.SrcInc = DMA_SINC_FIXED;
  pNodeConfig.Init.DestInc = DMA_DINC_INCREMENTED;
  pNodeConfig.Init.SrcDataWidth = DMA_SRC_DATAWIDTH_HALFWORD;
  pNodeConfig.Init.DestDataWidth = DMA_DEST_DATAWIDTH_HALFWORD;
  pNodeConfig.Init.SrcBurstLength = 1;
  pNodeConfig.Init.DestBurstLength = 1;
  pNodeConfig.Init.TransferAllocatedPort = DMA_SRC_ALLOCATED_PORT0|DMA_DEST_ALLOCATED_PORT0;
  pNodeConfig.Init.TransferEventMode = DMA_TCEM_BLOCK_TRANSFER;
  pNodeConfig.TriggerConfig.TriggerPolarity = DMA_TRIG_POLARITY_MASKED;
  pNodeConfig.DataHandlingConfig.DataExchange = DMA_EXCHANGE_NONE;
  pNodeConfig.DataHandlingConfig.DataAlignment = DMA_DATA_RIGHTALIGN_ZEROPADDED;
  pNodeConfig.SrcAddress = 0;
  pNodeConfig.DstAddress = 0;
  pNodeConfig.DataSize = 0;
  /* Build ADC4_Node Node */
  ret |= HAL_DMAEx_List_BuildNode(&pNodeConfig, &ADC4_Node);
  /* Insert ADC4_Node to Queue */
  ret |= HAL_DMAEx_List_InsertNode_Tail(&ADC4_Queue, &ADC4_Node);

I don't understand why it fail:

  • Bootloader doesn't use DMA
  • Non secure App can configure DMA so I expect that DMA is correctly clocked
  • Memory is accessilbe from non secure APP

Thanks for your help

Douglas MILLER
ST Employee

This forum thread was marked by the moderator as needing a little more investigation, so a Support case was created in your name and will be handled off-line. Should anyone have any similar questions, please feel free to open a Support case directly at your myST portal: