{"id":30646,"date":"2022-06-07T18:00:07","date_gmt":"2022-06-07T18:00:07","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=30646"},"modified":"2022-06-07T18:00:07","modified_gmt":"2022-06-07T18:00:07","slug":"serial-and-zephyr-support","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/serial-and-zephyr-support\/","title":{"rendered":"Serial and Zephyr support for Visual Studio and VS Code"},"content":{"rendered":"<p>We are continuing to improve our embedded development support in <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/visual-studio-embedded-development\/\">Visual Studio<\/a> and <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/vscode-embedded-development\/\">VS Code<\/a>. We have recently introduced a serial monitor and RTOS support for Zephyr. These capabilities are present in Visual Studio 17.3 Preview 1 as part of the Linux and embedded development workload. The Embedded Tools extension for VS Code also includes these capabilities, though the serial monitor is available as a stand-alone extension as well. This post illustrates these new capabilities in Visual Studio and VS Code.<\/p>\n<h4>Serial monitor<\/h4>\n<p>To start the serial monitor in Visual Studio in the Debug &gt; Windows &gt; Serial Monitor.<\/p>\n<p>To start the serial monitor in Visual Studio Code go to the command palate Ctrl + Shift + P\u00a0 and enter \u201cserial\u201d then select Focus on Serial Monitor View.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/vs-serialmonitor.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-30648\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/vs-serialmonitor.png\" alt=\"Visual Studio serial monitor screenshot\" width=\"1753\" height=\"478\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/vs-serialmonitor.png 1753w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/vs-serialmonitor-300x82.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/vs-serialmonitor-1024x279.png 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/vs-serialmonitor-768x209.png 768w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/vs-serialmonitor-1536x419.png 1536w\" sizes=\"(max-width: 1753px) 100vw, 1753px\" \/><\/a><\/p>\n<p>The serial monitor enumerates the available ports in the Port dop down box. You can set the baud rate and line ending mode in their own drop down boxes. Select start monitoring to connect to the selected device.<\/p>\n<p>There are toggle buttons to clear output, prefix time stamps to the output, and select whether the output scrolls or not.<\/p>\n<p>There is a text box at the bottom of the monitor you can use to send message to the connected serial port.<\/p>\n<p>When you are done you can select stop monitoring.<\/p>\n<h4>Zephyr<\/h4>\n<p>We have added support to our RTOS objects view for Zephyr.<\/p>\n<p>To start the RTOS objects views in Visual Studio, go to the menu Debug &gt; Windows &gt; RTOS Objects. In Visual Studio Code go to the command palate Ctrl + Shift + P\u00a0 and enter \u201crtos\u201d then select Focus on RTOS viewer view.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/vscode-zephyr.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-30649\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/vscode-zephyr.png\" alt=\"Image vscode zephyr\" width=\"624\" height=\"150\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/vscode-zephyr.png 624w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2022\/06\/vscode-zephyr-300x72.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>Our extension detects the type of RTOS you are using automatically, there is nothing to set to get the correct view across Azure RTOS, FreeRTOS, or Zephyr.<\/p>\n<p>We do not have a prepared example using vcpkg for project activation, we used the <a href=\"https:\/\/docs.zephyrproject.org\/latest\/develop\/getting_started\/index.html\">Zephyr projects instructions<\/a> to configure our environment. Note that there are some Zephyr projects which do not use threads, in those cases our RTOS viewer will not activate as there is nothing for it to display. You also need to ensure that your build includes the necessary debugging symbols, for example:<\/p>\n<p>west build -p auto -b mimxrt1060_evk samples\\basic\\threads -DCONFIG_DEBUG_THREAD_INFO=y -DCONFIG_INIT_STACKS=y -DCONFIG_THREAD_STACK_INFO=y<\/p>\n<h4>Send us your feedback<\/h4>\n<p>We hope that these new capabilities will enable you to choose Visual Studio or VS Code for your embedded development needs and make you more productive. We are very interested in your feedback to continue to improve this experience. The comments below are open, or you can find us on Twitter (<a href=\"https:\/\/twitter.com\/visualc\">@VisualC<\/a>), or via email at <a href=\"mailto:visualcpp@microsoft.com\">visualcpp@microsoft.com<\/a>.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are continuing to improve our embedded development support in Visual Studio and VS Code. We have recently introduced a serial monitor and RTOS support for Zephyr. These capabilities are present in Visual Studio 17.3 Preview 1 as part of the Linux and embedded development workload. The Embedded Tools extension for VS Code also includes [&hellip;]<\/p>\n","protected":false},"author":677,"featured_media":30648,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3903,317,230],"tags":[],"class_list":["post-30646","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-embedded","category-iot","category-new-feature"],"acf":[],"blog_post_summary":"<p>We are continuing to improve our embedded development support in Visual Studio and VS Code. We have recently introduced a serial monitor and RTOS support for Zephyr. These capabilities are present in Visual Studio 17.3 Preview 1 as part of the Linux and embedded development workload. The Embedded Tools extension for VS Code also includes [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/30646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/677"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=30646"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/30646\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/30648"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=30646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=30646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=30646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}