Skip to main content
Associate
April 1, 2026
Solved

Issue encountered when using OTSPI1 and GPDMA1 on the STM32U545 with the TrustZone option enabled.

  • April 1, 2026
  • 1 reply
  • 167 views

I have an application that uses the OCTOSPI1 interface to read from and write to an external NOR flash memory into an SRAM1 buffer. The read and write operations are performed in the NS section of the application. If I perform a transfer without using DMA, it works. However, if I try to use GPDMA1, I get a buffer with all data set to 0, with no error.

Additional information: the application works very well with GPDMA1 if I disable the MCU’s TrustZone mode.

I conclude that GPDMA is not fully initialized to work with TrustZone enabled, but I can’t figure out what’s missing despite my searches on this forum.
Any help would be greatly appreciated.

Best answer by Jocelyn RICARD

Hello @Phil5,

priv means privileged here. This is a state of cortex-m.

Reason why you need to set this configuration is because the RAM was setup by default as non secure and privileged with GTZC. If DMA is non privileged it cannot access privileged area.

If you change RAM configuration with GTZC to unprivileged, it will also solve your issue as both sides will be unprivileged 

Best regards 

Jocelyn

1 reply

Phil5Author
Associate
April 1, 2026

I solved the problem by initializing the DMA channel in private mode:

if (HAL_DMA_ConfigChannelAttributes(&handle_GPDMA1_Channel12_,

DMA_CHANNEL_NSEC | DMA_CHANNEL_PRIV) != HAL_OK)

{

Error_Handler();

}

Why private mode?

Jocelyn RICARD
Jocelyn RICARDBest answer
ST Employee
April 2, 2026

Hello @Phil5,

priv means privileged here. This is a state of cortex-m.

Reason why you need to set this configuration is because the RAM was setup by default as non secure and privileged with GTZC. If DMA is non privileged it cannot access privileged area.

If you change RAM configuration with GTZC to unprivileged, it will also solve your issue as both sides will be unprivileged 

Best regards 

Jocelyn

Phil5Author
Associate
April 2, 2026

Thank you, it works as expected now.