{"id":9941,"date":"2022-06-21T04:45:13","date_gmt":"2022-06-21T04:45:13","guid":{"rendered":"http:\/\/fastbitlab.com\/?p=9941"},"modified":"2023-08-26T16:01:49","modified_gmt":"2023-08-26T10:31:49","slug":"microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line","status":"publish","type":"post","link":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/","title":{"rendered":"Microcontroller Embedded C Programming Lecture 49| Testing printf over ARM Cortex M4  ITM+SWO line"},"content":{"rendered":"<div class=\"boldgrid-section\" style=\"background-image: linear-gradient(to left, #eeeeee, #eeeeee);\" data-bg-color-1=\"#EEEEEE\" data-bg-color-2=\"#EEEEEE\" data-bg-direction=\"to left\">\n<div class=\"container\">\n<div class=\"row\" style=\"padding-top: 35px; padding-bottom: 0px; background-image: linear-gradient(to left, #eeeeee, #eeeeee);\" data-bg-color-1=\"#EEEEEE\" data-bg-color-2=\"#EEEEEE\" data-bg-direction=\"to left\">\n<div class=\"col-md-1 col-sm-12 col-xs-12 col-lg-1\" style=\"padding: 0px 15px;\">\n<div class=\"boldgrid-shortcode\" data-imhwpb-draggable=\"true\">\n\n<\/div>\n<p class=\"\">&nbsp;<\/p>\n<\/div>\n<div class=\"col-md-10 col-sm-12 col-xs-12 col-lg-10\">\n<h1 class=\"\" style=\"text-align: center; font-size: 30px; border-width: 0px; line-height: 50px;\"><span style=\"color: #000080;\"><strong>Testing printf over ARM Cortex M4 ITM+SWO line<\/strong><\/span><\/h1>\n<div class=\"row bg-editor-hr-wrap\" style=\"border-width: 0px; margin-top: -25px;\">\n<div class=\"col-lg-12 col-md-12 col-xs-12 col-sm-12\">\n<div>\n<p>&nbsp;<\/p>\n<div class=\"bg-hr bg-hr-10 color2-color\" style=\"border-style: solid; border-width: 0px 0px 3px;\"><\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"\" style=\"border-width: 0px; font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">To compile this program, all you need to do is select the project, and then right-click, and then click on a <strong>Build Project<\/strong>. <\/span><\/p>\n<figure id=\"attachment_9944\" aria-describedby=\"caption-attachment-9944\" style=\"width: 701px\" class=\"wp-caption aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" class=\"wp-image-9944 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-1-4-1024x611.png\" alt=\"Figure 1. Compiling a project \" width=\"701\" height=\"418\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-4-1024x611.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-4-300x179.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-4-768x458.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-4-600x358.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-4-1536x917.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-4-120x72.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-4-500x298.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-4-200x119.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-4-400x239.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-4-800x477.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-4-1200x716.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-4.png 1721w\" sizes=\"(max-width: 701px) 100vw, 701px\" \/><figcaption id=\"caption-attachment-9944\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 1. Compiling a project<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Or you can do another method. Select the project, and click on the<\/span><b> Build<\/b><span style=\"font-weight: 400;\"> icon, as shown in Figure 2.<\/span><\/span><\/p>\n<figure id=\"attachment_9945\" aria-describedby=\"caption-attachment-9945\" style=\"width: 701px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-9945 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-2-4-1024x516.png\" alt=\"Figure 2. Compiling the Project\" width=\"701\" height=\"353\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-4-1024x516.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-4-300x151.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-4-768x387.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-4-600x302.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-4-120x60.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-4-500x252.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-4-540x272.png 540w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-4-200x101.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-4-400x202.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-4-800x403.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-4.png 1101w\" sizes=\"(max-width: 701px) 100vw, 701px\" \/><figcaption id=\"caption-attachment-9945\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 2. Compiling the Project<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Let&#8217;s compile the code. <\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Under the console, you can see the logs. Here, arm-none-eabi-gcc is a compiler invoked by this IDE. <\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">And by the way, you need not worry about installing a cross compiler here. Because all the build tools, cross-compilation tools, everything is installed by the IDE. Everything comes with the IDE, so you need not to install anything extra.&nbsp;<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">If you want to upgrade this compiler to the newer version, then you may have to change the compiler settings. So, other than that, I don&#8217;t think you need to touch any compiler settings as of now. arm-none-eabi-gcc is a cross compiler used to compile this source code for the target architecture.<\/span><\/p>\n<figure id=\"attachment_9946\" aria-describedby=\"caption-attachment-9946\" style=\"width: 700px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-9946 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-3-3-1024x548.png\" alt=\"Figure 3. Console of the HelloWorld project\" width=\"700\" height=\"375\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-3-1024x548.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-3-300x160.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-3-768x411.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-3-600x321.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-3-1536x821.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-3-120x64.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-3-500x267.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-3-200x107.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-3-400x214.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-3-800x428.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-3-1200x642.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-3.png 1913w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption id=\"caption-attachment-9946\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 3. Console of the HelloWorld project<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 25px; border-width: 0px; line-height: 35px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #ff0000;\"><strong>What is Cross compilation?&nbsp;<\/strong><\/span><\/p>\n<blockquote class=\"\" style=\"background-color: #0d3d67; font-size: 19px;\">\n<p class=\"\" style=\"border-width: 0px; font-size: 18px;\"><span style=\"font-weight: 400; color: #ffff00;\">Cross compilation means you compile a program to produce code for some other architecture.<\/span><\/p>\n<\/blockquote>\n<p class=\"\" style=\"border-width: 0px; font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">For example, in this case, we are using the cross compiler arm-none-eabi-gcc. So, this is a cross compiler. And this cross compiler runs on the host machine, but it produces an executable for a different machine.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">For example, the target machine is different; it is based on ARM architecture. That&#8217;s why a compiler is called a cross compiler when it runs on one architecture, but it produces the code for a different architecture. So, that compiler is called a cross compiler, and the process is called a cross-compilation.<\/span><\/p>\n<figure id=\"attachment_9947\" aria-describedby=\"caption-attachment-9947\" style=\"width: 702px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9947 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-4-3-1024x553.png\" alt=\"Figure 4. Cross compilation\" width=\"702\" height=\"379\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-3-1024x553.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-3-300x162.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-3-768x415.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-3-600x324.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-3-1536x829.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-3-120x65.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-3-500x270.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-3-200x108.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-3-400x216.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-3-800x432.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-3-1200x648.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-3.png 1813w\" sizes=\"(max-width: 702px) 100vw, 702px\" \/><figcaption id=\"caption-attachment-9947\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 4. Cross compilation<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Here, the cross compiler produces different types of executables for the target. These are all the different executable types like .elf \/.bin \/.hex.&nbsp;<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">.elf is a type of executable that stands for executable and linkable format. It&#8217;s a type of executable which is used for debugging. Because there are tools available to analyze .elf files and they can disassemble the code, and they can get the information about the project.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">We will be using the .elf format in this article because we will be debugging our code on the target. Debugging is not possible if you use .bin or .hex. As I said, those are pure binary files, and those are used during production.&nbsp;<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 25px; border-width: 0px; line-height: 35px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #ff0000;\"><strong>What is Native compilation?<\/strong><\/span><\/p>\n<blockquote class=\"\" style=\"background-color: #083862; font-size: 18px;\">\n<p class=\"\"><span style=\"font-weight: 400; color: #ffff00;\">Native compiler means the compiler runs on a host machine and produces executable which also runs on the same machine. This process is called native compilation.<\/span><\/p>\n<\/blockquote>\n<p class=\"\" style=\"border-width: 0px; font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">So for, whatever the code that we wrote for our PC that is actually native compilation.&nbsp;<\/span><\/p>\n<figure id=\"attachment_9948\" aria-describedby=\"caption-attachment-9948\" style=\"width: 705px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9948 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-5-3-1024x506.png\" alt=\"Figure 5. Native compilation\" width=\"705\" height=\"349\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3-1024x506.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3-300x148.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3-768x380.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3-600x297.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3-1536x759.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3-120x59.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3-500x247.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3-200x99.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3-400x198.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3-800x395.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3-1200x593.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3.png 1811w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><figcaption id=\"caption-attachment-9948\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 5. Native compilation<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Let&#8217;s move forward. Here we actually got .elf of 001HelloWorld project.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">After that, we have to load this project into our target now. <\/span><\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">For that, you have first to connect the target to your machine. I&#8217;m going to connect the target to my machine, and after that, right-click on the project, go to <\/span><b>Debug As<\/b><span style=\"font-weight: 400;\">, and click on <\/span><b>Debug Configurations<\/b><span style=\"font-weight: 400;\">, as shown in Figure 6.&nbsp;<\/span><\/span><\/p>\n<figure id=\"attachment_9949\" aria-describedby=\"caption-attachment-9949\" style=\"width: 701px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9949 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-6-3-1024x547.png\" alt=\"Figure 6. Load the project into our target\" width=\"701\" height=\"375\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-3-1024x547.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-3-300x160.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-3-768x410.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-3-600x320.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-3-1536x820.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-3-120x64.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-3-500x267.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-3-200x107.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-3-400x213.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-3-800x427.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-3-1200x640.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-3.png 1913w\" sizes=\"(max-width: 701px) 100vw, 701px\" \/><figcaption id=\"caption-attachment-9949\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 6. Load the project into our target<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Then, double click on this <\/span><b>STM32 MCU Debugging<\/b><span style=\"font-weight: 400;\">, so it creates a debug configuration here. And so the name you can keep this as it is, no problem. It tries to load this file, that is .elf, which is created during the compilation. And so don&#8217;t change anything here.<\/span><\/span><\/p>\n<figure id=\"attachment_9950\" aria-describedby=\"caption-attachment-9950\" style=\"width: 703px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9950 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-7-3-1024x529.png\" alt=\"Figure 7. Debug Configuration\" width=\"703\" height=\"363\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-3-1024x529.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-3-300x155.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-3-768x396.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-3-600x310.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-3-1536x793.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-3-120x62.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-3-500x258.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-3-200x103.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-3-400x206.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-3-800x413.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-3-1200x619.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-3.png 1885w\" sizes=\"(max-width: 703px) 100vw, 703px\" \/><figcaption id=\"caption-attachment-9950\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 7. Debug Configuration<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Go to Debugger, and here in the Debug probe, you select ST-LINK(ST-LINK GDB server). So, it also has an option for openOCD, but we will be using ST-LINK.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">After that, in the Interface, you select SWD, as shown in Figure 8.&nbsp;<\/span><\/p>\n<figure id=\"attachment_9951\" aria-describedby=\"caption-attachment-9951\" style=\"width: 701px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9951 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-8-3-1024x822.png\" alt=\"Figure 8. Debugger\" width=\"701\" height=\"563\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-3-1024x822.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-3-300x241.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-3-768x616.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-3-600x481.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-3-120x96.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-3-500x401.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-3-177x142.png 177w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-3-200x160.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-3-400x321.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-3-800x642.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-3.png 1103w\" sizes=\"(max-width: 701px) 100vw, 701px\" \/><figcaption id=\"caption-attachment-9951\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 8. Debugger<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 29px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">And after that, here is an option for Serial Wire Viewer(SWV). So, enable that. After that, the Core clock is 16.0 megahertz so you can keep that. The SWO clock which is default to 2000 kilohertz, and you can keep that, no problem. And after that, you need not to do anything here.<\/span><\/p>\n<figure id=\"attachment_9952\" aria-describedby=\"caption-attachment-9952\" style=\"width: 701px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9952 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-9-3-1024x819.png\" alt=\"Figure 9. Debugger\" width=\"701\" height=\"561\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-3-1024x819.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-3-300x240.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-3-768x614.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-3-600x480.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-3-120x96.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-3-500x400.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-3-177x142.png 177w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-3-200x160.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-3-400x320.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-3-800x640.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-3.png 1109w\" sizes=\"(max-width: 701px) 100vw, 701px\" \/><figcaption id=\"caption-attachment-9952\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 9. Debugger<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">In the Startup, also you need not to do anything. Just click on <\/span><b>Apply<\/b><span style=\"font-weight: 400;\">, and after that, you can click <\/span><b>Close<\/b><span style=\"font-weight: 400;\">, as shown in Figure 10.&nbsp;<\/span><\/span><\/p>\n<figure id=\"attachment_9953\" aria-describedby=\"caption-attachment-9953\" style=\"width: 702px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9953\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-10-2-1024x578.png\" alt=\"Testing printf over ARM Cortex M4 ITM\" width=\"702\" height=\"396\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-2-1024x578.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-2-300x169.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-2-768x434.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-2-600x339.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-2-1536x867.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-2-120x68.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-2-500x282.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-2-200x113.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-2-400x226.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-2-800x452.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-2-1200x677.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-2.png 1603w\" sizes=\"(max-width: 702px) 100vw, 702px\" \/><figcaption id=\"caption-attachment-9953\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 10. Startup<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">And after that, right-click on the project 001HelloWorld, and you can again go to the <\/span><b>Debug As <\/b><span style=\"font-weight: 400;\">and select <\/span><b>STM32MCU C\/C++<\/b><span style=\"font-weight: 400;\"><strong> Application<\/strong>.&nbsp;<\/span><\/span><\/p>\n<figure id=\"attachment_9954\" aria-describedby=\"caption-attachment-9954\" style=\"width: 703px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9954 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-11-2-1024x669.png\" alt=\"Figure 11. STM32MCU C\/C++ Application\" width=\"703\" height=\"459\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-2-1024x669.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-2-300x196.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-2-768x502.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-2-600x392.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-2-1536x1003.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-2-120x78.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-2-500x327.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-2-200x131.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-2-400x261.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-2-800x523.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-2-1200x784.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-2.png 1569w\" sizes=\"(max-width: 703px) 100vw, 703px\" \/><figcaption id=\"caption-attachment-9954\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 11. STM32MCU C\/C++ Application<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">The IDE will load the project into the target hardware, and it will switch into the debug perspective.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">The IDE is asking you to change the perspective into debug perspective. For that, you can click <\/span><b>Switch<\/b><span style=\"font-weight: 400;\">.&nbsp;<\/span><\/span><\/p>\n<figure id=\"attachment_9955\" aria-describedby=\"caption-attachment-9955\" style=\"width: 702px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9955\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-12-1.png\" alt=\"Testing printf over ARM Cortex M4 ITM\" width=\"702\" height=\"404\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-1.png 933w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-1-300x173.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-1-768x442.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-1-600x345.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-1-120x69.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-1-500x288.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-1-200x115.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-1-400x230.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-1-800x460.png 800w\" sizes=\"(max-width: 702px) 100vw, 702px\" \/><figcaption id=\"caption-attachment-9955\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 12. Confirm Perspective Switch<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Here you can see that(Figure 13), the code is loaded onto the target, and the execution is stopped at the very first instruction of the main function. This is what IDE is usually do. So, they will halt the execution at the first instruction of the main. The processor is halted because the IDE is stopped here.<\/span><\/p>\n<figure id=\"attachment_9956\" aria-describedby=\"caption-attachment-9956\" style=\"width: 700px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9956\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-13-1-1024x522.png\" alt=\"Testing printf over ARM Cortex M4 ITM\" width=\"700\" height=\"357\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-1-1024x522.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-1-300x153.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-1-768x392.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-1-600x306.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-1-1536x784.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-1-120x61.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-1-500x255.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-1-200x102.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-1-400x204.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-1-800x408.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-1-1200x612.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-1.png 1915w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption id=\"caption-attachment-9956\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 13. Code is loaded onto the target<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #ff0000;\"><span style=\"font-weight: 400;\">How to see this printf?<\/span><\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\"> For that, you have to go to the <\/span><b>Window<\/b><span style=\"font-weight: 400;\">, go to <\/span><b>Show View<\/b><span style=\"font-weight: 400;\">, go to <\/span><b>SWV<\/b><span style=\"font-weight: 400;\">( that is serial wire viewer), and then go to <\/span><b>SWV ITM Data Console<\/b><span style=\"font-weight: 400;\">. Click on that.<\/span><\/span><\/p>\n<figure id=\"attachment_9957\" aria-describedby=\"caption-attachment-9957\" style=\"width: 701px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9957\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-14-1024x587.png\" alt=\"Testing printf over ARM Cortex M4 ITM\" width=\"701\" height=\"402\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-1024x587.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-300x172.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-768x440.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-600x344.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-1536x880.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-120x69.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-500x286.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-200x115.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-400x229.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-800x458.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-1200x688.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14.png 1761w\" sizes=\"(max-width: 701px) 100vw, 701px\" \/><figcaption id=\"caption-attachment-9957\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 14. Goto SWV ITM Data Console<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">It will appear at the bottom of the SWV ITM Data Console. And then, click on this <\/span><b>Configure Trace<\/b><span style=\"font-weight: 400;\"> here, as shown in Figure 15.<\/span><\/span><\/p>\n<figure id=\"attachment_9958\" aria-describedby=\"caption-attachment-9958\" style=\"width: 702px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9958\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-15-1024x526.png\" alt=\"Testing printf over ARM Cortex M4 ITM\" width=\"702\" height=\"361\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-1024x526.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-300x154.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-768x395.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-600x308.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-1536x789.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-120x62.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-500x257.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-200x103.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-400x206.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-800x411.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-1200x617.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15.png 1913w\" sizes=\"(max-width: 702px) 100vw, 702px\" \/><figcaption id=\"caption-attachment-9958\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 15. Select Configure trace<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Select <\/span><b>Port 0<\/b><span style=\"font-weight: 400;\">, and after that, click on <\/span><b>OK<\/b><span style=\"font-weight: 400;\">.<\/span><\/span><\/p>\n<figure id=\"attachment_9959\" aria-describedby=\"caption-attachment-9959\" style=\"width: 701px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9959\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-16-1024x623.png\" alt=\"Testing printf over ARM Cortex M4 ITM\" width=\"701\" height=\"427\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-16-1024x623.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-16-300x183.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-16-768x467.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-16-600x365.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-16-120x73.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-16-500x304.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-16-200x122.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-16-400x243.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-16-800x487.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-16-1200x730.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-16.png 1267w\" sizes=\"(max-width: 701px) 100vw, 701px\" \/><figcaption id=\"caption-attachment-9959\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 16. Serial Wire Viewer settings for 001HelloWorld Debug<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Let&#8217;s run the code. To run the code in one go, you have to click the Resume button.<\/span><\/p>\n<figure id=\"attachment_9960\" aria-describedby=\"caption-attachment-9960\" style=\"width: 702px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9960\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-17-1024x528.png\" alt=\"Testing printf over ARM Cortex M4 ITM\" width=\"702\" height=\"362\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-17-1024x528.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-17-300x155.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-17-768x396.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-17-600x310.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-17-1536x792.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-17-120x62.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-17-500x258.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-17-200x103.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-17-400x206.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-17-800x413.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-17-1200x619.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-17.png 1917w\" sizes=\"(max-width: 702px) 100vw, 702px\" \/><figcaption id=\"caption-attachment-9960\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 17. Click on the Resume Button<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">After clicking the Resume Button, actually, you didn&#8217;t see that message here. That&#8217;s because you have to start the trace. Now, let&#8217;s reset the board.&nbsp;&nbsp;<\/span><\/p>\n<figure id=\"attachment_9961\" aria-describedby=\"caption-attachment-9961\" style=\"width: 701px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9961\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-18-1024x492.png\" alt=\"Testing printf over ARM Cortex M4 ITM\" width=\"701\" height=\"337\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-18-1024x492.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-18-300x144.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-18-768x369.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-18-600x288.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-18-1536x738.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-18-120x58.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-18-500x240.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-18-200x96.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-18-400x192.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-18-800x384.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-18-1200x577.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-18.png 1825w\" sizes=\"(max-width: 701px) 100vw, 701px\" \/><figcaption id=\"caption-attachment-9961\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 18. Reset the chip and Restart the debug session<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">You can reset the board from IDE itself; you need not to keep pressing the reset button of the board. You can do that from here, click on <\/span><b>Reset the chip and restart the debug session<\/b><span style=\"font-weight: 400;\">. Let me reset.<\/span><\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Now let&#8217;s click on the <\/span><b>Start Trace<\/b><span style=\"font-weight: 400;\"> button here. After clicking the button,&nbsp; SWV ITM Data Console is ready to accept data on the SWO pin.&nbsp;<\/span><\/span><\/p>\n<figure id=\"attachment_9962\" aria-describedby=\"caption-attachment-9962\" style=\"width: 700px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9962\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-19-1024x224.png\" alt=\"Testing printf over ARM Cortex M4 ITM\" width=\"700\" height=\"153\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-19-1024x224.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-19-300x66.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-19-768x168.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-19-600x131.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-19-120x26.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-19-500x109.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-19-200x44.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-19-400x87.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-19-800x175.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-19-1200x262.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-19.png 1423w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption id=\"caption-attachment-9962\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 19. Start trace<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Then, let&#8217;s hit the Resume button. Here we got the <\/span><b>&#8220;Hello World&#8221; <\/b><span style=\"font-weight: 400;\">message as shown in Figure 20.<\/span><\/span><\/p>\n<figure id=\"attachment_9963\" aria-describedby=\"caption-attachment-9963\" style=\"width: 702px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9963\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-20-1024x525.png\" alt=\"Testing printf over ARM Cortex M4 ITM\" width=\"702\" height=\"360\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-20-1024x525.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-20-300x154.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-20-768x394.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-20-600x307.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-20-1536x787.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-20-120x61.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-20-500x256.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-20-200x102.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-20-400x205.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-20-800x410.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-20-1200x615.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-20.png 1899w\" sizes=\"(max-width: 702px) 100vw, 702px\" \/><figcaption id=\"caption-attachment-9963\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 20. Hello World message<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #ff0000;\">What&#8217;s happening here? <\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Printf is going to standard library, from standard library, it is coming to the write function, and in the write function, it is going to the ITM FIFO, and from that ITM FIFO, it is coming over SWO pin all the way back to the IDE.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">And for any reason, if you are not able to use SWV(serial wire viewer), then you can use semihosting using the openOCD debugger.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-size: 20px; line-height: 25px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><b>FastBit Embedded Brain Academy Courses<\/b><\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-size: 17px;\"><span style=\"color: #000000;\">C<span style=\"font-weight: 400;\">lick here:<span style=\"color: #0000ff;\">&nbsp;<\/span><\/span><\/span><span style=\"color: #0000ff;\"><a style=\"color: #0000ff; text-decoration: underline;\" href=\"http:\/\/fastbitlab.com\/course1\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">https:\/\/fastbitlab.com\/course1<\/span><\/a><\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Testing printf over ARM Cortex M4 ITM+SWO line &nbsp; &nbsp; To compile this program, all you need to do is select the project, and then right-click, and then click on a Build Project. &nbsp; Or you can do another method. Select the project, and click on the Build icon, as shown in Figure 2. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":9948,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[8],"tags":[16],"class_list":["post-9941","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-microcontroller-embedded-c-programming","entry","has-media"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Testing printf over ARM Cortex M4 ITM+SWO line<\/title>\n<meta name=\"description\" content=\"Testing printf over ARM Cortex M4 ITM+SWO line. Learn how to debug and display printf output using Serial Wire Viewer (SWV) in STM32CubeIDE.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Testing printf over ARM Cortex M4 ITM+SWO line\" \/>\n<meta property=\"og:description\" content=\"Testing printf over ARM Cortex M4 ITM+SWO line. Learn how to debug and display printf output using Serial Wire Viewer (SWV) in STM32CubeIDE.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/\" \/>\n<meta property=\"og:site_name\" content=\"FastBit EBA\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/fastbiteba\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-21T04:45:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-26T10:31:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1811\" \/>\n\t<meta property=\"og:image:height\" content=\"895\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"FastBitLab\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fastbiteba\" \/>\n<meta name=\"twitter:site\" content=\"@fastbiteba\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"FastBitLab\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\\\/\"},\"author\":{\"name\":\"FastBitLab\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\"},\"headline\":\"Microcontroller Embedded C Programming Lecture 49| Testing printf over ARM Cortex M4 ITM+SWO line\",\"datePublished\":\"2022-06-21T04:45:13+00:00\",\"dateModified\":\"2023-08-26T10:31:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\\\/\"},\"wordCount\":1364,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/Figure-5-3.png\",\"keywords\":[\"Microcontroller Embedded C programming Lectures\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\\\/\",\"name\":\"Testing printf over ARM Cortex M4 ITM+SWO line\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/Figure-5-3.png\",\"datePublished\":\"2022-06-21T04:45:13+00:00\",\"dateModified\":\"2023-08-26T10:31:49+00:00\",\"description\":\"Testing printf over ARM Cortex M4 ITM+SWO line. Learn how to debug and display printf output using Serial Wire Viewer (SWV) in STM32CubeIDE.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\\\/#primaryimage\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/Figure-5-3.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/Figure-5-3.png\",\"width\":1811,\"height\":895,\"caption\":\"Figure 5. Native compilation\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Microcontroller Embedded C Programming Lecture 49| Testing printf over ARM Cortex M4 ITM+SWO line\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\",\"name\":\"FastBit EBA\",\"description\":\"Your Online Academy of Embedded Systems\",\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\",\"name\":\"FastBit EBA\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/logo-EzNrEnyr.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/logo-EzNrEnyr.png\",\"width\":640,\"height\":640,\"caption\":\"FastBit EBA\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/fastbiteba\\\/\",\"https:\\\/\\\/x.com\\\/fastbiteba\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/fastbit-embedded-brain-academy-b3167b124\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCa1REBV9hyrzGp2mjJCagBg\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\",\"name\":\"FastBitLab\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"caption\":\"FastBitLab\"},\"description\":\"The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Testing printf over ARM Cortex M4 ITM+SWO line","description":"Testing printf over ARM Cortex M4 ITM+SWO line. Learn how to debug and display printf output using Serial Wire Viewer (SWV) in STM32CubeIDE.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/","og_locale":"en_US","og_type":"article","og_title":"Testing printf over ARM Cortex M4 ITM+SWO line","og_description":"Testing printf over ARM Cortex M4 ITM+SWO line. Learn how to debug and display printf output using Serial Wire Viewer (SWV) in STM32CubeIDE.","og_url":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/","og_site_name":"FastBit EBA","article_publisher":"https:\/\/www.facebook.com\/fastbiteba\/","article_published_time":"2022-06-21T04:45:13+00:00","article_modified_time":"2023-08-26T10:31:49+00:00","og_image":[{"width":1811,"height":895,"url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3.png","type":"image\/png"}],"author":"FastBitLab","twitter_card":"summary_large_image","twitter_creator":"@fastbiteba","twitter_site":"@fastbiteba","twitter_misc":{"Written by":"FastBitLab","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/#article","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/"},"author":{"name":"FastBitLab","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d"},"headline":"Microcontroller Embedded C Programming Lecture 49| Testing printf over ARM Cortex M4 ITM+SWO line","datePublished":"2022-06-21T04:45:13+00:00","dateModified":"2023-08-26T10:31:49+00:00","mainEntityOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/"},"wordCount":1364,"commentCount":0,"publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3.png","keywords":["Microcontroller Embedded C programming Lectures"],"articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/","url":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/","name":"Testing printf over ARM Cortex M4 ITM+SWO line","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/#primaryimage"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3.png","datePublished":"2022-06-21T04:45:13+00:00","dateModified":"2023-08-26T10:31:49+00:00","description":"Testing printf over ARM Cortex M4 ITM+SWO line. Learn how to debug and display printf output using Serial Wire Viewer (SWV) in STM32CubeIDE.","breadcrumb":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/#primaryimage","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-3.png","width":1811,"height":895,"caption":"Figure 5. Native compilation"},{"@type":"BreadcrumbList","@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-49-testing-printf-over-arm-cortex-m4-itmswo-line\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fastbitlab.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Microcontroller Embedded C Programming Lecture 49| Testing printf over ARM Cortex M4 ITM+SWO line"}]},{"@type":"WebSite","@id":"https:\/\/fastbitlab.com\/blog\/#website","url":"https:\/\/fastbitlab.com\/blog\/","name":"FastBit EBA","description":"Your Online Academy of Embedded Systems","publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fastbitlab.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fastbitlab.com\/blog\/#organization","name":"FastBit EBA","url":"https:\/\/fastbitlab.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2026\/04\/logo-EzNrEnyr.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2026\/04\/logo-EzNrEnyr.png","width":640,"height":640,"caption":"FastBit EBA"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/fastbiteba\/","https:\/\/x.com\/fastbiteba","https:\/\/www.linkedin.com\/in\/fastbit-embedded-brain-academy-b3167b124\/","https:\/\/www.youtube.com\/channel\/UCa1REBV9hyrzGp2mjJCagBg"]},{"@type":"Person","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d","name":"FastBitLab","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","caption":"FastBitLab"},"description":"The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries."}]}},"_links":{"self":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/9941","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/comments?post=9941"}],"version-history":[{"count":5,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/9941\/revisions"}],"predecessor-version":[{"id":13031,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/9941\/revisions\/13031"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media\/9948"}],"wp:attachment":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media?parent=9941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/categories?post=9941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/tags?post=9941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}