Home Learning Paths ECU Lab Assessments Interview Preparation Arena Pricing Log In Sign Up

TRACE32 Architecture: API, GUI, License

TRACE32 Component Architecture
  TRACE32 PowerView (GUI)
  ├── Window manager: Data, Var, Frame, Per, List, Trace, Register windows
  ├── CMM script interpreter: full scripting language for automation
  └── API: T32_Attach(), T32_Go(), T32_ReadMemory() — remote API via TCP port 20000
       │
       ↕ ICD (In-Circuit Debugger) protocol over USB or Ethernet
       │
  TRACE32 Hardware Probe
  ├── LA-7780: JTAG + ETM trace (CombiProbe) — captures ETM trace stream
  ├── µTrace:  JTAG only — single-core debugging without trace
  └── iC5000: JTAG + MCDS trace for Aurix — high-speed Nexus trace up to 4 GB/s

  License types:
  PowerDebug (JTAG only) < PowerTrace (JTAG + ETM trace) < ICD-full (all features)
  Floating license: TRACE32 License Manager daemon; locked per USB dongle or MAC

t32.cfg and Startup CMM Scripts

CMMt32.cfg
// t32.cfg: TRACE32 hardware configuration file (loaded at startup)
// Stored in %T32%\t32.cfg or project-specific config

OS=
ID=T32_2024
TMP=C:\T32\temp

// Hardware: Lauterbach LA-7780 via USB
PBI=USB
NODE=USB     // use first found USB probe; or NODE= for specific probe

// TCP API port (for remote/headless control)
RCL=NETTCP
PORT=20000

// Load custom startup script
SCREEN=
SCREEN.ON

// Autostart: connect and configure target on launch
// DO C:\projects\myecu\connect.cmm

Useful TRACE32 Window Layout for ECU Debugging

CMMlayout_setup.cmm
// Standard ECU debugging window layout — run after connecting

// Source + disassembly (split view)
WinPOS 0. 0. 80. 20.
List.Mix              // interleaved source + ASM

// Registers (auto-refresh while stopped)
WinPOS 0. 21. 40. 10.
Register /SpotLight   // highlights changed registers in red

// Call stack
WinPOS 41. 21. 80. 10.
Frame.view /Locals

// Memory: LMU RAM
WinPOS 0. 32. 60. 10.
Data.dump 0x70000000

// SFR browser: CAN
WinPOS 61. 32. 120. 10.
Per CAN0

// Variable watch
WinPOS 0. 43. 120. 10.
Var.Watch g_vehicleSpeed_mps g_CanRxCount g_faultFlags

// Save layout for future sessions
WinSAVE C:\projects\myecu\debug_layout.wnd

Remote and Headless TRACE32 via T32 API

Pythont32_remote.py
#!/usr/bin/env python3
# Control TRACE32 remotely via T32 API (TCP port 20000)
# pip install lauterbach-trace32-rcl

import lauterbach.trace32.rcl as t32

def connect():
    api = t32.connect(host="localhost", port=20000, packlen=1024)
    api.cmd("SYStem.Up")
    return api

def load_elf(api, elf_path: str):
    api.cmd(f'Data.LOAD.Elf "{elf_path}" /RELPATH')
    api.cmd("SYStem.Reset")

def run_to_function(api, func: str, timeout_ms=5000):
    api.cmd(f"Break.Set {func} /Program")
    api.cmd("Go")
    api.wait(timeout_ms)  # waits until halted or timeout

def read_variable(api, var_name: str) -> int:
    return api.fnc.var_value(var_name)

def run_test(elf_path: str, expected_speed: float) -> bool:
    api = connect()
    load_elf(api, elf_path)
    run_to_function(api, "App_MainFunction")
    actual = read_variable(api, "g_vehicleSpeed_mps")
    print(f"g_vehicleSpeed_mps = {actual} (expected {expected_speed})")
    api.disconnect()
    return abs(actual - expected_speed) < 0.1

# Used in CI: pytest calls run_test() with expected values from requirements
# TRACE32 must be running and connected; CI script starts t32mppc.exe before pytest

Summary

t32.cfg selects the physical probe (USB or Ethernet), enables the TCP API on port 20000, and optionally runs a startup CMM script. The TCP API enables CI integration: TRACE32 runs headless, a Python test script connects via the rcl library, loads an ELF, runs to specific functions, and asserts expected variable values — hardware-in-the-loop regression testing without a human operator. Window layouts saved with WinSAVE reload the complete debugging workspace instantly, saving setup time at every debug session.

🔬 Deep Dive — Core Concepts Expanded

This section builds on the foundational concepts covered above with additional technical depth, edge cases, and configuration nuances that separate competent engineers from experts. When working on production ECU projects, the details covered here are the ones most commonly responsible for integration delays and late-phase defects.

Key principles to reinforce:

  • Configuration over coding: In AUTOSAR and automotive middleware environments, correctness is largely determined by ARXML configuration, not application code. A correctly implemented algorithm can produce wrong results due to a single misconfigured parameter.
  • Traceability as a first-class concern: Every configuration decision should be traceable to a requirement, safety goal, or architecture decision. Undocumented configuration choices are a common source of regression defects when ECUs are updated.
  • Cross-module dependencies: In tightly integrated automotive software stacks, changing one module's configuration often requires corresponding updates in dependent modules. Always perform a dependency impact analysis before submitting configuration changes.

🏭 How This Topic Appears in Production Projects

  • Project integration phase: The concepts covered in this lesson are most commonly encountered during ECU integration testing — when multiple software components from different teams are combined for the first time. Issues that were invisible in unit tests frequently surface at this stage.
  • Supplier/OEM interface: This is a topic that frequently appears in technical discussions between Tier-1 ECU suppliers and OEM system integrators. Engineers who can speak fluently about these details earn credibility and are often brought into critical design review meetings.
  • Automotive tool ecosystem: Vector CANoe/CANalyzer, dSPACE tools, and ETAS INCA are the standard tools used to validate and measure the correct behaviour of the systems described in this lesson. Familiarity with these tools alongside the conceptual knowledge dramatically accelerates debugging in real projects.

⚠️ Common Mistakes and How to Avoid Them

  1. Assuming default configuration is correct: Automotive software tools ship with default configurations that are designed to compile and link, not to meet project-specific requirements. Every configuration parameter needs to be consciously set. 'It compiled' is not the same as 'it is correctly configured'.
  2. Skipping documentation of configuration rationale: In a 3-year ECU project with team turnover, undocumented configuration choices become tribal knowledge that disappears when engineers leave. Document why a parameter is set to a specific value, not just what it is set to.
  3. Testing only the happy path: Automotive ECUs must behave correctly under fault conditions, voltage variations, and communication errors. Always test the error handling paths as rigorously as the nominal operation. Many production escapes originate in untested error branches.
  4. Version mismatches between teams: In a multi-team project, the BSW team, SWC team, and system integration team may use different versions of the same ARXML file. Version management of all ARXML files in a shared repository is mandatory, not optional.

📊 Industry Note

Engineers who master both the theoretical concepts and the practical toolchain skills covered in this course are among the most sought-after professionals in the automotive software industry. The combination of AUTOSAR standards knowledge, safety engineering understanding, and hands-on configuration experience commands premium salaries at OEMs and Tier-1 suppliers globally.

← PreviousHands-On: First Debug SessionNext →PowerView Scripting (PRACTICE)