{"id":6536,"date":"2020-07-29T15:01:32","date_gmt":"2020-07-29T22:01:32","guid":{"rendered":"https:\/\/visualgdb.com\/w\/?p=6536"},"modified":"2020-07-29T22:22:49","modified_gmt":"2020-07-30T05:22:49","slug":"importing-ti-halcogen-projects-into-visualgdb","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/arm\/ti\/halcogen\/","title":{"rendered":"Importing TI HALCoGen Projects into VisualGDB"},"content":{"rendered":"<p>This tutorial shows how to convert the projects generated by TI HALCoGen into VisualGDB BSPs that can be used to create multiple Visual Studio-based projects.<\/p>\n<p>We will use the HALCoGen tool to generate one barebone and one FreeRTOS-based project for the TMS570LS1224 chip, and will show how to use our open-source HALCoGen project importer to automatically convert it into a VisualGDB-based BSP.<\/p>\n<p>Before you begin, install the following tools:<\/p>\n<ul>\n<li>Visual Studio and VisualGDB<\/li>\n<li>TI HALCoGen<\/li>\n<li>TI CodeComposer (required to program the FLASH memory)<\/li>\n<li>Clone our <a href=\"https:\/\/github.com\/sysprogs\/BSPTools\/tree\/master\/generators\/TI\/RM57x\">open-source HALCoGen project importer<\/a>\n<pre class=\"\">git clone https:\/\/github.com\/sysprogs\/BSPTools\/<\/pre>\n<\/li>\n<\/ul>\n<p>If you are using Segger J-Link and it directly supports programming the FLASH memory of your device, you can skip the installation of TI CodeComposer.<\/p>\n<ol>\n<li>Launch TI HALCoGen and select <strong>File-&gt;New-&gt;Project<\/strong>:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/01-new.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6537\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/01-new.png\" alt=\"\" width=\"1476\" height=\"884\" \/><\/a><\/li>\n<li>Select the device you would like to target and pick a directory where HALCoGen should save the generated projects. Make sure the project name <strong>NonRTOS<\/strong> as the <strong>HALCoGen<\/strong> project importer will expect this name. Also ensure you have <strong>GCC Tools<\/strong> selected:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/02-nonrtos.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6538\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/02-nonrtos.png\" alt=\"\" width=\"470\" height=\"435\" \/><\/a><\/li>\n<li>Once the project is created, generate the code by selecting <strong>File-&gt;Generate Code<\/strong>: <a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/03-generate.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6539\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/03-generate.png\" alt=\"\" width=\"1192\" height=\"843\" \/><\/a><\/li>\n<li>If your device supports FreeRTOS, create a FreeRTOS-based project and save it into the <strong>FreeRTOS<\/strong> directory:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/03-freertos.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6540\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/03-freertos.png\" alt=\"\" width=\"470\" height=\"435\" \/><\/a>Make sure you generate the code for the second project as well.<\/li>\n<li>Locate the directory where you have cloned the <a href=\"https:\/\/github.com\/sysprogs\/BSPTools\">BSPTools repository<\/a> and open the <strong>generators\\TI\\RM57x\\RM57x.sln<\/strong> file in Visual Studio. Then open <strong>Debug<\/strong> property page of the RM57 project and specify the directory where you have generated the <strong>NonRTOS<\/strong> and optionally <strong>FreeRTOS<\/strong> projects via command-line arguments:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/04-sdk.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6541\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/04-sdk.png\" alt=\"\" width=\"1220\" height=\"926\" \/><\/a>In this example, we use the <strong>c:\\projects\\TMS570SDK<\/strong> directory that contains the following files:\n<ul>\n<li>C:\\projects\\TMS570SDK\\NonRTOS\\include\\*.h<\/li>\n<li>C:\\projects\\TMS570SDK\\NonRTOS\\source\\*.c<\/li>\n<li>C:\\projects\\TMS570SDK\\NonRTOS\\include\\*.h<\/li>\n<li>(equivalent paths for FreeRTOS)<\/li>\n<\/ul>\n<\/li>\n<li>Run the project importer tool. If you are using a device that was not directly tested with the tool, it will throw an exception, prompting to specify device-specific parameters (e.g. core, FPU) in the code. Otherwise, the tool will exit, producing the <strong>generators\\TI\\RM57x\\Output<\/strong> directory:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/05-generated.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6542\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/05-generated.png\" alt=\"\" width=\"844\" height=\"420\" \/><\/a><\/li>\n<li>Select <strong>Tools-&gt;VisualGDB-&gt;Manage VisualGDB Packages<\/strong> in Visual Studio. Then click &#8220;Install a package from file&#8221;:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/pkg.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6543\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/pkg.png\" alt=\"\" width=\"1186\" height=\"793\" \/><\/a>Point VisualGDB to the <strong>.vgdbxbsp<\/strong> file inside the directory with the generated BSP.<\/li>\n<li>Importing the BSP will unpack it under the <strong>%LOCALAPPDATA%\\VisualGDB\\EmbeddedBSPs<\/strong> directory, and registering it with VisualGDB. The device will appear in the VisualGDB Embedded Project Wizard and will work the same way as other devices:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/dev-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6550\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/dev-1.png\" alt=\"\" width=\"886\" height=\"693\" \/><\/a>If you would like to have multiple BSPs based on different HalCoGen-generated projects, simply change the BSP ID and device name in the <strong>BSP.XML<\/strong> file.<\/li>\n<li>You can install the BSP on another machines by copying the <strong>.vgdbxbsp<\/strong> file there and installing it via the <strong>VisualGDB Package Manager<\/strong>.<\/li>\n<li>If you would like to program the FLASH memory using the TI tools, create a new project for your device using CodeComposer and make sure the debug connection works by clicking &#8220;Verify&#8221;:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/verify.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6544\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/verify.png\" alt=\"\" width=\"993\" height=\"728\" \/><\/a>If the connection is working, take a note of the full path of the <strong>.ccxml<\/strong> file. We will pass it to the DSLite tool to program the project built with VisualGDB into the FLASH memory:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/ccxml.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6545\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/07\/ccxml.png\" alt=\"\" width=\"1394\" height=\"943\" \/><\/a><\/li>\n<\/ol>\n<p>Now that you have have generated the BSP, follow <a href=\"https:\/\/visualgdb.com\/tutorials\/arm\/ti\/tms570\/\">this tutorial<\/a> to create a basic project based on it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to convert the projects generated by TI HALCoGen into VisualGDB BSPs that can be used to<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[89],"tags":[53,220],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/6536"}],"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=6536"}],"version-history":[{"count":4,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/6536\/revisions"}],"predecessor-version":[{"id":6575,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/6536\/revisions\/6575"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=6536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=6536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=6536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}