{"id":1093,"date":"2022-01-25T16:30:33","date_gmt":"2022-01-25T16:30:33","guid":{"rendered":"https:\/\/socmaker.com\/?p=1093"},"modified":"2022-01-25T17:32:37","modified_gmt":"2022-01-25T17:32:37","slug":"onethinx-vscode-cortex-debug-gdb-deprecation","status":"publish","type":"post","link":"https:\/\/socmaker.com\/?p=1093","title":{"rendered":"OneThinx, VSCode, Cortex-Debug GDB Deprecation"},"content":{"rendered":"\n<p>If you have read the previous posts and followed them, you have set up an environment to build and debug PSOC5LP code natively on a Mac, after creating the schematic in PSOC Creator.<\/p>\n\n\n\n<p>So, today, my VSCode updated itself.  Suddenly two warnings popped up:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>WARNING: Cortex-Debug will deprecate use of GDB version 8. Please upgrade to version 9+<\/strong><\/p><\/blockquote>\n\n\n\n<p>And this, when I went to run my code:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>launch.json: &#8220;runToMain&#8221; has been deprecated. Please use &#8220;runToEntryPoint\u201d instead<\/strong><\/p><\/blockquote>\n\n\n\n<p>Ugh!<\/p>\n\n\n\n<p>I did not know what to do about the first message.  So, I started searching.  Turns out for programmers, Google is your friend.  (Not so much for free speech, but good for development.)<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Finding The Arm Toolkit<\/h4>\n\n\n\n<p>In the \/Applications\/VSCode_OneThinxPack_macOS directory, the development environment for using cross compile and debug on the Mac exists.  I started looking around.<\/p>\n\n\n\n<p>In that folder is the folder gcc-arm-none-eabi-9-2020-q2-update.  Inside that folder are the folders that support cross compile for the Arm processor for the Mac.  (Or Linux, or Windows, depending upon your OneThinxPack.)<\/p>\n\n\n\n<p>Hmm.  Where did that come from?  Not sure.<\/p>\n\n\n\n<p>I looked for MacPorts, and HomeBrew.  Tried installing arm-none-eabi-gcc for HomeBrew.  No dice.  Something wrong with my installation according to brew.  Nope, it is wrong.<\/p>\n\n\n\n<p>So, I googled the exact name, and I found it!  It was at the ARM designer&#8217;s website.  Thankfully, OneThinx did something very right.  So I went to the ARM site and looked around.  Found it!<\/p>\n\n\n\n<p>The link is: <a href=\"https:\/\/developer.arm.com\/tools-and-software\/open-source-software\/developer-tools\/gnu-toolchain\/gnu-rm\/downloads\">https:\/\/developer.arm.com\/tools-and-software\/open-source-software\/developer-tools\/gnu-toolchain\/gnu-rm\/downloads<\/a>.  I searched for, and download the pkg file on that page.  I ran it and it installed.<\/p>\n\n\n\n<p>Hmm.  Where?  I started looking.  Finally found it in the ARM directory in the Applications folder.  Gee.  Thanks ARM for NOT telling me anything.<\/p>\n\n\n\n<p>So, looking inside the ARM directory, I found the same directory pattern as in the gcc-arm-none-eabi-9-2020-q2-update.  So I renamed the folder to gcc-arm-none-eabi-10-2021-q4-update, and then I moved it into the OneThinxPak directory.<\/p>\n\n\n\n<p>Then, I edited the variables.env file in the OneThinx directory to reflect the new compiler (after making a backup of the older env file.)  Here is the result:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Set the location of this pack\nexport ONETHINX_PACK_LOC=\"\/Applications\/VSCode_OnethinxPack_macOS\"\n\n# Set the PDL version (must match the folder name of the PDL!)\nexport ONETHINX_PDL_VERSION=\"PDL_1.3.1.1499\"\n\n# Set the Compiler version (must match the folder name of the Compiler!)\nexport ONETHINX_COMPILER_VERSION=\"gcc-arm-none-eabi-10-2021-q4-update\"\n\n# Set the Tools version (must match the folder name of the Tools folder!)\nexport ONETHINX_TOOLS_VERSION=\"tools_2.0\"\n\nexport ONETHINX_PDL_LOC=\"$ONETHINX_PACK_LOC\/$ONETHINX_PDL_VERSION\"\nexport ONETHINX_SVD_LOC=\"$ONETHINX_PDL_LOC\/devices\/svd\"\nexport ONETHINX_COMPILER_LOC=\"$ONETHINX_PACK_LOC\/$ONETHINX_COMPILER_VERSION\/bin\"\nexport ONETHINX_TOOLS_LOC=\"$ONETHINX_PACK_LOC\/$ONETHINX_TOOLS_VERSION\"\nexport PATH=\"$PATH:$ONETHINX_COMPILER_LOC\"<\/code><\/pre>\n\n\n\n<p>I logged out and logged back in.  I launched a terminal (inside \/Applications\/Utilities folder) and executed &#8220;set | grep ONE&#8221; and saw the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wmimac:~ maxfield$ set | grep ONE\nONETHINX_COMPILER_LOC=\/Applications\/VSCode_OnethinxPack_macOS\/gcc-arm-none-eabi-10-2021-q4-update\/bin\nONETHINX_COMPILER_VERSION=gcc-arm-none-eabi-10-2021-q4-update\nONETHINX_PACK_LOC=\/Applications\/VSCode_OnethinxPack_macOS\nONETHINX_PDL_LOC=\/Applications\/VSCode_OnethinxPack_macOS\/PDL_1.3.1.1499\nONETHINX_PDL_VERSION=PDL_1.3.1.1499\nONETHINX_SVD_LOC=\/Applications\/VSCode_OnethinxPack_macOS\/PDL_1.3.1.1499\/devices\/svd\nONETHINX_TOOLS_LOC=\/Applications\/VSCode_OnethinxPack_macOS\/tools_2.0\nONETHINX_TOOLS_VERSION=tools_2.0\nwmimac:~ maxfield$ <\/code><\/pre>\n\n\n\n<p>Everything should be good.  I launched VSCode, opened a folder, and it was still stuck on the older compiler.  I clicked on the &#8220;GCC 9.3.1 arm-none-eabi&#8221; section at the bottom:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"125\" src=\"https:\/\/socmaker.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-25-at-9.12.48-AM-1024x125.jpg\" alt=\"\" class=\"wp-image-1095\" srcset=\"https:\/\/socmaker.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-25-at-9.12.48-AM-1024x125.jpg 1024w, https:\/\/socmaker.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-25-at-9.12.48-AM-300x37.jpg 300w, https:\/\/socmaker.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-25-at-9.12.48-AM-768x93.jpg 768w, https:\/\/socmaker.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-25-at-9.12.48-AM-1536x187.jpg 1536w, https:\/\/socmaker.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-25-at-9.12.48-AM.jpg 1890w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>the DropDown at the top had the new compiler listed:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"319\" src=\"https:\/\/socmaker.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-25-at-9.14.50-AM-1024x319.jpg\" alt=\"\" class=\"wp-image-1096\" srcset=\"https:\/\/socmaker.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-25-at-9.14.50-AM-1024x319.jpg 1024w, https:\/\/socmaker.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-25-at-9.14.50-AM-300x93.jpg 300w, https:\/\/socmaker.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-25-at-9.14.50-AM-768x239.jpg 768w, https:\/\/socmaker.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-25-at-9.14.50-AM-1536x478.jpg 1536w, https:\/\/socmaker.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-25-at-9.14.50-AM.jpg 1890w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>I chose &#8220;GCC 10.3.1 arm-none-eabi.&#8221;  Clicked on &#8220;Clean-Reconfigure&#8221; and then debugged.  <\/p>\n\n\n\n<p>It worked! No more deprecation error.  And the old kit is still available in case we have to go back.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">JSON &#8220;runToMain&#8221; Deprecation<\/h4>\n\n\n\n<p>The next thing is the Json deprecated error. Unfortunately, <strong>&#8220;runToEntryPoint&#8221;: true,<\/strong> does not work.  <\/p>\n\n\n\n<p>Hmm.  I tried several things.  Finally, as I was stumbling around, I typed in &#8220;run&#8221; while the cursor was on the line at that point, and VSCode gave me a &#8220;runToEntryPoint&#8221; pop-up menu.  I hit enter, and it filled in correctly:<\/p>\n\n\n\n<p><strong>&#8220;runToEntryPoint&#8221;: &#8220;main&#8221;,<\/strong><\/p>\n\n\n\n<p>Yes!<\/p>\n\n\n\n<p>I started a Debug Session, and it worked!  <\/p>\n\n\n\n<p>&#8212;BUT&#8212;<\/p>\n\n\n\n<p>The debug console complained of gdb not being python scripting compatible.<\/p>\n\n\n\n<p>&#8212;SO&#8212;<\/p>\n\n\n\n<p>After about an hour of searching for where gdb was being specified, I gave up.  There are different ways to skin a cat, so I used a terminal program and went into the folder did a soft link to fix this.  The original GDB is saved as gdb.orig just in case:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>imac:bin$ cd \/Applications\/VSCode_OnethinxPack_macOS\/gcc-arm-none-eabi-10-2021-q4-update\/bin\nimac:bin$ sudo mv arm-none-eabi-gdb arm-none-eabi-gdb.orig\nimac:bin$ ln -s arm-none-eabi-gdb-py arm-none-eabi-gdb\n<\/code><\/pre>\n\n\n\n<p>That worked!   I now have a debug session without errors, and without reported deprecations or problems listed in the gdb window.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Final Thoughts.<\/h4>\n\n\n\n<p>We have the system updated.  A preliminary debug session has worked, so I believe we are good.<\/p>\n\n\n\n<p>These instructions should (mostly) work on Linux and Windows, more or less&#8230;<\/p>\n\n\n\n<p>Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have read the previous posts and followed them, you have set up an environment to build and debug PSOC5LP code natively on a Mac, after creating the schematic in PSOC Creator. So, today, my VSCode updated itself. Suddenly two warnings popped up: WARNING: Cortex-Debug will deprecate use of GDB version 8. Please upgrade [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1093","post","type-post","status-publish","format-standard","hentry","category-blogposts"],"_links":{"self":[{"href":"https:\/\/socmaker.com\/index.php?rest_route=\/wp\/v2\/posts\/1093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/socmaker.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/socmaker.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/socmaker.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/socmaker.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1093"}],"version-history":[{"count":9,"href":"https:\/\/socmaker.com\/index.php?rest_route=\/wp\/v2\/posts\/1093\/revisions"}],"predecessor-version":[{"id":1106,"href":"https:\/\/socmaker.com\/index.php?rest_route=\/wp\/v2\/posts\/1093\/revisions\/1106"}],"wp:attachment":[{"href":"https:\/\/socmaker.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/socmaker.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/socmaker.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}