How to Sync Trace
In this topic:
For synchronous tracing of two Infineon AURIX devices, two winIDEA Workspaces have to be created, a Master Workspace and a Slave Workspace. Add-on modules are optional and not an essential part of the sync setup. Both iC7max/iC5700 Hubs are connected via the FBridge cable which enables synchronous trace.
The Sync Trace functionality is compatible with most microcontroller architectures. However, specific requirements must be met for proper implementation. For further details, please contact Technical Support. |
For a general overview, refer to Multi-SoC Synchronization.
•2x iC7max/iC5700 BlueBox Debuggers with Hub
•2x Active Probes
•1x FBridge Cable
•2x CAN/LIN Add-on modules (optional)
•CAN Cable(s)
First follow the Hardware, Master, and Slave winIDEA Workspace Configuration in Sync Debug How-t guide.
Configure the Recorder in View | Analyzer | Analyzer Configuration. |
•Enable:
oFNet
oProfiler
oTimer Interpolation
oGenerate time synchronization messages
o(for Workspace with Infineon DAP/DAPE II) Upload while sampling
•Start - On Trigger
Configure the Manual Hardware Trigger via the Configure button. |
Configure the MCDS page. |
•MUX - Select according to the trace use case.
•Time stamps:
oSource - tsu_rel.
otsu_rel Prescaler value (TSUPRSCL) - Select according to the trace use case. A TSUPRSCL value of 1 yields the maximum trace timing accuracy.
•EMEM Trigger Position set to End. The Emulation Memory of the AURIX target is used as FIFO for the trace data streaming (Upload while sampling) to the iC7max/iC5700.
Synchronized trace only works when using tsu_rel time stamping. TICK time stamping is not supported for synchronized trace. |
Configure the MCX page. |
•Trigger - cnt_trig_15 MCX counter 15, in conjunction with EVT23, is used to enable tsu_rel time stamp messaging only while the core (attached to POB X) is executing instructions (i.e., is running).
•Event - EVT8 is connected to tsu_tc_trig (i.e., to the TSUPRSCL Prescaler). This means that a tsu_rel time stamp sync message is generated periodically upon every underflow of the TSUPRSCL prescaler.
•Action - trace_done set to NEVER, which is required for Upload while sampling mode.
The sample Python script below performs the Synchronized Trace Operation. See winIDEA SDK Documentation for recent SDK Examples updates.
import os import sys import isystem.connect as ic
mydir = <User-specific Workspace Location>
# Master Workspace location workspaceLocation1 = os.path.join(mydir, 'Demo1/winidea/Tasks_ISR2_States_NoOnInstr', 'demo1_mst_agbt.xjrf')
# Master TRD file name trdName1 = 'demo1_mst_agbt.trd'
# Slave Workspace location workspaceLocation2 = os.path.join(mydir, 'Demo2/winidea', 'demo2_slv.xjrf')
# Slave TRD file name trdName2 = 'demo2_slv.trd'
# Create all necessary Objects to control the Master. cmgr_MST = ic.ConnectionMgr() connectionConfig = ic.CConnectionConfig() connectionConfig.workspace(workspaceLocation1) cmgr_MST.connect(connectionConfig) debug_MST = ic.CDebugFacade(cmgr_MST) ideCtrl_MST = ic.CIDEController(cmgr_MST) traceDoc_MST = ic.CTraceController(cmgr_MST, trdName1, 'w')
# Create all necessary Objects to control the Slave. cmgr_SLV = ic.ConnectionMgr() connectionConfig = ic.CConnectionConfig() connectionConfig.workspace(workspaceLocation2) cmgr_SLV.connect(connectionConfig) ideCtrl_SLV = ic.CIDEController(cmgr_SLV) traceDoc_SLV = ic.CTraceController(cmgr_SLV, trdName2, 'w')
# Adjust BlueBox (iC5700) Time Offset (just needed for aligned display in the Profiler Timeline). outParams = ic.StrStrMap() inParams = ic.StrStrMap() ideCtrl_MST.serviceCall("/IOPEN/HW.HW.GetBBTime", inParams, outParams) timeValue = outParams['Time']
# Adjust Time Offset of Master BlueBox. ideCtrl_MST.setOption_str('/Document/' + trdName1 + '/Loader.HW.Data.TimerOffsetActivation', timeValue) # Adjust Time Offset of Master BlueBox. ideCtrl_SLV.setOption_str('/Document/' + trdName2 + '/Loader.HW.Data.TimerOffsetActivation', timeValue)
# Start Trace Recorder on Master and Slave. Both wait for a common Trace Trigger. traceDoc_MST.start() traceDoc_SLV.start()
# Start Master CPU. This also start Slave CPU due to sync debug setup. debug_MST.run()
# Inject SYNC Trace start on Trigger Channel 1 (i.e. TraceTrig). ideCtrl_MST.serviceCall("/IOPEN/HW.FNet.FTrig_Inject", "TC:1")
# Done. Disconnect from both Workspaces again. cmgr_SLV.disconnect() cmgr_MST.disconnect() |
The image below shows the Profiler Timeline windows of a synchronized dual-AURIX trace recording. Besides the trace of the AUTOSAR OS tasks and ISR2s, the CAN frame is also recorded on both SoCs (also synchronized to AURIX MCDS trace).
The next image zooms into a specific section of the Profiler Timeline window of the previous example:
•The top shows the OS ISR2 and CAN bus activities on the Master Workspace.
•The bottom shows the OS thread (task or ISR2) and CAN bus activities on the Slave Workspace.
The scenario shown here is the following:
1.The Master Workspace sends out a CAN frame with ID 0x110. The transmit completion causes a TX ISR2, CANSR0_ISR (blue cursor).
2.The Slave Workspace receives the CAN frame 0x110, issues an RX interrupt, CANSR4_ISR, which spawns an OS thread (i.e. task), Rte_Event_Task. A Runnable within this task (not shown here) responds by sending out a CAN frame with ID 0x111. The transmit completion causes a TX ISR2, CANSR0_ISR (yellow cursor).
3.The Master Workspace receives this CAN frame 0x111 and issues an RX interrupt, CANSR4_ISR (yellow cursor).
•Sync Debug on two Infineon AURIX devices