Skip to the content
2 layers35 × 24 mmJT2Mini, the printed circuit board in 3D

Install and enable the Embedded Trace Module (ETM) for real-time debug

Size
35 × 24 mm
Copper layers
2
Thickness
1.6 mm
Parts
9
Nets
16
Pads
51
Tracks, vias
116, 33
Pours
1
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
14 Jun 2022
Updated
19 Apr 2024

Overview

JT2Mini is an open-source printed circuit board by drzwave, from the drzwave/etm_zwave repository on GitHub. It is a 2-layer board of 35 × 24 mm with 9 parts on 16 nets, routed with 116 tracks and 33 vias.

README

README.md

etm_zwave

Z-Wave Embedded Trace Module (ETM) debugging example code

The ETM is an invaluable tool for debugging embedded code and measuring code coverage in real-time. More details on ETM can be found on the ARM and Segger web sites.

The example code here is provided AS-IS and without warrantee.

Setup

Hardware

  • Z-Wave Developers Kit - WSTK and a Radio board
    • Or your board assuming it has the JTrace pins
  • Segger J-Trace Pro
    • The Cortex-M model is sufficient for Z-Wave debug (the cheaper one)
    • Cables and power source
  • J-Trace 20 pin connector pinout: J-Trace Pinout
    • 0.05" (1.27mm) spacing
  • Connect the DUT to the J-Trace and ensure the Target Power is green
    • Note that the 20 pin debug cable should be as short as possible - ideally just 2-3"
    • If you get LTRACE invalid frame errors on the trace, the signal quality across the ribbon cable is probably not good.
    • Try lowering the clock speed, adjusting the timing in JTrace and that all ground pins are connected.

JT2Mini Adapter

  • See the Adapter folder for the J-Trace to MiniSimplicity adapter.

Software

  • Simplicity Studio (for building the code)
  • Segger Ozone (supports ETM trace)
    • SVD files for the respective EFR32 - see the SVD folder
  • This repo contains JLink scripts and other files needed for tracing

Step by Step Instructions

  1. Clone this repo into your Z-Wave project
  2. Build the project in SSv5
  3. Open Ozone
  4. Click on the New Project wizard and select the .AXF file for the project. Ozone will find the source code files via the .axf file.
  5. Click on File->Edit Project file (opens the .jdebug file)
  6. Add the following lines to the end of the OnProjectLoad section
    1. Project.SetOSPlugin("FreeRTOSPlugin_ARM");
    2. For xG13 projects:
      1. Project.AddSvdFile ("$(ProjectDir)/etm_zwave/svd/EFR32XG13XFULL.svd");
    3. For xG14 projects:
      1. Project.AddSvdFile ("$(ProjectDir)/etm_zwave/svd/EFR32XG14XFULL.svd");
    4. For xG23 projects:
      1. Project.AddSvdFile ("$(ProjectDir)/etm_zwave/svd/EFR32XG23A000F512GM40_SEQ_M33.svd");
    5. For modules (ZGM130,ZGM230), just use the base-SoC part which has the same internal registers which is what the .SVD defines
  7. Scroll down to the BeforeTargetConnect section
    1. uncomment the call and the }
    2. Add ONE of the following lines that matches your Z-Wave chip :
      1. Project.SetJLinkScript("$(ProjectDir)/etm_zwave/ZGM130S_Traceconfig.JLinkScript");
      2. Project.SetJLinkScript("$(ProjectDir)/etm_zwave/ZG23_Traceconfig.JLinkScript");
  8. Enable Tracing
    1. Tools->Trace Settings Trace Settings
    2. Trace Source is Trace Pins
    3. CPU Frequency is 39MHz
    4. Trace Port Width is ideally 4 but if you have limited pinout, 2 or even 1 will work but will stall the CPU potentially altering the program flow
    5. Increase the Maximum Instruction Count to at least 100M
    6. Trace Timing should be default - the script alters the slew rate of the GPIOs which should be sufficient with a short cable
  9. Click on View -> Instruction Trace, Code Profile, Timeline and any other windows desired
  10. Click on Download and Reset Program
  11. Review the console window and look for any errors
  12. The DUT should stop at the beginning of Main() and there is data in the Timeline

