<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>MSPM0 project with VS Code, CMake and GCC - part 3: debug</title><link>/technologies/embedded/b/blog/posts/mspm0-project-with-vs-code-cmake-and-gcc---part-3-debug</link><description>In this blog series, I build a Texas Instruments MSPM0 example with VS Code as IDE, and CMake as build infrastructure.Post 2 covered the software build. In this post: debugging the firmware.


If not done yet, open the TI Embedded Debugger plugi...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: MSPM0 project with VS Code, CMake and GCC - part 3: debug</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/mspm0-project-with-vs-code-cmake-and-gcc---part-3-debug</link><pubDate>Sun, 06 Sep 2026 20:44:45 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:ff29cc7a-983a-42ff-8daa-e2e15ba791d4</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;One part I wasn&amp;#39;t happy with, is that I had to manually set the correct startup.c file for the controller. While in CCS, SysConfig adds it automatically as a project reference.&lt;br /&gt;&lt;br /&gt;.It took a bit of experimenting, but this CMake code gives a reference to that file in a variable:&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span&gt;# Ask SysConfig what files it references. &amp;nbsp;Then categorize them. &amp;nbsp;This occurs&lt;/span&gt;&lt;br /&gt;&lt;span&gt;# when CMake configures the project.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;execute_process&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;COMMAND&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;${SYSCONFIG_CLI_CMD}&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;--listReferencedFiles&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;OUTPUT_VARIABLE&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;SYSCONFIG_REF_FILES_STR&lt;/span&gt;&lt;br /&gt;&lt;span&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;string&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;REPLACE&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;\n&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;;&amp;quot;&lt;/span&gt;&lt;span&gt; SYSCONFIG_REF_FILES &lt;/span&gt;&lt;span&gt;${SYSCONFIG_REF_FILES_STR}&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;set&lt;/span&gt;&lt;span&gt;(SYSCONFIG_REF_CFILES &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;${SYSCONFIG_REF_FILES}&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;list&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;FILTER&lt;/span&gt;&lt;span&gt; SYSCONFIG_REF_CFILES &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;INCLUDE&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;REGEX&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;.*&lt;/span&gt;&lt;span&gt;\\&lt;/span&gt;&lt;span&gt;.c$&amp;quot;&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;message&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;STATUS&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;SYSCONFIG_REF_CFILES: &lt;/span&gt;&lt;span&gt;${SYSCONFIG_REF_CFILES}&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;I can then use that variable, insterad of my own fixed file path:&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span&gt;# C files&lt;/span&gt;&lt;br /&gt;&lt;span&gt;set&lt;/span&gt;&lt;span&gt;(SOURCES&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;${&lt;/span&gt;&lt;span&gt;CMAKE_SOURCE_DIR&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt;/mspm0_cmake.cpp&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;${SYSCONFIG_GEN_CFILES}&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;${SYSCONFIG_REF_CFILES}&lt;/span&gt;&lt;br /&gt;&lt;span&gt;    # COMMENTED OUT&amp;nbsp;${SDK_ROOT}/source/ti/devices/msp/m0p/startup_system_files/gcc/startup_mspm0l130x_gcc.c&lt;/span&gt;&lt;br /&gt;&lt;span&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;img src="https://community.element14.com/aggbug?PostID=30141&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: MSPM0 project with VS Code, CMake and GCC - part 3: debug</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/mspm0-project-with-vs-code-cmake-and-gcc---part-3-debug</link><pubDate>Thu, 03 Sep 2026 19:01:15 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:ff29cc7a-983a-42ff-8daa-e2e15ba791d4</guid><dc:creator>DAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Nice update Jan.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=30141&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: MSPM0 project with VS Code, CMake and GCC - part 3: debug</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/mspm0-project-with-vs-code-cmake-and-gcc---part-3-debug</link><pubDate>Thu, 03 Sep 2026 14:56:56 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:ff29cc7a-983a-42ff-8daa-e2e15ba791d4</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Debug action: switch a LED on and off, by directly writing to the GPIO CLR and SET registers.&lt;/p&gt;
&lt;p&gt;[View:https://youtu.be/k51-Cqv1KS0:1280:720]&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=30141&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>