Skip to main content
Associate II
October 23, 2023
Solved

Accessing the STM32H563 TPIU register in debugging mode causes chip errors

  • October 23, 2023
  • 1 reply
  • 2002 views

Hello,I encountered a strange problem while using STM32H563.

I tried using TPIU to output trace information.When I access the TPIU register(address:0xE0040000) in debugging mode, it will cause debugging to disconnect.Connection cannot be restored through NRST reset,but power on reset can connect to the debugger and the application runs normally.Could you assist me in using TPIU normally on STM32H563?

Best Regards.

This topic has been closed for replies.
Best answer by 兔兔_it

You should read RM0481 carefully.There is an enable bit DBGMCU_ CR.TRACE_ EN for trace port(TRACECK) in the register description of DBGMCU.Of course, bit DEMCR.TRCENA also needs to be set to 1.Then you can access the TPIU register normally.

1 reply

Foued_KH
ST Employee
October 23, 2023

Hello @兔兔_it , 

I think you should check the arm documentation : 

Enabling ITM trace on Serial Wire Viewer :
https://developer.arm.com/documentation/ka001424/1-0/?lang=en
Armv8-M processor system lockup due to TPIU (Trace Port Interface Unit) clock gating :
https://developer.arm.com/documentation/ka005320/1-0/?lang=en
Arm® Cortex®-M33 Processor Technical Reference Manual : 
https://developer.arm.com/documentation/100230/0100/?lang=en

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
兔兔_itAuthor
Associate II
October 24, 2023

Hello @Foued_KH 

Thank you very much for your answer.

I have quickly browsed through the documents you mentioned.I still don't know how ST to clock gate TRACECLKIN,and how to correctly access TPIU registers(Perhaps I need to first convert DEMCR.TRCENA to zero before accessing the TPIU register).Could you provide more specific documents? Looking forward to your reply.

Best regards.

兔兔_itAuthorBest answer
Associate II
October 27, 2023

You should read RM0481 carefully.There is an enable bit DBGMCU_ CR.TRACE_ EN for trace port(TRACECK) in the register description of DBGMCU.Of course, bit DEMCR.TRCENA also needs to be set to 1.Then you can access the TPIU register normally.