{"id":1399,"date":"2021-01-26T10:58:43","date_gmt":"2021-01-26T01:58:43","guid":{"rendered":"https:\/\/ahnbk.com\/?p=1399"},"modified":"2021-01-26T16:00:07","modified_gmt":"2021-01-26T07:00:07","slug":"stm32cubeide%ec%97%90%ec%84%9c-printf%eb%a5%bc-usart%ec%99%80-%ec%97%b0%ea%b2%b0%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/ahnbk.com\/?p=1399","title":{"rendered":"STM32CubeIDE\uc5d0\uc11c printf\ub97c USART\uc640 \uc5f0\uacb0\ud558\uae30"},"content":{"rendered":"\n<p>printf \ucd9c\ub825\uc744 USART\uc640 \uc5f0\uacb0\ud558\uc5ec \uc0ac\uc6a9 \uac00\ub2a5. \ub514\ubc84\uae45 \uc2dc \uc0c1\ub2f9\ud55c \uc774\uc810\uc744 \uac00\uc9c8 \uc218 \uc788\uc74c.<\/p>\n\n\n\n<p>main.c \ud30c\uc77c\uc5d0 \ub2e4\uc74c\uc758 \ud568\uc218\ub97c \ucd94\uac00.<\/p>\n\n\n\n<p>\uc774\ub54c uart\uc758 \uc778\uc2a4\ud134\uc2a4\ub97c \uc124\uc815\ud574\uc57c \ud558\ub294\ub370, STM32F746G-DISCO \ubcf4\ub4dc\uc5d0\uc120 USART1\ubc88\uc774 ST-Link\uc758 Virtual Com Port\uc640 \uc5f0\uacb0\ub418\uc5b4 \uc788\uc74c. \ub530\ub77c\uc11c huart1\ub97c \uc120\ud0dd.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp\">int __io_putchar(int ch) \n{\n     (void) HAL_UART_Transmit(&amp;huart1, (uint8_t*) &amp;ch, 1, 100);\n     return ch;\n}<\/code><\/pre>\n\n\n\n<p>\ud504\ub85c\uc81d\ud2b8 \uc124\uc815\uc5d0\uc11c printf \ubb38\uc5d0 float \uad6c\ubb38\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub3c4\ub85d \uc124\uc815.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img data-attachment-id=\"1400\" data-permalink=\"https:\/\/ahnbk.com\/?attachment_id=1400\" data-orig-file=\"https:\/\/i0.wp.com\/ahnbk.com\/wp-content\/uploads\/2021\/01\/image.png?fit=1087%2C746&amp;ssl=1\" data-orig-size=\"1087,746\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/ahnbk.com\/wp-content\/uploads\/2021\/01\/image.png?fit=1000%2C686&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ahnbk.com\/wp-content\/uploads\/2021\/01\/image.png?fit=525%2C360&amp;ssl=1\" decoding=\"async\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/ahnbk.com\/wp-content\/uploads\/2021\/01\/image.png?resize=525%2C360&#038;ssl=1\" alt=\"\" class=\"wp-image-1400\" width=\"525\" height=\"360\" srcset=\"https:\/\/i0.wp.com\/ahnbk.com\/wp-content\/uploads\/2021\/01\/image.png?w=1087&amp;ssl=1 1087w, https:\/\/i0.wp.com\/ahnbk.com\/wp-content\/uploads\/2021\/01\/image.png?resize=1000%2C686&amp;ssl=1 1000w, https:\/\/i0.wp.com\/ahnbk.com\/wp-content\/uploads\/2021\/01\/image.png?resize=768%2C527&amp;ssl=1 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" data-recalc-dims=\"1\" \/><\/figure><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>\ub367.<\/p>\n\n\n\n<p>\uc704 \ubc29\ubc95\uc744 \uc0ac\uc6a9\ud560 \ub54c, FreeRTOS \ud658\uacbd \ub0b4\uc5d0\uc120 \uc54c \uc218 \uc5c6\ub294 \uc774\uc720\ub85c \ub3d9\uc791\uc774 \ub418\uc9c0 \uc54a\uc74c. \uba54\ubaa8\ub9ac \uad00\ub828 (heap \ub4f1\ub4f1)\uc758 \ubb38\uc81c\ub85c \ucd94\uc815\ub41c\ub2e4\ub294\ub370&#8230; \uc774\ub97c \ud574\uacb0\ud558\uae30 \uc704\ud574\uc120 \uacbd\ub7c9\ud654 \ub418\uc5b4 \uad6c\ud604\ub41c printf \ud568\uc218\ub97c \uc0ac\uc6a9\ud558\uba74 \ub428.<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/mpaland\/printf\">https:\/\/github.com\/mpaland\/printf<\/a><\/p>\n\n\n\n<p>\uc774 Repository\uc758 printf.h, printf.c \ud30c\uc77c\uc744 \ud574\ub2f9 \ud504\ub85c\uc81d\ud2b8\uc5d0 \ucd94\uac00\ud558\uace0, printf.h\ub97c \uc778\ud074\ub8e8\ub4dc\ud558\uc5ec \uc0ac\uc6a9.<\/p>\n\n\n\n<p>\uc0ac\uc6a9\uc790\uc758 \ud658\uacbd\uc5d0 \ub530\ub77c _putchar \ud568\uc218\ub97c \uad6c\ud604\ud558\uba74 \ub428.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp\">void _putchar(char c)\n{\n    \/* Place your implementation of fputc here *\/     \n    \/* e.g. write a character to the EVAL_COM1 and Loop until the end of transmission *\/     \n    <em>HAL_UART_Transmit(&amp;huart1, (uint8_t<\/em>) &amp;c, 1, 0xFFFF);\n}<\/code><\/pre>\n\n\n\n<p>\ub05d!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>printf \ucd9c\ub825\uc744 USART\uc640 \uc5f0\uacb0\ud558\uc5ec \uc0ac\uc6a9 \uac00\ub2a5. \ub514\ubc84\uae45 \uc2dc \uc0c1\ub2f9\ud55c \uc774\uc810\uc744 \uac00\uc9c8 \uc218 \uc788\uc74c. main.c \ud30c\uc77c\uc5d0 \ub2e4\uc74c\uc758 \ud568\uc218\ub97c \ucd94\uac00. \uc774\ub54c uart\uc758 \uc778\uc2a4\ud134\uc2a4\ub97c \uc124\uc815\ud574\uc57c \ud558\ub294\ub370, STM32F746G-DISCO \ubcf4\ub4dc\uc5d0\uc120 USART1\ubc88\uc774 ST-Link\uc758 Virtual Com Port\uc640 \uc5f0\uacb0\ub418\uc5b4 \uc788\uc74c. \ub530\ub77c\uc11c huart1\ub97c \uc120\ud0dd. \ud504\ub85c\uc81d\ud2b8 \uc124\uc815\uc5d0\uc11c printf \ubb38\uc5d0 float \uad6c\ubb38\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub3c4\ub85d \uc124\uc815. \ub367. \uc704 \ubc29\ubc95\uc744 \uc0ac\uc6a9\ud560 \ub54c, FreeRTOS \ud658\uacbd \ub0b4\uc5d0\uc120 \uc54c \uc218 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/ahnbk.com\/?p=1399\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;STM32CubeIDE\uc5d0\uc11c printf\ub97c USART\uc640 \uc5f0\uacb0\ud558\uae30&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"footnotes":"","_jetpack_memberships_contains_paid_content":false},"categories":[281],"tags":[314,313,315,312],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2wXSW-mz","jetpack-related-posts":[],"jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/posts\/1399"}],"collection":[{"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ahnbk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1399"}],"version-history":[{"count":3,"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/posts\/1399\/revisions"}],"predecessor-version":[{"id":1404,"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/posts\/1399\/revisions\/1404"}],"wp:attachment":[{"href":"https:\/\/ahnbk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahnbk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahnbk.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}