{"id":1870,"date":"2016-05-02T19:40:53","date_gmt":"2016-05-03T02:40:53","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=1870"},"modified":"2016-05-02T19:40:53","modified_gmt":"2016-05-03T02:40:53","slug":"developing-projects-for-the-infineon-ethercat-module-with-visual-studio","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/arm\/infineon\/ethercat\/","title":{"rendered":"Developing Projects for the Infineon EtherCAT module with Visual Studio:"},"content":{"rendered":"<p>This tutorial shows how to create projects for the Infineon EtherCAT module featuring the XMC4800 microcontroller using Visual Studio and VisualGDB.<\/p>\n<p>Before you begin, install <a href=\"http:\/\/visualgdb.com\/download\/\">VisualGDB<\/a>.<\/p>\n<ol>\n<li>Start Visual Studio. Select File-&gt;New-&gt;Project and pick the VisualGDB Embedded Project Wizard from the list:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c01-prjname.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1853\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c01-prjname.png\" alt=\"c01-prjname\" width=\"786\" height=\"463\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c01-prjname.png 786w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c01-prjname-300x177.png 300w\" sizes=\"(max-width: 786px) 100vw, 786px\" \/><\/a><\/li>\n<li>As we are creating a very basic project, the default setting of &#8220;Embedded Binary&#8221; will work, so simply click &#8220;Next&#8221; on the first page:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c02-bin.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1854\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c02-bin.png\" alt=\"c02-bin\" width=\"738\" height=\"529\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c02-bin.png 738w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c02-bin-300x215.png 300w\" sizes=\"(max-width: 738px) 100vw, 738px\" \/><\/a><\/li>\n<li>Select the ARM toolchain and the Infineon device you are targeting. The EtherCAT module has the XMC4800-2048 device installed, so we simply select it:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c03-xmc4800.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1855\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c03-xmc4800.png\" alt=\"c03-xmc4800\" width=\"738\" height=\"601\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c03-xmc4800.png 738w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c03-xmc4800-300x244.png 300w\" sizes=\"(max-width: 738px) 100vw, 738px\" \/><\/a><\/li>\n<li>Proceed with the default LEDBlink sample. The module has several on-board LEDs with the port numbers printed next to them. We will use the first one that is connected to P1.14, so select P1-14 as the LED port:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c04-led.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1856\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c04-led.png\" alt=\"c04-led\" width=\"738\" height=\"529\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c04-led.png 738w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c04-led-300x215.png 300w\" sizes=\"(max-width: 738px) 100vw, 738px\" \/><\/a><\/li>\n<li>The module comes with an on-board Segger J-Link, so simply select it in the Debug Method field and VisualGDB will configure everything automatically:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c05-dbg.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1857\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c05-dbg.png\" alt=\"c05-dbg\" width=\"738\" height=\"579\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c05-dbg.png 738w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c05-dbg-300x235.png 300w\" sizes=\"(max-width: 738px) 100vw, 738px\" \/><\/a><\/li>\n<li>Press &#8220;Finish&#8221; to create your project. Build it by pressing Ctrl-Shift-B:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c06-build.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1858\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c06-build.png\" alt=\"c06-build\" width=\"925\" height=\"601\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c06-build.png 925w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c06-build-300x195.png 300w\" sizes=\"(max-width: 925px) 100vw, 925px\" \/><\/a><\/li>\n<li>Press F5 to start debugging. Note how the LED that we selected in the wizard starts blinking:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/ledon4.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1875\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/ledon4.jpg\" alt=\"ledon\" width=\"700\" height=\"399\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/ledon4.jpg 700w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/ledon4-300x171.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><\/li>\n<li>Set a breakpoint at the SysTick_Handler() function and wait for it to trigger. See how the interrupt handler is incrementing the s_Ticks variable each time an interrupt happens:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c07-isr.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1859\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c07-isr.png\" alt=\"c07-isr\" width=\"925\" height=\"601\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c07-isr.png 925w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c07-isr-300x195.png 300w\" sizes=\"(max-width: 925px) 100vw, 925px\" \/><\/a><\/li>\n<li>You can configure VisualGDB to display the s_Ticks variable value while your program is running. Simply add it to the Live Variables window as if you were adding a watch, enable plotting and press F5 to continue debugging:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c08-tickgraph.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1860\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c08-tickgraph.png\" alt=\"c08-tickgraph\" width=\"925\" height=\"601\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c08-tickgraph.png 925w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c08-tickgraph-300x195.png 300w\" sizes=\"(max-width: 925px) 100vw, 925px\" \/><\/a><\/li>\n<li>You can also use the Code Map feature provided by the VisualGDB&#8217;s Clang-based IntelliSense engine to quickly explore the relations between code and data. E.g. you can see how main() is calling the Delay() function that in turns reads the s_Ticks variable also accessed by SysTick_Handler():<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c09-codemap.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1861\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c09-codemap.png\" alt=\"c09-codemap\" width=\"925\" height=\"601\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c09-codemap.png 925w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/04\/c09-codemap-300x195.png 300w\" sizes=\"(max-width: 925px) 100vw, 925px\" \/><\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to create projects for the Infineon EtherCAT module featuring the XMC4800 microcontroller using Visual Studio and<\/p>\n","protected":false},"author":1,"featured_media":1876,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[89],"tags":[53,127,59],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/1870"}],"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=1870"}],"version-history":[{"count":3,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/1870\/revisions"}],"predecessor-version":[{"id":1926,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/1870\/revisions\/1926"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media\/1876"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=1870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=1870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=1870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}