Skip to main content
Associate III
June 28, 2025
Question

Accessing UART in Nonsecure region

  • June 28, 2025
  • 2 replies
  • 418 views

I am using stm32h563zi microcontroller (Nucleo-H563zi) in this i have created project  using trust zone. In this aim was to use UART4 to transmit message. But i am unable to transmit, i have uploaded main.c of secure and nonsecure. what is the possible error in not transmitting the message usign UART4 in nonsecure.

2 replies

Jocelyn RICARD
ST Employee
July 10, 2025

Hello @Shubham08 ,

Please first make all non secure SRAM and non secure peripheral access to privilege.

Also please check same code will work in a non TrustZone environment.

Best regards

Jocelyn

Associate
July 3, 2026

Hi Jocelyn,

Re: “Please first make all non secure SRAM and non secure peripheral access to privilege”

Any chance you could be specific? Maybe a code snippet that demonstrates this, and in which file it belongs?

I am having issues myself with a button interrupt working in Non-TZ, then TZ, but same code is not working in the OEMiRoT TZ example. Hopefully some more insight into the exact commands that ‘implement’ a new peripheral into the TZ architecture will show me what I’m missing. 

Shubham08Author
Associate III
July 13, 2025

Hii Jocelyn RICHARD,

Can you provide some documentation which will help in understandign the flow or working of trustzone. I have followed the code in example selector but i am not getting how it is done. 

e.g I want to print "Hello world" using uart 4 and print "Currently in truztzone" using uart2. I have configured uart4 in non_secure zone and uart2 in secure zone. after selecting peripheral in .ioc and generating code in stm32cube what will be the flow of the code to achieve the aim to print.

 

Regards,

Shubham