{"id":9991,"date":"2022-06-22T04:17:10","date_gmt":"2022-06-22T04:17:10","guid":{"rendered":"http:\/\/fastbitlab.com\/?p=9991"},"modified":"2022-12-06T12:44:18","modified_gmt":"2022-12-06T07:14:18","slug":"microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting","status":"publish","type":"post","link":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\/","title":{"rendered":"Microcontroller Embedded C Programming Lecture 51 | Testing printf over OpenOCD semihosting"},"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: 32px; border-width: 0px; line-height: 50px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><strong>Testing printf over OpenOCD semihosting<\/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;\">In the previous article, we used the ARM Cortex M4 processors ITM feature to get the prints over the SWO line of the debugger. And this won&#8217;t work if you use a Cortex M0 based STM32 microcontroller. So, we can try the openOCD based semi-hosting technique that I will explain in this article. <\/span><\/p>\n<figure id=\"attachment_9994\" aria-describedby=\"caption-attachment-9994\" style=\"width: 703px\" class=\"wp-caption aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" class=\"wp-image-9994 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-1-6-1024x520.png\" alt=\"Figure 1. OpenOCD Debugger and Semi-hosting\" width=\"703\" height=\"357\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-6-1024x520.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-6-300x152.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-6-768x390.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-6-600x305.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-6-1536x780.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-6-120x61.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-6-500x254.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-6-200x102.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-6-400x203.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-6-800x406.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-6-1200x610.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-1-6.png 1679w\" sizes=\"(max-width: 703px) 100vw, 703px\" \/><figcaption id=\"caption-attachment-9994\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 1. OpenOCD Debugger and Semi-hosting<\/span><\/figcaption><\/figure>\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;\">By the way, OpenOCD is a debugger that helps you to program and debug your code on the board. It stands for the open onchip debugger.<\/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;\">So, to get the print using the openOCD debugger, you have to do a couple of settings in the project.<\/span><\/p>\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;\">Now, let&#8217;s go to our IDE, and I have created a new project here 001Helloworld_semihosting. First, you have to build this 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;\">After building the project, the binary is generated here the .elf file, as shown in Figure 2.<\/span><\/p>\n<figure id=\"attachment_9995\" aria-describedby=\"caption-attachment-9995\" style=\"width: 703px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-9995 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-2-6-1024x563.png\" alt=\"Figure 2. .elf file\" width=\"703\" height=\"387\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-6-1024x563.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-6-300x165.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-6-768x422.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-6-600x330.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-6-120x66.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-6-500x275.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-6-200x110.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-6-400x220.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-6-800x440.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-6.png 1159w\" sizes=\"(max-width: 703px) 100vw, 703px\" \/><figcaption id=\"caption-attachment-9995\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 2. .elf file<\/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 right-click on the project, select <\/span><b>Debug As<\/b><span style=\"font-weight: 400;\">, and go to <\/span><b>Debug Configurations<\/b><span style=\"font-weight: 400;\">, as shown in Figure 3.&nbsp;<\/span><\/span><\/p>\n<figure id=\"attachment_9996\" aria-describedby=\"caption-attachment-9996\" style=\"width: 707px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-9996 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-3-5-1024x548.png\" alt=\"Figure 3. Go to Debug configuration\" width=\"707\" height=\"379\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-5-1024x548.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-5-300x161.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-5-768x411.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-5-600x321.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-5-1536x822.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-5-120x64.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-5-500x268.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-5-200x107.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-5-400x214.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-5-800x428.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-5-1200x642.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-3-5.png 1911w\" sizes=\"(max-width: 707px) 100vw, 707px\" \/><figcaption id=\"caption-attachment-9996\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 3. Go to 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=\"color: #000000;\"><span style=\"font-weight: 400;\">And then go to <\/span><b>STM32 MCU Debugging<\/b><span style=\"font-weight: 400;\">; just expand that. Here, click on <\/span><b>New launch configuration<\/b><span style=\"font-weight: 400;\">, as shown in Figure 4.<\/span><\/span><\/p>\n<figure id=\"attachment_9997\" aria-describedby=\"caption-attachment-9997\" style=\"width: 705px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9997 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-4-5-1024x713.png\" alt=\"Figure 4. Debug Configurations\" width=\"705\" height=\"491\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-5-1024x713.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-5-300x209.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-5-768x535.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-5-600x418.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-5-120x84.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-5-500x348.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-5-200x139.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-5-400x279.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-5-800x557.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-5-1200x836.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-4-5.png 1319w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><figcaption id=\"caption-attachment-9997\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 4. Debug Configurations<\/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;\">Now we are going to create a debug configuration for our .elf file. In the <\/span><b>Debugger,<\/b><span style=\"font-weight: 400;\"> you have to change the debugger now. The Debug probe or Debug software you have to change. Earlier, we used ST-LINK(ST-LINK GDB server), which is the default one for the STM32Cube IDE.<\/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=\"font-weight: 400; color: #000000;\">Now, you have to change this to ST-LINK(OpenOCD). That is the first change you have to make, as shown in Figure 5.<\/span><\/p>\n<figure id=\"attachment_9998\" aria-describedby=\"caption-attachment-9998\" style=\"width: 707px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9998 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-5-5-1024x711.png\" alt=\"Figure 5. Debugger \" width=\"707\" height=\"491\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-5-1024x711.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-5-300x208.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-5-768x533.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-5-600x417.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-5-120x83.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-5-500x347.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-5-200x139.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-5-400x278.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-5-800x555.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-5-1200x833.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-5-5.png 1289w\" sizes=\"(max-width: 707px) 100vw, 707px\" \/><figcaption id=\"caption-attachment-9998\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 5. 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;\">After that, go to <\/span><b>Startup<\/b><span style=\"font-weight: 400;\">, and in the Startup tab, you have to mention the semi-hosting run command. And the command is this one <\/span><b>monitor arm semi hosting enable<\/b><span style=\"font-weight: 400;\">(Figure 1). Just copy that command, go to the IDE and paste it here. Then click on <\/span><b>Apply<\/b><span style=\"font-weight: 400;\"> and click on <\/span><b>Close<\/b><span style=\"font-weight: 400;\">, as shown in Figure 6.<\/span><\/span><\/p>\n<figure id=\"attachment_9999\" aria-describedby=\"caption-attachment-9999\" style=\"width: 705px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9999 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-6-5-1024x687.png\" alt=\"Figure 6. Startup\" width=\"705\" height=\"473\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-5-1024x687.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-5-300x201.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-5-768x515.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-5-600x403.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-5-120x81.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-5-500x335.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-5-200x134.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-5-400x268.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-5-800x537.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-5-1200x805.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-6-5.png 1325w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><figcaption id=\"caption-attachment-9999\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 6. 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=\"font-weight: 400; color: #000000;\">And after that, right-click on the project and go to properties.<\/span><\/p>\n<figure id=\"attachment_10000\" aria-describedby=\"caption-attachment-10000\" style=\"width: 708px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10000 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-7-5-1024x544.png\" alt=\"Figure 7. Properties of project\" width=\"708\" height=\"376\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-5-1024x544.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-5-300x159.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-5-768x408.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-5-600x319.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-5-1536x816.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-5-120x64.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-5-500x266.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-5-200x106.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-5-400x212.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-5-800x425.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-5-1200x637.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-7-5.png 1919w\" sizes=\"(max-width: 708px) 100vw, 708px\" \/><figcaption id=\"caption-attachment-10000\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 7. Properties of 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;\">Go to <\/span><b>C\/C++ Build<\/b><span style=\"font-weight: 400;\">, go to <\/span><b>Settings<\/b><span style=\"font-weight: 400;\">, go to <\/span><b>Tool Settings<\/b><span style=\"font-weight: 400;\"> here, go to <\/span><b>MCU GCC Linker<\/b><span style=\"font-weight: 400;\">, and go to <\/span><b>Miscellaneous<\/b><span style=\"font-weight: 400;\">, as shown in Figure 8.<\/span><\/span><\/p>\n<figure id=\"attachment_10001\" aria-describedby=\"caption-attachment-10001\" style=\"width: 707px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10001\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-8-5-1024x904.png\" alt=\"Testing printf over OpenOCD semihosting\" width=\"707\" height=\"624\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-5-1024x904.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-5-300x265.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-5-768x678.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-5-600x530.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-5-120x106.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-5-500x441.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-5-200x177.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-5-400x353.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-5-800x706.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-8-5.png 1143w\" sizes=\"(max-width: 707px) 100vw, 707px\" \/><figcaption id=\"caption-attachment-10001\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 8. Properties<\/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 here, you have to mention these linker arguments(Figure 1). Let&#8217;s copy these linker arguments, click on the <\/span><b>&#8216;+&#8217; icon <\/b><span style=\"font-weight: 400;\">here, paste those flags, and click on<\/span><b> OK<\/b><span style=\"font-weight: 400;\">.&nbsp;<\/span><\/span><\/p>\n<figure id=\"attachment_10002\" aria-describedby=\"caption-attachment-10002\" style=\"width: 707px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10002\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-9-5-1024x705.png\" alt=\"Testing printf over OpenOCD semihosting\" width=\"707\" height=\"487\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-5-1024x705.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-5-300x207.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-5-768x529.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-5-600x413.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-5-120x83.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-5-500x344.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-5-200x138.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-5-400x276.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-5-800x551.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-5-1200x827.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-9-5.png 1453w\" sizes=\"(max-width: 707px) 100vw, 707px\" \/><figcaption id=\"caption-attachment-10002\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 9. Mention the linker arguments<\/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;\">After that, click <\/span><b>Apply <\/b><span style=\"font-weight: 400;\">here, and click <\/span><b>Apply and Close<\/b><span style=\"font-weight: 400;\">, as shown in Figure 10.&nbsp;<\/span><\/span><\/p>\n<figure id=\"attachment_10003\" aria-describedby=\"caption-attachment-10003\" style=\"width: 707px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10003\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-10-4-1024x917.png\" alt=\"Testing printf over OpenOCD semihosting\" width=\"707\" height=\"633\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-4-1024x917.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-4-300x269.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-4-768x688.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-4-600x537.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-4-120x107.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-4-500x448.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-4-200x179.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-4-400x358.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-4-800x717.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-10-4.png 1131w\" sizes=\"(max-width: 707px) 100vw, 707px\" \/><figcaption id=\"caption-attachment-10003\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 10. Mention the linker arguments<\/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;\">Now go to Src, go to main.c, and here, let&#8217;s write some code. The code is shown in Figure 11.&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=\"color: #000000;\"><span style=\"font-weight: 400;\">Before using any printf statements, you have to add <\/span><b>initialise_monitor_handles(void); <\/b><span style=\"font-weight: 400;\">function call in the main function. And also, you should add its prototype. The prototype is <\/span><b>extern void initialise_monitor_handles(void);&nbsp;<\/b><\/span><\/p>\n<figure id=\"attachment_10004\" aria-describedby=\"caption-attachment-10004\" style=\"width: 705px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10004\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-11-4-1024x516.png\" alt=\"Testing printf over OpenOCD semihosting\" width=\"705\" height=\"355\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-4-1024x516.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-4-300x151.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-4-768x387.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-4-600x302.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-4-1536x774.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-4-120x60.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-4-500x252.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-4-540x272.png 540w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-4-200x101.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-4-400x202.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-4-800x403.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-4-1200x605.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-11-4.png 1911w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><figcaption id=\"caption-attachment-10004\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 11. Src, main.c code<\/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;\">And after that, one more important thing you have to do, that is you have to exclude this syscalls.c from the build.&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=\"color: #000000;\"><span style=\"font-weight: 400;\">For that, right-click on the syscalls.c file, go to properties, go to C\/C++ build, and check this exclude resource from build option. Then click on <\/span><b>Apply<\/b><span style=\"font-weight: 400;\">, click on <\/span><b>Apply and Close<\/b><span style=\"font-weight: 400;\">, as shown in Figure 12.<\/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=\"font-weight: 400; color: #000000;\">Now the syscalls.c file is excluded from the build.<\/span><\/p>\n<figure id=\"attachment_10005\" aria-describedby=\"caption-attachment-10005\" style=\"width: 706px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10005\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-12-3-1024x496.png\" alt=\"Testing printf over OpenOCD semihosting\" width=\"706\" height=\"342\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-3-1024x496.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-3-300x145.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-3-768x372.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-3-600x290.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-3-120x58.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-3-500x242.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-3-200x97.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-3-400x194.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-3-800x387.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-12-3.png 1159w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><figcaption id=\"caption-attachment-10005\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 12. syscalls.c properties<\/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 that, build the project. Right-click on the project and click on a <strong>Build project<\/strong>.&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;\">Your project should build successfully. As shown in Figure 13, the project builds successfully.&nbsp;&nbsp;<\/span><\/p>\n<figure id=\"attachment_10006\" aria-describedby=\"caption-attachment-10006\" style=\"width: 707px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10006\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-13-2-1024x550.png\" alt=\"Testing printf over OpenOCD semihosting\" width=\"707\" height=\"380\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-2-1024x550.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-2-300x161.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-2-768x412.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-2-600x322.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-2-120x64.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-2-500x269.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-2-200x107.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-2-400x215.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-2-800x430.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-13-2.png 1175w\" sizes=\"(max-width: 707px) 100vw, 707px\" \/><figcaption id=\"caption-attachment-10006\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 13. Build 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=\"color: #000000;\"><span style=\"font-weight: 400;\">And then connect your hardware to the PC. After that, debug the code. Right-click on the project, go to <\/span><b>Debug As<\/b><span style=\"font-weight: 400;\"> and Go to the<\/span><b> STM32 MCU C\/C++ Application<\/b><span style=\"font-weight: 400;\">. Then, click on <\/span>the<b> Switch<\/b><span style=\"font-weight: 400;\">.<\/span><\/span><\/p>\n<figure id=\"attachment_10007\" aria-describedby=\"caption-attachment-10007\" style=\"width: 706px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10007\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-14-1-1024x525.png\" alt=\"Testing printf over OpenOCD semihosting\" width=\"706\" height=\"362\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-1-1024x525.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-1-300x154.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-1-768x394.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-1-600x308.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-1-1536x787.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-1-120x62.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-1-500x256.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-1-200x103.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-1-400x205.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-1-800x410.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-1-1200x615.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-14-1.png 1875w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><figcaption id=\"caption-attachment-10007\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 14. Debug perspective<\/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;\">You see Figure 14, it went to a debug perspective, and the red color characters are a log that is produced by the openOCD debugger. And here, you can see that semihosting is enabled(Figure 14).<\/span><\/p>\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;\">Now you can get the prints on the console. Let&#8217;s click on<\/span><b> Step over<\/b><span style=\"font-weight: 400;\">. And again, click on <\/span><b>Step over<\/b><span style=\"font-weight: 400;\"> one more time, and here in the console, we got the print &#8220;Hello World,&#8221; as shown in Figure 15.&nbsp;<\/span><\/span><\/p>\n<figure id=\"attachment_10009\" aria-describedby=\"caption-attachment-10009\" style=\"width: 705px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10009\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/06\/Figure-15-1-1024x521.png\" alt=\"Testing printf over OpenOCD semihosting\" width=\"705\" height=\"359\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-1-1024x521.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-1-300x153.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-1-768x391.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-1-600x305.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-1-1536x781.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-1-120x61.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-1-500x254.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-1-200x102.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-1-400x204.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-1-800x407.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-1-1200x611.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-15-1.png 1885w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><figcaption id=\"caption-attachment-10009\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 15. Printed the 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=\"color: #000000;\"><span style=\"font-weight: 400;\">Remember that, while using prints using printf in semihosting, <\/span><b>\\n<\/b><span style=\"font-weight: 400;\"> is really important. You should not miss that. The string should end with &#8216;<\/span><b>\\n<\/b><span style=\"font-weight: 400;\">&#8216; when using printf under semihosting with an openOCD debugger. So, you can use this feature whenever you want to debug your project using a prints. That&#8217;s about getting prints using openOCD and semihosting on STM32Cube IDE.<\/span><\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 20px; line-height: 27px;\" 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;\"><span style=\"color: #000000;\">lick here:<\/span><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 OpenOCD semihosting &nbsp; &nbsp; In the previous article, we used the ARM Cortex M4 processors ITM feature to get the prints over the SWO line of the debugger. And this won&#8217;t work if you use a Cortex M0 based STM32 microcontroller. So, we can try the openOCD based semi-hosting technique that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":9995,"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-9991","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 OpenOCD semihosting | Embedded systems<\/title>\n<meta name=\"description\" content=\"Testing printf over OpenOCD semihosting. In the previous article, we used the ARM Cortex M4 processors ITM feature to get the prints over the\" \/>\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-51-testing-printf-over-openocd-semihosting\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Testing printf over OpenOCD semihosting | Embedded systems\" \/>\n<meta property=\"og:description\" content=\"Testing printf over OpenOCD semihosting. In the previous article, we used the ARM Cortex M4 processors ITM feature to get the prints over the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\/\" \/>\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-22T04:17:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-12-06T07:14:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-6.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1159\" \/>\n\t<meta property=\"og:image:height\" content=\"637\" \/>\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=\"7 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-51-testing-printf-over-openocd-semihosting\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\\\/\"},\"author\":{\"name\":\"FastBitLab\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\"},\"headline\":\"Microcontroller Embedded C Programming Lecture 51 | Testing printf over OpenOCD semihosting\",\"datePublished\":\"2022-06-22T04:17:10+00:00\",\"dateModified\":\"2022-12-06T07:14:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\\\/\"},\"wordCount\":933,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/Figure-2-6.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-51-testing-printf-over-openocd-semihosting\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\\\/\",\"name\":\"Testing printf over OpenOCD semihosting | Embedded systems\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/Figure-2-6.png\",\"datePublished\":\"2022-06-22T04:17:10+00:00\",\"dateModified\":\"2022-12-06T07:14:18+00:00\",\"description\":\"Testing printf over OpenOCD semihosting. In the previous article, we used the ARM Cortex M4 processors ITM feature to get the prints over the\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\\\/#primaryimage\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/Figure-2-6.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/Figure-2-6.png\",\"width\":1159,\"height\":637,\"caption\":\"Figure 2. .elf file\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Microcontroller Embedded C Programming Lecture 51 | Testing printf over OpenOCD semihosting\"}]},{\"@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 OpenOCD semihosting | Embedded systems","description":"Testing printf over OpenOCD semihosting. In the previous article, we used the ARM Cortex M4 processors ITM feature to get the prints over the","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-51-testing-printf-over-openocd-semihosting\/","og_locale":"en_US","og_type":"article","og_title":"Testing printf over OpenOCD semihosting | Embedded systems","og_description":"Testing printf over OpenOCD semihosting. In the previous article, we used the ARM Cortex M4 processors ITM feature to get the prints over the","og_url":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\/","og_site_name":"FastBit EBA","article_publisher":"https:\/\/www.facebook.com\/fastbiteba\/","article_published_time":"2022-06-22T04:17:10+00:00","article_modified_time":"2022-12-06T07:14:18+00:00","og_image":[{"width":1159,"height":637,"url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-6.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":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\/#article","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\/"},"author":{"name":"FastBitLab","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d"},"headline":"Microcontroller Embedded C Programming Lecture 51 | Testing printf over OpenOCD semihosting","datePublished":"2022-06-22T04:17:10+00:00","dateModified":"2022-12-06T07:14:18+00:00","mainEntityOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\/"},"wordCount":933,"commentCount":1,"publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-6.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-51-testing-printf-over-openocd-semihosting\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\/","url":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\/","name":"Testing printf over OpenOCD semihosting | Embedded systems","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\/#primaryimage"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-6.png","datePublished":"2022-06-22T04:17:10+00:00","dateModified":"2022-12-06T07:14:18+00:00","description":"Testing printf over OpenOCD semihosting. In the previous article, we used the ARM Cortex M4 processors ITM feature to get the prints over the","breadcrumb":{"@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\/#primaryimage","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-6.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/06\/Figure-2-6.png","width":1159,"height":637,"caption":"Figure 2. .elf file"},{"@type":"BreadcrumbList","@id":"https:\/\/fastbitlab.com\/blog\/microcontroller-embedded-c-programming-lecture-51-testing-printf-over-openocd-semihosting\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fastbitlab.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Microcontroller Embedded C Programming Lecture 51 | Testing printf over OpenOCD semihosting"}]},{"@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\/9991","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=9991"}],"version-history":[{"count":5,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/9991\/revisions"}],"predecessor-version":[{"id":13034,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/9991\/revisions\/13034"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media\/9995"}],"wp:attachment":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media?parent=9991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/categories?post=9991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/tags?post=9991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}