SWO on S32K344 with S32 Design Studio

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

SWO on S32K344 with S32 Design Studio

916件の閲覧回数
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 返答(返信)

864件の閲覧回数
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 件の賞賛
返信

837件の閲覧回数
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 件の賞賛
返信

713件の閲覧回数
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 件の賞賛
返信

669件の閲覧回数
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 件の賞賛
返信

475件の閲覧回数
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 件の賞賛
返信

458件の閲覧回数
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 件の賞賛
返信

441件の閲覧回数
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @jakub-holoubek,

I have sent you a private message through the community.

0 件の賞賛
返信

913件の閲覧回数
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 件の賞賛
返信