<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.somlabs.com/index.php?action=history&amp;feed=atom&amp;title=How_to_enable_trace_feature_on_i.MX_RT</id>
	<title>How to enable trace feature on i.MX RT - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.somlabs.com/index.php?action=history&amp;feed=atom&amp;title=How_to_enable_trace_feature_on_i.MX_RT"/>
	<link rel="alternate" type="text/html" href="https://wiki.somlabs.com/index.php?title=How_to_enable_trace_feature_on_i.MX_RT&amp;action=history"/>
	<updated>2026-04-28T01:50:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://wiki.somlabs.com/index.php?title=How_to_enable_trace_feature_on_i.MX_RT&amp;diff=1261&amp;oldid=prev</id>
		<title>Pawelzbysinski at 08:20, 13 February 2019</title>
		<link rel="alternate" type="text/html" href="https://wiki.somlabs.com/index.php?title=How_to_enable_trace_feature_on_i.MX_RT&amp;diff=1261&amp;oldid=prev"/>
		<updated>2019-02-13T08:20:09Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:20, 13 February 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot;&gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This operation has to be done as early as possibly in init code.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This operation has to be done as early as possibly in init code.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Best &lt;/del&gt;way is to use &#039;&#039;SystemInitHook&#039;&#039; function, which is called in early init steps.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The best &lt;/ins&gt;way is to use &#039;&#039;SystemInitHook&#039;&#039; function, which is called in early init steps.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;By default, there is an empty &amp;#039;&amp;#039;SystemInitHook&amp;#039;&amp;#039; defined in CMSIS files, with &amp;#039;&amp;#039;__weak__&amp;#039;&amp;#039; linking attribute.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;By default, there is an empty &amp;#039;&amp;#039;SystemInitHook&amp;#039;&amp;#039; defined in CMSIS files, with &amp;#039;&amp;#039;__weak__&amp;#039;&amp;#039; linking attribute.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If linker finds &#039;&#039;SystemInitHook&#039;&#039; in any user files it will be used instead of default one.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If linker finds &#039;&#039;SystemInitHook&#039;&#039; in any user files it will be used instead of &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/ins&gt;default one.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So, to enable trace support, we need to define following function in any *.c file:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So, to enable trace support, we need to define following function in any *.c file:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l26&quot;&gt;Line 26:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 26:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Segger J-Trace trace functionality is supported &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;only &lt;/del&gt;by Ozone debugger from Segger.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Segger J-Trace trace functionality is supported by Ozone debugger from Segger.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It is important to properly configure trace parameters in Ozone to make it working, this could be done in menu &amp;#039;&amp;#039;Tools-&amp;gt;Trace settings&amp;#039;&amp;#039;. Recommended settings are shown on picture below.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It is important to properly configure trace parameters in Ozone to make it working, this could be done in menu &amp;#039;&amp;#039;Tools-&amp;gt;Trace settings&amp;#039;&amp;#039;. Recommended settings are shown on picture below.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Imxrt_trace_configuration.png|center|338px]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Imxrt_trace_configuration.png|center|338px]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Pawelzbysinski</name></author>
	</entry>
	<entry>
		<id>https://wiki.somlabs.com/index.php?title=How_to_enable_trace_feature_on_i.MX_RT&amp;diff=1260&amp;oldid=prev</id>
		<title>Pawelzbysinski: Created page with &quot;{{PageHeader|How to enable trace feature on i.MX RT}}  By default, trace pins are configured as GPIO. To use trace functionality, it is necessary to configure pinmux and enabl...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.somlabs.com/index.php?title=How_to_enable_trace_feature_on_i.MX_RT&amp;diff=1260&amp;oldid=prev"/>
		<updated>2019-02-12T19:39:28Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{PageHeader|How to enable trace feature on i.MX RT}}  By default, trace pins are configured as GPIO. To use trace functionality, it is necessary to configure pinmux and enabl...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{PageHeader|How to enable trace feature on i.MX RT}}&lt;br /&gt;
&lt;br /&gt;
By default, trace pins are configured as GPIO.&lt;br /&gt;
To use trace functionality, it is necessary to configure pinmux and enable clock to trace unit.&lt;br /&gt;
This operation has to be done as early as possibly in init code.&lt;br /&gt;
&lt;br /&gt;
Best way is to use &amp;#039;&amp;#039;SystemInitHook&amp;#039;&amp;#039; function, which is called in early init steps.&lt;br /&gt;
By default, there is an empty &amp;#039;&amp;#039;SystemInitHook&amp;#039;&amp;#039; defined in CMSIS files, with &amp;#039;&amp;#039;__weak__&amp;#039;&amp;#039; linking attribute.&lt;br /&gt;
If linker finds &amp;#039;&amp;#039;SystemInitHook&amp;#039;&amp;#039; in any user files it will be used instead of default one.&lt;br /&gt;
&lt;br /&gt;
So, to enable trace support, we need to define following function in any *.c file:&lt;br /&gt;
&lt;br /&gt;
 void SystemInitHook (void)&lt;br /&gt;
 {&lt;br /&gt;
    // configure trace port&lt;br /&gt;
    // configure pinmux&lt;br /&gt;
    IOMUXC_SetPinMux(IOMUXC_GPIO_B0_04_ARM_CM7_TRACE00, 0U);&lt;br /&gt;
    IOMUXC_SetPinMux(IOMUXC_GPIO_B0_05_ARM_CM7_TRACE01, 0U);&lt;br /&gt;
    IOMUXC_SetPinMux(IOMUXC_GPIO_B0_06_ARM_CM7_TRACE02, 0U);&lt;br /&gt;
    IOMUXC_SetPinMux(IOMUXC_GPIO_B0_07_ARM_CM7_TRACE03, 0U);&lt;br /&gt;
    IOMUXC_SetPinMux(IOMUXC_GPIO_B0_12_ARM_CM7_TRACE_CLK, 0U);&lt;br /&gt;
 &lt;br /&gt;
    // enable clock&lt;br /&gt;
    CLOCK_EnableClock(kCLOCK_Trace);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Segger J-Trace trace functionality is supported only by Ozone debugger from Segger.&lt;br /&gt;
It is important to properly configure trace parameters in Ozone to make it working, this could be done in menu &amp;#039;&amp;#039;Tools-&amp;gt;Trace settings&amp;#039;&amp;#039;. Recommended settings are shown on picture below.&lt;br /&gt;
[[File:Imxrt_trace_configuration.png|center|338px]]&lt;/div&gt;</summary>
		<author><name>Pawelzbysinski</name></author>
	</entry>
</feed>