<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en" style="--code-editor-font: var(--default-mono-font, "GitLab Mono"), JetBrains Mono, Menlo, DejaVu Sans Mono, Liberation Mono, Consolas, Ubuntu Mono, Courier New, andale mono, lucida console, monospace;">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>
GitLab
</title>
<style data-premailer="ignore" type="text/css">
a { color: #1068bf; }
</style>
<style>img {
max-width: 100%; height: auto;
}
body {
font-size: .875rem;
}
body {
-webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px;
}
body {
font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; font-size: inherit;
}
</style>
</head>
<body style="font-size: inherit; -webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px; font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";">
<div class="content">
<p class="details" style="font-style: italic; color: #626168;">
<a href="https://gitlab.rtems.org/ar-in0">Armaan Chowfin</a> created an issue: <a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5537">#5537</a>
</p>
<div class="md" style="position: relative; z-index: 1; color: #3a383f; word-wrap: break-word;">
<h1 id="user-content-summary" dir="auto" style="margin-top: 0; margin-bottom: 1rem; font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em; line-height: 1.25; color: #18171d;" align="initial">Summary<a href="#summary" aria-label="Link to heading 'Summary'" data-heading-content="Summary" class="anchor" style="margin-top: 0;"></a>
</h1>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">RTEMS has support for the following MCUs in the TMS570 family, both are ARM Cortex-R:</p>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0 0 1rem; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
<p style="color: #3a383f; margin: 0 0 1rem;">TMS570LS31x: RTEMS upstream has code to build binaries for both internal SRAM and external SDRAM.</p>
</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
<p style="color: #3a383f; margin: 0 0 1rem;">TMS570LC43x: Binaries can be built only for the HDK version of the board with external SDRAM. <strong style="font-weight: 600; margin-top: 0;">No current workflow to run binaries from internal SRAM.</strong> Below I describe my setup, tested on ubuntu24.04.</p>
<p style="color: #3a383f; margin: 0 0 1rem;"><a class="no-attachment-icon gfm" href="https://gitlab.rtems.org/-/project/26/uploads/1cefbe8b2bd64f1ac6a2234f5b75ae03/image.png" target="_blank" rel="noopener noreferrer" data-canonical-src="/uploads/1cefbe8b2bd64f1ac6a2234f5b75ae03/image.png" data-link="true" style="margin-top: 0;"><img src="https://gitlab.rtems.org/-/project/26/uploads/1cefbe8b2bd64f1ac6a2234f5b75ae03/image.png" alt="image.png" width="907" height="416" data-canonical-src="/uploads/1cefbe8b2bd64f1ac6a2234f5b75ae03/image.png" class="gfm" style="max-width: 100%; height: auto; margin-top: 0; vertical-align: baseline; object-fit: contain; object-position: top;"></a></p>
</li>
</ul>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Workflow requires some upstream fixes (step 1). Request suggestions/corrections. See <a href="https://github.com/ar-in0/notes.d/blob/main/tms570-sram.gdb" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">gdb script</a> comments for more details.</p>
<h1 id="user-content-workflow" dir="auto" style="margin-top: 2rem; margin-bottom: 1rem; font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em; line-height: 1.25; color: #18171d;" align="initial">Workflow<a href="#workflow" aria-label="Link to heading 'Workflow'" data-heading-content="Workflow" class="anchor" style="margin-top: 0;"></a>
</h1>
<ol dir="auto" style="text-align: initial; margin: 0 0 1rem; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
<p style="color: #3a383f; margin: 0 0 1rem;">Add a custom config to openOCD: <a href="https://github.com/ar-in0/notes.d/blob/main/ti_launchxl2_570lc43x.cfg" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;"><code style="font-size: 90%; color: inherit; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 0.125rem 0.25rem;">usr/share/openocd/board/ti_launchxl2_570lc43.cfg</code></a></p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-canonical-lang="bash" class="code highlight js-syntax-highlight language-shell" v-pre="true" style="display: block; font-size: 14px; color: #3a383f; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 1rem; padding: 12px; border: 1px solid #dcdcde;"><code style="font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; overflow-wrap: normal; padding: unset;"><span id="LC1" class="line" lang="shell" style="margin-top: 0;"><span class="c" style="margin-top: 0;"># connect openOCD gdb server to launchpad debugger</span></span>
<span id="LC2" class="line" lang="shell"><span class="c" style="margin-top: 0;"># -d3 for debug logs</span></span>
<span id="LC3" class="line" lang="shell">openocd <span class="nt" style="margin-top: 0;">-d3</span> <span class="nt">-f</span> board/ti_launchxl2_570lc43.cfg</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
<p style="color: #3a383f; margin: 0 0 1rem;">Link all ELF sections to RAM_INT: Replace current <code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; margin-top: 0; font-weight: inherit; overflow-wrap: break-word; white-space: break-spaces; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: keep-all; padding: 0.125rem 0.25rem;">tms570lc4357_hdk.linkcmds</code> contents with <code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; font-weight: inherit; overflow-wrap: break-word; white-space: break-spaces; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: keep-all; padding: 0.125rem 0.25rem;">tms570ls3137_hdk_intram.linkcmds</code></p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-canonical-lang="bash" class="code highlight js-syntax-highlight language-shell" v-pre="true" style="display: block; font-size: 14px; color: #3a383f; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 1rem; padding: 12px; border: 1px solid #dcdcde;"><code style="font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; overflow-wrap: normal; padding: unset;"><span id="LC1" class="line" lang="shell" style="margin-top: 0;"><span class="c" style="margin-top: 0;"># config.ini</span></span>
<span id="LC2" class="line" lang="shell"><span class="o" style="margin-top: 0;">[</span>arm/tms570lc4357_hdk]</span>
<span id="LC3" class="line" lang="shell"></span>
<span id="LC4" class="line" lang="shell"><span class="c" style="margin-top: 0;"># bugfix in arm/shared/start.S: `bsp_start_hook_0`</span></span>
<span id="LC5" class="line" lang="shell"><span class="c" style="margin-top: 0;"># without this change, code will jump to tms570_memory_init() at runtime</span></span>
<span id="LC6" class="line" lang="shell"><span class="c" style="margin-top: 0;"># and clear the SRAM region where we loaded our rtems binary.</span></span>
<span id="LC7" class="line" lang="shell">cmp r1, r0 <span class="c" style="margin-top: 0;"># change to cmp r0, r1</span></span>
<span id="LC8" class="line" lang="shell">blt xx <span class="c" style="margin-top: 0;"># change to blo xx (blt xx works, but might break flash, external sdram builds)</span></span>
<span id="LC9" class="line" lang="shell"></span>
<span id="LC10" class="line" lang="shell"><span class="c" style="margin-top: 0;"># configure and build</span></span>
<span id="LC11" class="line" lang="shell">./waf configure <span class="nt" style="margin-top: 0;">--prefix</span><span class="o">=</span><path> <span class="nt">--rtems-config</span><span class="o">=</span><path></span>
<span id="LC12" class="line" lang="shell">./waf build</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
<p style="color: #3a383f; margin: 0 0 1rem;">Connect gdb to debug server using <a href="https://github.com/ar-in0/notes.d/blob/main/tms570-sram.gdb" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">gdb script</a>: Recommend copying it to the same directory as test executables.</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-canonical-lang="bash" class="code highlight js-syntax-highlight language-shell" v-pre="true" style="display: block; font-size: 14px; color: #3a383f; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 1rem; padding: 12px; border: 1px solid #dcdcde;"><code style="font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; overflow-wrap: normal; padding: unset;"><span id="LC1" class="line" lang="shell" style="margin-top: 0;"><span class="c" style="margin-top: 0;"># connects to openOCD, loads to SRAM, ARM register setup. </span></span>
<span id="LC2" class="line" lang="shell"><span class="c" style="margin-top: 0;"># See comments in gdb script.</span></span>
<span id="LC3" class="line" lang="shell">arm-rtems7-gdb <span class="nt" style="margin-top: 0;">-x</span> tms570-sram.gdb hello.exe</span>
<span id="LC4" class="line" lang="shell"></span>
<span id="LC5" class="line" lang="shell"><span class="c" style="margin-top: 0;"># run the program from RAM</span></span>
<span id="LC6" class="line" lang="shell"><span class="o" style="margin-top: 0;">(</span>gdb<span class="o">)</span> c</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
</li>
</ol>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">To observe uart output, use picocom/minicom and listen at tty/acm0 with baud 115200. Do this before step 3.</p>
<h1 id="user-content-additional-info-debugging" dir="auto" style="margin-top: 2rem; margin-bottom: 1rem; font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em; line-height: 1.25; color: #18171d;" align="initial">Additional Info, Debugging<a href="#additional-info-debugging" aria-label="Link to heading 'Additional Info, Debugging'" data-heading-content="Additional Info, Debugging" class="anchor" style="margin-top: 0;"></a>
</h1>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Some arm cortex-R core registers are not memory mapped like cortex-M and need different commands:</p>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0 0 1rem; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
<code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 0.125rem 0.25rem;">mrc</code>: read register, <code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 0.125rem 0.25rem;">mcr</code>: write register.</li>
</ul>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-canonical-lang="bash" class="code highlight js-syntax-highlight language-shell" v-pre="true" style="display: block; font-size: 14px; color: #3a383f; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 1rem; padding: 12px; border: 1px solid #dcdcde;"><code style="font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; overflow-wrap: normal; padding: unset;"><span id="LC1" class="line" lang="shell" style="margin-top: 0;"><span class="c" style="margin-top: 0;"># https://developer.arm.com/documentation/ddi0363/g/System-Control/About-system-control/MPU-control-and-configuration?lang=en </span></span>
<span id="LC2" class="line" lang="shell">monitor arm mrc 15 0 6 0 2 <span class="c" style="margin-top: 0;"># read IFAR: address of faulting instruction</span></span>
<span id="LC3" class="line" lang="shell"></span>
<span id="LC4" class="line" lang="shell"><span class="c" style="margin-top: 0;"># see https://developer.arm.com/documentation/ddi0363/g/System-Control/Register-descriptions/Fault-Status-and-Address-Registers?lang=en </span></span>
<span id="LC5" class="line" lang="shell">monitor arm mrc 15 0 5 0 1 <span class="c" style="margin-top: 0;"># ifsr: cause of fault</span></span>
<span id="LC6" class="line" lang="shell"></span>
<span id="LC7" class="line" lang="shell"><span class="c" style="margin-top: 0;"># ARM organizes memory into regions with certain memory types, each has some default permissions</span></span>
<span id="LC8" class="line" lang="shell"><span class="c" style="margin-top: 0;"># To modify region permissions we must select region -> check base address of region -> modify permissions. See https://developer.arm.com/documentation/ddi0363/g/Memory-Protection-Unit/About-the-MPU/Memory-regions?lang=en</span></span>
<span id="LC9" class="line" lang="shell">monitor arm mrc 15 0 6 2 0 2 <span class="c" style="margin-top: 0;"># select region 2 in "memory region number regiser"</span></span>
<span id="LC10" class="line" lang="shell">monitor arm mrc 15 0 6 1 0 <span class="c" style="margin-top: 0;"># get region base address of selected region</span></span>
<span id="LC11" class="line" lang="shell"></span>
<span id="LC12" class="line" lang="shell"><span class="c" style="margin-top: 0;"># For tms570 launchpad internal SRAM, returns 4875 i.e. 0b0001 0011 0000 1011: bit 12 is set; region 2 is an XN region by default ("execute never", no instruction fetch allowed). See https://developer.arm.com/documentation/ddi0363/g/System-Control/Register-descriptions/c6--MPU-memory-region-programming-registers?lang=en</span></span>
<span id="LC13" class="line" lang="shell">monitor arm mrc 15 0 6 1 4 <span class="c" style="margin-top: 0;"># get selected region perms from "region control access register". </span></span>
<span id="LC14" class="line" lang="shell"></span>
<span id="LC15" class="line" lang="shell"><span class="c" style="margin-top: 0;"># See https://developer.arm.com/documentation/ddi0363/g/Memory-Protection-Unit/MPU-interaction-with-memory-system?lang=en</span></span>
<span id="LC16" class="line" lang="shell"><span class="c" style="margin-top: 0;"># We want 0000 0011 0000 1011 i.e. 779</span></span>
<span id="LC17" class="line" lang="shell">monitor arm mcr 15 0 6 1 4 779 <span class="c" style="margin-top: 0;"># Modify memory permissions of selected region.</span></span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Setting breakpoints</p>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0 0 1rem; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">use <code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 0.125rem 0.25rem;">hbreak</code> and not <code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 0.125rem 0.25rem;">break</code>
</li>
</ul>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-canonical-lang="bash" class="code highlight js-syntax-highlight language-shell" v-pre="true" style="display: block; font-size: 14px; color: #3a383f; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 1rem; padding: 12px; border: 1px solid #dcdcde;"><code style="font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; overflow-wrap: normal; padding: unset;"><span id="LC1" class="line" lang="shell" style="margin-top: 0;"><span class="o" style="margin-top: 0;">(</span>gdb<span class="o">)</span> hbreak _start</span>
<span id="LC2" class="line" lang="shell"><span class="o" style="margin-top: 0;">(</span>gdb<span class="o">)</span> hbreak bsp_start_hook_0_done</span>
<span id="LC3" class="line" lang="shell"><span class="o" style="margin-top: 0;">(</span>gdb<span class="o">)</span> hbreak rtems_initialize_executive</span>
<span id="LC4" class="line" lang="shell"><span class="o" style="margin-top: 0;">(</span>gdb<span class="o">)</span> c</span>
<span id="LC5" class="line" lang="shell">etc...</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">To debug sysinit handler initialization:</p>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0 0 1rem; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">These are initialized via function pointers. Name+call order of the functions is not clear from source.</li>
</ul>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" v-pre="true" style="display: block; font-size: 14px; color: #3a383f; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 1rem; padding: 12px; border: 1px solid #dcdcde;"><code style="font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; overflow-wrap: normal; padding: unset;"><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;"># Function pointers are placed in elf in call order</span>
<span id="LC2" class="line" lang="plaintext">arm-rtems7-nm hello.exe | grep _Sysinit | sort</span>
<span id="LC3" class="line" lang="plaintext"></span>
<span id="LC4" class="line" lang="plaintext">hbreak <unmangled-symbol></span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Processor states</p>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0 0 1rem; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">These are useful to track faults due to stale state from previous runs.</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">I use the PORRST button on launchpad/unplug replug, start from supervisor mode at every run.</li>
</ul>
<div class="gl-relative markdown-code-block js-markdown-code" style="margin-bottom: 0;">
<pre data-canonical-lang="bash" class="code highlight js-syntax-highlight language-shell" v-pre="true" style="display: block; font-size: 14px; color: #3a383f; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 1rem; padding: 12px; border: 1px solid #dcdcde;"><code style="font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; overflow-wrap: normal; padding: unset;"><span id="LC1" class="line" lang="shell" style="margin-top: 0;"><span class="o" style="margin-top: 0;">(</span>gdb<span class="o">)</span> info reg cpsr</span>
<span id="LC2" class="line" lang="shell"></span>
<span id="LC3" class="line" lang="shell"><span class="c" style="margin-top: 0;"># cpsr must end with 0b1 0011</span></span>
<span id="LC4" class="line" lang="shell">Supervisor Mode <span class="o" style="margin-top: 0;">(</span>clean start state, breakpoint halt<span class="o">)</span>: 0x80000313, 0x20000313, 0x60000313, 0x800003b3</span>
<span id="LC5" class="line" lang="shell">Abort Mode <span class="o" style="margin-top: 0;">(</span>ex. Ctrl+C halt<span class="o">)</span>: 0x80000397,</span>
<span id="LC6" class="line" lang="shell"><span class="c" style="margin-top: 0;"># bit 7,6 = 1 -> IRQ, FIQ disabled</span></span>
<span id="LC7" class="line" lang="shell">External IRQ Mode <span class="o" style="margin-top: 0;">(</span>ex. spurious interrupt, pending interrupt<span class="o">)</span>: 0x20000392,</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
</div>
</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #626168;">
—
<br>
<a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5537">View it on GitLab</a>.
<br>
You're receiving this email because of your account on <a target="_blank" rel="noopener noreferrer" href="https://gitlab.rtems.org">gitlab.rtems.org</a>. <a href="https://gitlab.rtems.org/-/sent_notifications/2-5hzbooekbqqjak3hzk06j9cxr/unsubscribe" target="_blank" rel="noopener noreferrer">Unsubscribe</a> from this thread · <a href="https://gitlab.rtems.org/-/profile/notifications" target="_blank" rel="noopener noreferrer" class="mng-notif-link">Manage all notifications</a> · <a href="https://gitlab.rtems.org/help" target="_blank" rel="noopener noreferrer" class="help-link">Help</a>
<span style="color: transparent; font-size: 0; display: none; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0;">
Notification message regarding https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5537 at 1774796805
</span>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5537"}}</script>
</p>
</div>
</body>
</html>