cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing the STM32H563 TPIU register in debugging mode causes chip errors

兔兔
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

3 REPLIES 3
Foued_KH
ST Employee

Hello @兔兔 , 

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.

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.

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.