SWO on S32K344 with S32 Design Studio

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SWO on S32K344 with S32 Design Studio

1,207 次查看
jakub-holoubek
Contributor II

Hi is there any complete example how to make SWO running using S32 design studio? How to configure pinMUX, clocks, etc? I've tried multiple examples with J-link and PEMicro debuggers, but with no success. I've been using also retarget_itm.c library for ITM configuration (delivered by NXP). 

标记 (4)
0 项奖励
回复
8 回复数

1,155 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @jakub-holoubek,

I believe this is a question for SEGGER instead. There is no other example for configuring this with S32DS specifically, but you can use the following posts as guidance: 

Also, SEGGER has a dedicated page in their knowledge base for their J-Link SWO Viewer: J-Link SWO Viewer - SEGGER Knowledge Base & UM08001 J-Link / J-Trace User Guide - SEGGER Knowledge Base.

Best regards,
Julián

0 项奖励
回复

1,128 次查看
jakub-holoubek
Contributor II

Hi @Julián_AragónM,
thanks for reply. I've checked that tutorials. One issue I've got is that MCU goes to the hard fault once I want to write/read some TPIU registers.

 

For example this code:

*((volatile unsigned *)(ITM_BASE + 0x400F0)) = 0x00000002; /* "Selected PIN Protocol Register": Select which protocol to use for trace output (2: SWO NRZ, 1: SWO Manchester encoding) */
  *((volatile unsigned *)(ITM_BASE + 0x40010)) = SWOPrescaler; /* "Async Clock Prescaler Register". Scale the baud rate of the asynchronous output */


Once trying to set one of those registers the MCU goes to hard fault. I've found in reference manual of ARM M7 core, that TPIU is not configured in M7 cores - can you confirm that? 
Or is there any other register I have to set before writing into TPIU related registers?

0 项奖励
回复

1,004 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @jakub-holoubek,

Are you using the S32K344 evaluation board? By default, all TRACE signals are DISABLED.

SWO-TRACE-K344EVB.png

Best regards,
Julián

0 项奖励
回复

960 次查看
jakub-holoubek
Contributor II

Hi, @Julián_AragónM,

yes, I'm using S32K3-T-BOX board. Those TRACE signals are valid for ETM interface. However I need to communicate using ITM through JTAG_TDO pin - so it is routed to JTAG connector. That pin is used for SWO communication in case the SWD protocol is used instead of JTAG - which is my case.

0 项奖励
回复

766 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @jakub-holoubek,

I apologize for the late reply. This may be an issue with the implementation of trace and our architecture. There is an internal discussion with the SW team now. I will try to update you if anything else comes up.

As of now, you can create a new project in S32DS with prinft ITM, but the retarget_itm library does not work as expected.

Best regards,
Julián

0 项奖励
回复

749 次查看
jakub-holoubek
Contributor II

Hi @Julián_AragónM, ok thanks. I'm aware of that retarget_itm library. However my suspicion is that there is some issue with TPIU related registers. Which are probably accessed by debugger itself:

Cortex m7 TPIU registersCortex m7 TPIU registers
In case I'm setting them from the code the MCU goes to hard fault. And same happens also in case I connect the debugger (tried J-Link, PEMicro, Lauterbach) and want to enable the SWO through debugger's settings - MCU goes into hard fault. 

0 项奖励
回复

732 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @jakub-holoubek,

I have sent you a private message through the community.

0 项奖励
回复

1,204 次查看
jakub-holoubek
Contributor II

For example in this article: Single Wire Output (SWO) support within S32 Design Studio, enabled by PEmicro's GDB Server It would be nice have more details, including sources. 

0 项奖励
回复