Software Project Recommendations

  • Do not use -flto optimization when debugging. Link Time Optimization (LTO) mashes the code making Ozone unable to match the PC with the C source code.
  • Recommend installing Z-Wave DEBUG in the SLC - This will set the -Og optimzation option which will make the code much easier to trace and debug but requires more FLASH.
    • In Simplicity Studio, click on the .slcp file for your project, then Software Components, then scroll down (or search) for Z-Wave Debug and click on it, then install it. Do NOT ship production code with Z-Wave Debug installed! Uninstall it for the final production release.
    • May also want to install Z-Wave Debug Print and uncomment the #define DEBUGPRINT in app.c. This also requires IO Stream and a UART. This enables print statements to help with debugging. The print statements are sent out the uart and are visible on the SSv5 console window.

TroubleShooting

  • Ozone will give all sorts of different errors that most often are caused by Signal Integrity issues
    • LTRACE (Time since start: 0.139 656, Thread=ETM1): Unknown trace data packet detected
    • No trace clock present, trace may not work correctly.
    • LTRACE (Time since start: 0.074 546, Thread=ETM1): Trace overflow detected. Trace packets may have been lost.
    • General flakeyness where restarting Ozone yields different errors or works sometimes but not all the time
  • Signal Integrity of TRACECLK and TRACEDATA
    • Use short cables (less than 6")
    • Connect EVERY ground pin on the 20-pin header to the DUT if possible or add additional GND wires
    • View the TRACECLK and TRACEDATA pins on a good scope with good grounds
      • Adjust the slew rate of the EFR GPIO port to try to make the signals cleaner or sharper (See the .JLinkScript file for an example)
    • Adjust the timing in the J-Trace - Ozone - Trace Settings - Trace Timing
      • If the cable is short, the trace timing timing should not need to be adjusted as the EFR provides good setup/hold

Reference Documents

Contacts - Eric Ryherd - Author

  • File an Issue to report a problem or make a suggestion.

Parts

9
QtyValueFootprintReferences
3Conn_01x02Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ3, J4, J5
3Jumper_2_OpenJumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mmJP1, JP2, JP3
13220-10-0300-00Connector_PinHeader_1.27mm:PinHeader_2x05_P1.27mm_Vertical_SMDJ2
1CBE224JT2Mini:PinHeader_2x10_P1.27mm_GreenconnJ1
1Conn_01x03Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ6

Similar boards

  • 2 layers103 × 30.5 mmTS Back Endcap, the printed circuit board in 3D

    TS Back Endcap

    EEVengers/ThunderScope

    ThunderScope GitHub Repo

    9 parts1.3kMIT
  • 2 layers31.8 × 47.6 mmNGC 38 connector, the printed circuit board in 3D

    NGC 38 connector

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    9 parts1.2k
  • 2 layers24 × 27.3 mmExpansion Card Retrofit, the printed circuit board in 3D

    Expansion Card Retrofit

    FrameworkComputer/ExpansionCards

    Reference designs and documentation to create Expansion Cards for the Framework Laptop

    9 parts1.1kCC-BY-4.0
  • 2 layers15.6 × 17.3 mmSKR Mini TFT Thermistor Board, the printed circuit board in 3D

    SKR Mini TFT Thermistor Board

    VoronDesign/Voron-Hardware

    Cool Hardware designed by the Voron Design group

    9 parts1.1kGPL-3.0
  • 2 layers39.1 × 49.5 mmLearnoliver, the printed circuit board in 3D

    Learnoliver

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    9 parts915
  • 2 layers17.4 × 16.9 mmToolhead, the printed circuit board in 3D

    Toolhead

    tanaes/whopping_Voron_mods

    9 parts787GPL-3.0
  • 2 layers9.8 × 108 mmExpander, the printed circuit board in 3D

    Expander

    wntrblm/Castor_and_Pollux

    A Juno-inspired dual oscillator

    9 parts587
  • 2 layersKeyboard after, the printed circuit board in 3D

    Keyboard after

    adamws/kicad-kbplacer

    KiCad plugin for automatic keyboard's key placement and routing

    9 parts547GPL-3.0

Questions

How big is the JT2Mini PCB?

It measures 35 × 24 mm and has 2 copper layers, 1.6 mm thick.

What parts does the JT2Mini use?

9 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the JT2Mini KiCad files?

From the drzwave/etm_zwave repository on GitHub, at the commit this page was made from: the board is adapter/JT2Mini/JT2Mini.kicad_pcb and its schematic adapter/JT2Mini/JT2Mini.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the JT2Mini design in my own project?

Its repository states no licence, so its author keeps all rights: ask drzwave before reusing the design.