{"id":6442,"date":"2020-07-06T07:56:04","date_gmt":"2020-07-06T14:56:04","guid":{"rendered":"https:\/\/visualgdb.com\/w\/?p=6442"},"modified":"2020-07-06T07:56:04","modified_gmt":"2020-07-06T14:56:04","slug":"common-problems-with-gpdsc-files-generated-by-stm32cubemx","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/documentation\/embedded\/stm32\/gpdsc\/","title":{"rendered":"Common problems with GPDSC files generated by STM32CubeMX"},"content":{"rendered":"<p>The <a href=\"https:\/\/www.st.com\/en\/development-tools\/stm32cubemx.html\">STM32CubeMX<\/a> tool can simplify STM32 project creation by generating initialization code specific to your hardware setup. The <strong>gpdsc<\/strong> files generated by STM32CubeMX can be conveniently imported into VisualGDB using the &#8220;<strong>Automatically import a project in a different format<\/strong>&#8221; option in the wizard:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/cubemx.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6443\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/cubemx.png\" alt=\"\" width=\"886\" height=\"693\" \/><\/a>However, the STM32CubeMX tool sometimes generates broken <strong>gpdsc<\/strong> files that require manual adjustment. This page provides an overview of common errors in the <strong>gpdsc <\/strong>files and the suggested workarounds.<\/p>\n<h1>Corrupt XML Attributes<\/h1>\n<p>Sometimes STM32CubeMX would generate incorrectly escaped XML attributes in the <strong>gpdsc<\/strong> files. This would trigger the following VisualGDB error:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/xml.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6444\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/xml.png\" alt=\"\" width=\"489\" height=\"180\" \/><\/a>You can resolve this by locating the line shown in the error message and checking for the &#8220;&amp;&#8221; character, e.g.:<\/p>\n<pre class=\"\"> &lt;file category=\"sourceC\" condition=\"ARMCC5;(SIiTcompilerIiARMCC&amp;SIiToptionsIiAC5)\" name=\"Device\\ARM\\ARMCA9\\Source\\AC5\\startup_ARMCA9.c\"\/&gt;<\/pre>\n<p>The &#8220;&amp;&#8221; character is used in XML files to specify special entities, so the &#8220;&amp;SIiToptionsIiAC5&#8221; is treated by the XML parser as an invalid entity reference. This can be fixed by replacing &#8220;&amp;&#8221; with &#8220;&amp;amp;&#8221;:<\/p>\n<pre class=\"\">&lt;file category=\"sourceC\" condition=\"ARMCC5;(SIiTcompilerIiARMCC&amp;amp;SIiToptionsIiAC5)\" name=\"Device\\ARM\\ARMCA9\\Source\\AC5\\startup_ARMCA9.c\"\/&gt;<\/pre>\n<h1>Missing Include Directories<\/h1>\n<p>Sometimes the generated <strong>gpdsc<\/strong> files would be missing some include directories that are required for building the project. You can use VisualGDB&#8217;s <a href=\"https:\/\/visualgdb.com\/tutorials\/intellisense\/headers\/\">header discovery<\/a> to quickly find the missing directories and update the settings.<\/p>\n<h1>Other Errors<\/h1>\n<p>If the imported project still doesn&#8217;t build, it could be caused by conflicts between VisualGDB-supplied libraries or drivers, and the files referenced by the <strong>gpdsc<\/strong> file. See our documentation on the <a href=\"https:\/\/visualgdb.com\/documentation\/embedded\/stm32\/\">STM32 project structure<\/a> for a detailed overview of the STM32 projects.<\/p>\n<p>If you believe VisualGDB does not correctly import some settings that are present in the <strong>gpdsc<\/strong> file, simply contact <a href=\"https:\/\/sysprogs.com\/support\/\">our support<\/a> with further details and we should be able to fix it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The STM32CubeMX tool can simplify STM32 project creation by generating initialization code specific to your hardware setup. The gpdsc files<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[197],"tags":[],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/6442"}],"collection":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/comments?post=6442"}],"version-history":[{"count":1,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/6442\/revisions"}],"predecessor-version":[{"id":6445,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/6442\/revisions\/6445"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=6442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=6442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=6442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}