{"id":4645,"date":"2019-05-13T21:15:44","date_gmt":"2019-05-14T04:15:44","guid":{"rendered":"https:\/\/visualgdb.com\/w\/?p=4645"},"modified":"2019-05-13T21:15:44","modified_gmt":"2019-05-14T04:15:44","slug":"importing-crossworks-projects-into-visualgdb","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/arm\/import\/crossworks\/","title":{"rendered":"Importing CrossWorks projects into VisualGDB"},"content":{"rendered":"<p>This tutorial describes how to import Rowley CrossWorks projects into VisualGDB. Before you begin, ensure you have installed VisualGDB 5.4R6 or later.<\/p>\n<ol>\n<li>Create a basic CrossWorks project and build it under CrossWorks:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/02-build.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4646\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/02-build.png\" alt=\"\" width=\"1197\" height=\"782\" \/><\/a>Building the project before importing it is essential, as it will generate the linker scripts and other files that will be used by VisualGDB.<\/li>\n<li>Start Visual Studio and open the VisualGDB Embedded Project Wizard:<br \/>\n<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/03-prjname.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4647\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/03-prjname.png\" alt=\"\" width=\"941\" height=\"619\" \/><\/a><\/li>\n<li>Select &#8220;Automatically import a project in a different format&#8221;, choose CrossWorks below and enter the path to the .hzp file you would like to import:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/04-import.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4648\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/04-import.png\" alt=\"\" width=\"886\" height=\"693\" \/><\/a><\/li>\n<li>On the next page select a compatible toolchain and confirm the device type imported from the project:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/05-device.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4649\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/05-device.png\" alt=\"\" width=\"886\" height=\"693\" \/><\/a><\/li>\n<li>Finally, choose a debug method compatible with your setup:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/06-debug.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4650\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/06-debug.png\" alt=\"\" width=\"886\" height=\"693\" \/><\/a><\/li>\n<li>Click &#8220;Finish&#8221; to generate the project. VisualGDB will automatically import the list of source files and the basic build settings from the CrossWorks project. However, if you try building it as is, the build will fail with errors in the assembly files:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/07-builderror.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4651\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/07-builderror.png\" alt=\"\" width=\"1197\" height=\"782\" \/><\/a><\/li>\n<li>This happens because the assembly files installed by CrossWorks have the lowercase <strong>.s<\/strong> extension, so GCC treats them as non-preprocessed assembly files and hence fails to process the preprocessor directives inside them. This can be easily worked around by selecting the .s files in Solution Explorer and setting the &#8220;Compile As&#8221; setting for them to &#8220;Assembler with C Preprocessor):<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/08-prepro.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4652\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/08-prepro.png\" alt=\"\" width=\"1197\" height=\"782\" \/><\/a><\/li>\n<li>Once you have enabled the preprocessor for the assembly files, the project will be built as expected:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/09-built.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4653\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/09-built.png\" alt=\"\" width=\"1197\" height=\"782\" \/><\/a><\/li>\n<li>If you are planning to build the imported project with VisualGDB without having to build it with CrossWorks first, locate the linker script in VisualGDB Project Properties -&gt; Build Settings and ensure it&#8217;s checked into your version control system (CrossWorks would normally generate the linker script during the project build):<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/linker.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4654\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/05\/linker.png\" alt=\"\" width=\"1175\" height=\"669\" \/><\/a>You can also move it directly to the project directory to avoid checking in the directory with other generated files<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial describes how to import Rowley CrossWorks projects into VisualGDB. Before you begin, ensure you have installed VisualGDB 5.4R6<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[53,41],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/4645"}],"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=4645"}],"version-history":[{"count":1,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/4645\/revisions"}],"predecessor-version":[{"id":4655,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/4645\/revisions\/4655"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=4645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=4645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=4645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}