{"id":130,"date":"2015-05-01T15:05:26","date_gmt":"2015-05-01T15:05:26","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=130"},"modified":"2015-07-19T08:46:03","modified_gmt":"2015-07-19T15:46:03","slug":"arm-stm32-nucleo411re","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/arm\/stm32\/nucleo411re\/","title":{"rendered":"STM32-Nucleo-F411RE tutorial with Visual Studio"},"content":{"rendered":"<p>This tutorial shows how to create a simple project for the STM32-Nucleo-F411RE board with Visual Studio.<\/p>\n<p>You will need the following hardware and software to follow this tutorial:<\/p>\n<ul>\n<li>Microsoft Visual Studio<\/li>\n<li><a href=\"\/download\">VisualGDB 4.<span class=\"auto-style1\">3<\/span><\/a> or later<\/li>\n<li><a href=\"http:\/\/www.st.com\/web\/catalog\/tools\/FM116\/SC959\/SS1532\/LN1847\/PF260320\"> STM32-Nucleo-F411RE<\/a> board<\/li>\n<\/ul>\n<p>We will create a simple &#8216;blinking LED&#8217; project, build it, step through it in debugger and use the Code Map to visualize the structure of the HAL library.<\/p>\n<ol>\n<li>Start Visual Studio. Select File-&gt;New-&gt;Project and select the Embedded Project Wizard from the VisualGDB wizards. <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/01-prj.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/01-prj.png\" alt=\"01-prj\" width=\"700\" height=\"469\" \/><\/a><\/li>\n<li>Proceed with the default &#8220;binary&#8221; settings on the first page:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/02-binary.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/02-binary.png\" alt=\"02-binary\" width=\"702\" height=\"571\" \/><\/a><\/li>\n<li>On then next page select the ARM toolchain. If it is not present, VisualGDB will download it automatically:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/03-toolchain.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/03-toolchain.png\" alt=\"03-toolchain\" width=\"700\" height=\"569\" \/><\/a><\/li>\n<li>Select the STM32F411RE device from the device list. If it is not available, click &#8220;download support for more devices&#8221;:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/04-411re.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/04-411re.png\" alt=\"04-411re\" width=\"702\" height=\"571\" \/><\/a><\/li>\n<li>On the next page proceed with the default LEDBlink sample and specify the LED port according to the <a href=\"http:\/\/www.st.com\/st-web-ui\/static\/active\/en\/resource\/technical\/document\/user_manual\/DM00105823.pdf\"> STM32-Nucleo-F411RE schematics<\/a>:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/05-sample.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/05-sample.png\" alt=\"05-sample\" width=\"702\" height=\"571\" \/><\/a><\/li>\n<li>On the next page select OpenOCD as the debug method, connect your board, press &#8220;detect&#8221; and &#8220;test selected OpenOCD settings&#8221;. If VisualGDB suggests installing the WinUSB driver, proceed with it: <a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/06-drivers.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/06-drivers.png\" alt=\"06-drivers\" width=\"700\" height=\"569\" \/><\/a><\/li>\n<li>Press Finish to create your project. You can build it by pressing Ctrl-Shift-B:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/07-build.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/07-build.png\" alt=\"07-build\" width=\"697\" height=\"642\" \/><\/a><\/li>\n<li>Set a breakpoint on the HAL_GPIO_WritePin() call and press F5 to begin debugging:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/08-bkpt.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/08-bkpt.png\" alt=\"08-bkpt\" width=\"697\" height=\"642\" \/><\/a><\/li>\n<li>Verify that the green LED on the board is off:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/09-led_off.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/09-led_off.jpg\" alt=\"09-led_off\" width=\"700\" height=\"467\" \/><\/a><\/li>\n<li>Press F10 to step over HAL_GPIO_WritePin() and verify that the LED turns on:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/10-led_on.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/10-led_on.jpg\" alt=\"10-led_on\" width=\"700\" height=\"446\" \/><\/a><\/li>\n<li>You can right-click on a function or variable in the code and select &#8220;Show on Code Map&#8221; to explore its role in your source code (requires VisualGDB 5.0+):<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/11-codemap.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-11\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/11-codemap.png\" alt=\"11-codemap\" width=\"699\" height=\"644\" \/><\/a><\/li>\n<li>E.g. you can see how HAL_Delay depends on the uwTick variable that is also modified by HAL_IncTick() called by SysTick_Handler():<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/12-halcode.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-12\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/tutorials\/arm\/stm32\/nucleo411re\/12-halcode.png\" alt=\"12-halcode\" width=\"699\" height=\"642\" \/><\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to create a simple project for the STM32-Nucleo-F411RE board with Visual Studio. You will need the<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[90],"tags":[53,59,61],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/130"}],"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=130"}],"version-history":[{"count":1,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/130\/revisions"}],"predecessor-version":[{"id":199,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/130\/revisions\/199"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}