{"id":2570,"date":"2023-01-23T12:29:17","date_gmt":"2023-01-23T04:29:17","guid":{"rendered":"http:\/\/www.hellofpga.com\/?p=2570"},"modified":"2023-01-23T12:29:48","modified_gmt":"2023-01-23T04:29:48","slug":"smart-zynq_uart","status":"publish","type":"post","link":"http:\/\/www.hellofpga.com\/index.php\/2023\/01\/23\/smart-zynq_uart\/","title":{"rendered":"Smart ZYNQ\u677f \u5de5\u7a0b\u5341\u516d \u57fa\u4e8eZYNQ\u7684PS\u90e8\u5206UART\u529f\u80fd\u6f14\u793a"},"content":{"rendered":"\n<p>\u672c\u6587\u7528MIO\u7684\u65b9\u5f0f\u5728\u4e3b\u677f\u4e0a\u6f14\u793a\u4e32\u53e3\u7684hello world\u4f8b\u7a0b\uff08\u9002\u7528\u4e8e\u4e3b\u677fType C \u7aef\u53e3\u7684UART\u8d44\u6e90\uff09<\/p>\n\n\n\n<p>\u672c\u6587\u5728 vivado2018.3\u7248\u672c\u4e0a \u6f14\u793a\uff0c \u5176\u4ed6\u7248\u672c\u8bf7\u81ea\u884c\u7814\u7a76<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1.\u786c\u4ef6\u8d44\u6e90\u4ecb\u7ecd<\/h2>\n\n\n\n<p>PS\u7aef\u4e32\u53e3\u7684\u6620\u5c04\u6709\u4e24\u79cd\uff0c\u65b9\u5f0f\u4e00 \u76f4\u63a5\u901a\u8fc7ZYNQ\u7684PS\u4e13\u7528\u4e32\u53e3\u7684IO\u53e3\u3002 \u65b9\u5f0f2 PS\u7aef\u7684UART \u901a\u8fc7EMIO\u65b9\u5f0f\u6620\u5c04\u5230\u4efb\u610fPL\u7aef\u53e3\u8fdb\u884c\u5f15\u51fa\uff0c\u4e24\u79cd\u65b9\u5f0f\u7684\u6548\u679c\u662f\u5b8c\u5168\u4e00\u6837\u7684\uff08\u65b9\u5f0f\u53ef\u4ee5\u62d3\u5c55\u5230PL\u7aef\u7684\u4efb\u610fIO\u53e3\uff09\u3002\uff08\u56e0\u4e3a\u6211\u4eec\u7684\u4e32\u53e3\u662f\u8fde\u63a5\u5728PS\u7aef\u7684\uff0c\u6240\u4ee5\u8fd9\u91cc\u6211\u4eec\u7528\u65b9\u5f0f\u4e00 \u901a\u8fc7MIO\u5c06UART \u6620\u5c04\u5230PL\u7aef IO\u4e0a\uff09<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. \u521b\u5efa\u5de5\u7a0b<\/h2>\n\n\n\n<p>1\uff09\u65b0\u5efa\u4e00\u4e2a\u9879\u76ee\uff0c\u82af\u7247\u578b\u53f7\u9009\u62e9\u6309\u4e0b\u9762\u9009\u62e9\uff08<strong>\u677f\u5b50\u751f\u4ea7\u4e86\u591a\u4e2a\u82af\u7247\u578b\u53f7<\/strong>\uff0c<strong>\u8bf7\u6839\u636e\u81ea\u5df1\u677f\u5b50\u7684\u578b\u53f7\u6765\u8fdb\u884c\u9009\u62e9<\/strong>\uff09<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>XA7Z020 (\u76f4\u63a5\u9009\u62e9<strong>xc7z020CLG400-1<\/strong>\uff0c\u56e0\u4e3a\u7cfb\u7edf\u8bc6\u522b\u5230\u7684\u662fxc7z020-1)<\/li>\n\n\n\n<li>XC7Z010-1 (xc7z010CLG400-1)&nbsp;<strong>\uff087010 \u82af\u7247\uff09<\/strong><\/li>\n\n\n\n<li>XC7Z020-1 (xc7z020CLG400-1)&nbsp;<strong>\u540e\u7eed\u751f\u4ea7<\/strong><\/li>\n\n\n\n<li>XC7Z020-2 (xc7z020CLG400-2)&nbsp;<strong>\u540e\u7eed\u751f\u4ea7<\/strong><\/li>\n<\/ul>\n\n\n\n<p><strong>\u5907\u6ce8<\/strong>&nbsp;\uff087020 \u8f66\u89c4\u7ea7\u7248\u5728vivado2018.3\u8bc6\u522b\u51fa\u7684\u662fXC7Z020\uff0c<strong>\u5982\u679c\u5de5\u7a0b\u9009\u62e9xa7z020 ,\u5728SDK\u73af\u5883\u4e0b\u6709\u65f6\u5019\u4f1a\u5f39\u51fa\u8b66\u544a<\/strong>\uff0c\u6240\u4ee5\u8fd9\u91cc\u76f4\u63a5\u9009\u62e9XC7Z020CLG400-1\uff09<\/p>\n\n\n\n<p>2) \u521b\u5efa\u4e00\u4e2aBLOCK\u8bbe\u8ba1\uff0c\u5e76\u6dfb\u52a0ZYNQ7 PROCESSING SYSTEM\u6a21\u5757\uff0c\u8f6f\u4ef6\u81ea\u52a8\u751f\u6210\u4e86\u4e00\u4e2a zynq\u7684block \u5982\u4e0b\u56fe\u6240\u793a\uff0c\u63a5\u4e0b\u6765\u8981\u505a\u4e00\u4e9b\u76f8\u5e94\u7684\u8bbe\u7f6e\uff0c\u53cc\u51fb\u4e0b\u56fe\u4e2d\u7684ZYNQ\u6838<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-3.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>3\uff09\u5728ZYNQ\u4e2d\u8bbe\u7f6e\u65f6\u949f\u529f\u80fd\uff1a<\/p>\n\n\n\n<p>\u627e\u5230 \u8bbe\u7f6e\u9879\u76ee\u4e2d\u7684 Clock Configuration \u9009\u9879\uff0c \u5728PL Fabric Clocks \u8bbe\u7f6e\u81ea\u5df1\u9700\u8981\u7684\u65f6\u949f\u9891\u7387\uff0c\u8fd9\u91cc\u4e00\u5171\u67094\u79cd\u9891\u7387\u53ef\u4ee5\u8bbe\u7f6e \u7c7b\u4f3c\u4e8e\u6211\u4eec\u7684PLL\u529f\u80fd\u3002\u8fd9\u91cc\u6211\u4eec\u8bbe\u7f6e50M\u65f6\u949f<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"583\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-50.png\" alt=\"\" class=\"wp-image-264\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-50.png 960w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-50-300x182.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-50-768x466.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>4\uff09\u4f9d\u6b21\u5728\u5f39\u7a97\u91cc\u627e\u5230DDR Configuration\u2192DDR Controller Configuration\u2192DDR3\uff0c\u5728Memory Part\u4e0b\u62c9\u83dc\u5355\u4e2d\u6839\u636e\u81ea\u5df1\u677f\u5b50\u4e0a\u7684DDR\u6765\u9009\u62e9\u76f8\u5e94\u7684DDR3\uff0c\u672c\u5b9e\u9a8c\u6240\u7528\u5230\u578b\u53f7\uff1aMT41K256M16RE-125\uff0c\u6570\u636e\u4f4d\u5bbd\u9009\u62e916bit \u6700\u540e\u70b9\u51fb\u201cOK\u201d,\u5982\u4e0b\u56fe\u6240\u793a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"788\" height=\"453\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-70.png\" alt=\"\" class=\"wp-image-2527\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-70.png 788w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-70-300x172.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-70-768x442.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>5) \u6dfb\u52a0 uart\u529f\u80fd<\/p>\n\n\n\n<p>\u7531\u4e0b\u56fe\u53ef\u77e5\uff0c \u4e3b\u677f\u7684UART\u529f\u80fd\u63a5\u5728 ZYNQ PS\u7aef\u7684 B13\u811a\u548cB9\u811a\u4e86\uff0c\u5373 ZYNQ\u7684TX\u662f \u8fde\u63a5MIO51\uff0cZYNQ\u7684RX\u662f\u8fde\u63a5MIO50<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"846\" height=\"237\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-79.png\" alt=\"\" class=\"wp-image-2575\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-79.png 846w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-79-300x84.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-79-768x215.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\u4f7f\u80fdUART 0 \u5e76\u5728IO\u9009\u9879\u529b \u9009\u62e9MIO\u65b9\u5f0f\uff0c\u4e0b\u62c9\u83dc\u5355\u91cc\u9009\u62e9MIO50-51<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"657\" height=\"183\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-80.png\" alt=\"\" class=\"wp-image-2577\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-80.png 657w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-80-300x84.png 300w\" sizes=\"auto, (max-width: 657px) 100vw, 657px\" \/><\/figure>\n\n\n\n<p>6\uff09\u5b8c\u6210\u4e0a\u8ff0\u64cd\u4f5c\u540e\uff0c \u70b9\u51fb\u201cRun Block Automation\u201d\u5982\u4e0b\u56fe\u6240\u793a\u3002\u5728\u5f39\u51fa\u7684\u9009\u9879\u4e2d\u4fdd\u6301\u9ed8\u8ba4\uff0c\u70b9\u51fb\u201cOK\u201d\uff0c\u5373\u53ef\u5b8c\u6210\u5bf9ZYNQ7 Processing System\u7684\u914d\u7f6e\uff0c\u5e76\u7528\u9f20\u6807\u8fde\u63a5FCLK_CLK\u548c M_AXI_GP0_ACLK\uff0c\u5f97\u5230\u4e0b\u56fe<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"594\" height=\"266\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-81.png\" alt=\"\" class=\"wp-image-2579\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-81.png 594w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-81-300x134.png 300w\" sizes=\"auto, (max-width: 594px) 100vw, 594px\" \/><\/figure>\n\n\n\n<p>7\uff09source\u2192Design Source \uff0c\u53f3\u952e\u6211\u4eec\u521b\u5efa\u7684BLOCK\u5de5\u7a0b\uff0c\u70b9\u51fbcreate HDL wrapper\uff0c\u6253\u5305BLOCK\u6587\u4ef6\u5e76\u751f\u6210.v\u4ee3\u7801<\/p>\n\n\n\n<p>8) \u70b9\u51fb\u7eff\u8272\u7bad\u5934RUN \u5bf9\u4ee3\u7801\u8fdb\u884c\u7f16\u8bd1<\/p>\n\n\n\n<p>9) \u56e0\u4e3a\u8fd9\u8fb9\u7528\u7684\u662f\u539f\u751fMIO \u8d44\u6e90\uff0c\u5e76\u4e14\u6ca1\u6709\u4f7f\u7528\u4efb\u4f55PL\u7684IO\u53e3\uff0c\u6240\u4ee5\u8fd9\u8fb9\u4e0d\u9700\u8981\u989d\u5916\u521b\u5efa\u7ba1\u811a\u7ea6\u675f<\/p>\n\n\n\n<p>10) \u751f\u6210bit\u6587\u4ef6 :\u6309\u4e0bGenerate Bitstream \u5b8c\u6210\u7efc\u5408\u4ee5\u53ca\u751f\u6210bit\u6587\u4ef6\uff08\u4f1a\u5f39\u51fa\u7a97\u53e3\u8981\u6c42\u4fdd\u5b58 \u7ea6\u675f\u89c4\u5219\u6587\u4ef6\uff09<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"303\" height=\"203\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-18.png\" alt=\"\" class=\"wp-image-204\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-18.png 303w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-18-300x201.png 300w\" sizes=\"auto, (max-width: 303px) 100vw, 303px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">5.SDK\u7a0b\u5e8f\u7f16\u5199<\/h2>\n\n\n\n<p>1\uff09File\u2192Export\u2192Export hardware\u2026\uff0c\u5728\u5f39\u51fa\u7684\u5bf9\u8bdd\u6846\u4e2d\u52fe\u9009\u201cinclude bitstream\u201d\uff0c\u70b9\u51fb\u201cOK\u201d\u786e\u8ba4\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"425\" height=\"466\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-10.png\" alt=\"\" class=\"wp-image-829\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-10.png 425w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-10-274x300.png 274w\" sizes=\"auto, (max-width: 425px) 100vw, 425px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"332\" height=\"252\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-24.png\" alt=\"\" class=\"wp-image-211\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-24.png 332w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-24-300x228.png 300w\" sizes=\"auto, (max-width: 332px) 100vw, 332px\" \/><\/figure>\n\n\n\n<p>2\uff09File\u2192Lauch SDK\uff0c\u5728\u5f39\u51fa\u7684\u5bf9\u8bdd\u6846\u4e2d\uff0c\u4fdd\u5b58\u9ed8\u8ba4\uff0c\u70b9\u51fb\u201cOK\u201d\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"361\" height=\"285\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-21.png\" alt=\"\" class=\"wp-image-212\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-21.png 361w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-21-300x237.png 300w\" sizes=\"auto, (max-width: 361px) 100vw, 361px\" \/><\/figure>\n\n\n\n<p>\u7cfb\u7edf\u5c06\u81ea\u52a8\u6253\u5f00SDK\u5f00\u53d1\u73af\u5883<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"998\" height=\"748\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-22.png\" alt=\"\" class=\"wp-image-213\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-22.png 998w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-22-300x225.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-22-768x576.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>3\uff09\u65b0\u5efa\u4e00\u4e2a\u5de5\u7a0b file\u2192new\u2192Application Project\uff0c\u6765\u65b0\u5efa\u4e00\u4e2a\u201cApplication Project\u201d\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"546\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-23.png\" alt=\"\" class=\"wp-image-214\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-23.png 624w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-23-300x263.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>4\uff09\u5728\u65b0\u5efa\u5de5\u7a0b\u540d\u4e2d\u8f93\u5165\u81ea\u5df1\u7684\u5de5\u7a0b\u540d\u79f0(UART)\uff0c\u70b9\u51fbNEXT<\/p>\n\n\n\n<p>5)\u9009\u62e9\u4e00\u4e2a\u7a7a\u5de5\u7a0b,\u70b9\u51fb\u5b8c\u6210<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"421\" height=\"194\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-73.png\" alt=\"\" class=\"wp-image-330\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-73.png 421w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-73-300x138.png 300w\" sizes=\"auto, (max-width: 421px) 100vw, 421px\" \/><\/figure>\n\n\n\n<p>6) \u5728\u7a7a\u5de5\u7a0b\u4e2d\u521b\u5efa\u6211\u4eec\u81ea\u5df1\u7684\u4ee3\u7801<\/p>\n\n\n\n<p>\u5c55\u5f00\u6211\u4eec\u521b\u5efa\u7684\u5de5\u7a0b,\u5728src\u76ee\u5f55\u4e0a\u53f3\u952e\uff0c\u9009\u62e9New-&gt;Source File\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"362\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-76.png\" alt=\"\" class=\"wp-image-333\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-76.png 640w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-76-300x170.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>\u5728\u5f39\u51fa\u7684\u7a97\u53e3\u4e2d\u521b\u5efa\u4e00\u4e2amain.c\u6587\u4ef6<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"528\" height=\"422\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-77.png\" alt=\"\" class=\"wp-image-334\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-77.png 528w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2021\/08\/image-77-300x240.png 300w\" sizes=\"auto, (max-width: 528px) 100vw, 528px\" \/><\/figure>\n\n\n\n<p>7\uff09\u4e66\u5199\u81ea\u5df1\u7684\u4ee3\u7801<\/p>\n\n\n\n<p>7.1<strong>\u5c0f\u8d34\u58eb\uff1a<\/strong><\/p>\n\n\n\n<p>\u5728\u521d\u6b21\u5199PS\u90e8\u5206\u7684\u4ee3\u7801\u65f6\uff0c\u5982GPIO\u4ee3\u7801 \u548cUART\u4ee3\u7801\uff0c\u4e0d\u77e5\u9053\u600e\u4e48\u5199\u7684\u60c5\u51b5\u4e0b\uff0c\u5176\u5b9e\u53ef\u4ee5\u901a\u8fc7\u6253\u5f00 BSP\u5de5\u7a0b\u4e0b\u7684 system.mss\u6587\u4ef6\uff0c \u7136\u540e\u5728\u53f3\u8fb9\u5bfc\u5165\u9700\u8981\u7684\u53c2\u8003\u4f8b\u7a0b\uff0c \u7136\u540e\u5c06\u4f8b\u7a0b\u4e2d\u81ea\u5df1\u9700\u8981\u7684\u90e8\u5206\uff08\u5982GPIO\u521d\u59cb\u5316\uff0c\u6216\u8005UART\u7684\u5199\u548c\u8bfb\u4ee3\u7801COPY\u5230\u81ea\u5df1\u5de5\u7a0b\u7684main\u51fd\u6570\u4e2d\uff09\u518d\u8fdb\u884c\u4fee\u6539\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"607\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-11-1024x607.png\" alt=\"\" class=\"wp-image-830\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-11-1024x607.png 1024w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-11-300x178.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-11-768x455.png 768w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-11.png 1116w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>7.2 \u590d\u5236 \u4e0b\u5217\u4ee3\u7801 \u5230 main.c<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include \"xparameters.h\"\n#include \"xuartps.h\"\n#include \"xil_printf.h\"\n\nXUartPs Uart_Ps_0;\t\t\/* The instance of the UART Driver *\/\n\nint UART_init(){\n\tXUartPs_Config *Config;\n\tint Status;\n\n\tConfig = XUartPs_LookupConfig(XPAR_XUARTPS_0_DEVICE_ID);\n\tStatus = XUartPs_CfgInitialize(&amp;Uart_Ps_0, Config, Config-&gt;BaseAddress);\n\tXUartPs_SetBaudRate(&amp;Uart_Ps_0, 115200);\n\n\treturn Status;\n}\n\nvoid UartPs_HelloWorld()\n{\n\tu8 HelloWorld[] = \"Hello World  \";\n\tint SentCount = 0;\n\n\twhile (SentCount &lt; (sizeof(HelloWorld) - 1)) {\n\t\t XUartPs_Send(&amp;Uart_Ps_0, &amp;HelloWorld[SentCount], 1);\n\t\tSentCount++;\n\t}\n}\n\nint main(void)\n{\n\tint Delay;\n\tUART_init();\n\twhile(1){\n\t\tUartPs_HelloWorld();\n\t\tfor (Delay = 0; Delay &lt; 100000000; Delay++);\n\t}\n}\n<\/pre>\n\n\n\n<p>\u6211\u8fd9\u8fb9\u53c2\u8003\u4e86\u5b98\u65b9\u7684\u4ee3\u7801\uff0c \u5e76\u505a\u4e86\u4e00\u5b9a\u7684\u5220\u51cf\uff08\u5220\u9664\u4e86\u4e0d\u5fc5\u8981\u7684\u521d\u59cb\u5316\u9a8c\u8bc1\u7b49\uff09\uff0c\u5c06UART 0\u8fdb\u884c\u4e86\u521d\u59cb\u5316\uff0c \u5e76\u4e14\u5728helloworld\u7684\u4ee3\u7801\u4e2d\uff0c\u7aef\u53e3\u8fdb\u884chelloworld\u7684\u5b57\u7b26\u4e32\u8f93\u51fa\uff0c\u53cd\u590d\u5faa\u73af\u3002<\/p>\n\n\n\n<p>8.\u4ee3\u7801\u4e0b\u8f7d\u9a8c\u8bc1<\/p>\n\n\n\n<p>\u5148\u5bf9 RUN AS \u7684\u73af\u5883\u8fdb\u884c\u914d\u7f6e<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"754\" height=\"679\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-12.png\" alt=\"\" class=\"wp-image-833\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-12.png 754w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-12-300x270.png 300w\" sizes=\"auto, (max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px\" \/><\/figure>\n\n\n\n<p>\u5728\u5f39\u51fa\u7684\u7a97\u53e3\u4e2d \u5bf94\u4e2a \u65b9\u6846\u90fd\u8fdb\u884c\u52fe\u9009\u64cd\u4f5c\uff0c\u4ee5\u786e\u4fdd\u6bcf\u6b21\u8fd0\u884c\u90fd\u4f1a\u91cd\u65b0\u542f\u52a8\u7cfb\u7edf\uff0c\u5e76\u4e14\u91cd\u65b0\u7f16\u7a0bFPGA\uff0c \u8fd9\u6837\u5c31\u4e0d\u4f1a\u51fa\u73b0\u4e0b\u8f7d\u7a0b\u5e8fdebug\u7684\u65f6\u5019\u6982\u7387\u6027\u4e0d\u5de5\u4f5c\u7684\u95ee\u9898\u4e86\uff08\u4e0d\u52fe\u9009\u60c5\u51b5\u4e0b\uff0c\u677f\u5b50\u672c\u8eab\u8fd0\u884c\u7a0b\u5e8f\u7684\u65f6\u5019\uff0c\u518d\u91cd\u65b0debug\u4f1a\u6982\u7387\u6027\u51fa\u73b0\u4e0b\u8f7d\u62a5\u9519\u7684\u60c5\u51b5\uff09PS\u6ca1\u6709\u51fa\u73b0 \u4e0b\u56fe\u5bf9\u8bdd\u6846\uff0c\u53ef\u4ee5\u5148\u70b9\u7eff\u8272\u7bad\u5934DEBUG\u4e00\u4e0b \uff0c\u518d\u91cd\u65b0 \u70b9\u9009\u4e0a\u56feRUN CONFIGURATIONS \u7684\u9009\u9879<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"793\" height=\"638\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-120.png\" alt=\"\" class=\"wp-image-1344\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-120.png 793w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-120-300x241.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/10\/image-120-768x618.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\u8bbe\u7f6e\u597d\u4e4b\u540e\uff0c\u9009\u62e9<code>Run As<\/code>&nbsp;-&gt;&nbsp;<code>Launch on Hardware (System Debugger)<\/code>&nbsp;\u6216\u8005 Launch on Hardware (GDB).<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"178\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-14.png\" alt=\"\" class=\"wp-image-835\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-14.png 780w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-14-300x68.png 300w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-14-768x175.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>\u7ecf\u8fc7\u4e0a\u8ff0\u64cd\u4f5c\u540e\uff0c\u4e32\u53e3\u5c31\u4f1a\u6b63\u5e38\u8f93\u51fa\u6570\u636e\u4e86\uff0c\u6b64\u65f6\u7528\u4e32\u53e3\u52a9\u624b\u53bb\u67e5\u770b\uff0c\u53ef\u4ee5\u770b\u5230 \u7cfb\u7edf\u5728\u4e0d\u505c\u7684\u53d1\u9001 hello world\u5b57\u7b26\u4e32\uff08\u4e32\u53e3\u6ce2\u7279\u7387 115200\uff09<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"211\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-15.png\" alt=\"\" class=\"wp-image-836\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-15.png 474w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2022\/07\/image-15-300x134.png 300w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/figure>\n\n\n\n<p>\u4ee5\u4e0b\u662f\u672c\u6587\u4e2d\u63d0\u5230\u7684\u5b8c\u6574\u5de5\u7a0b \uff0c\u4ec5\u4f9b\u53c2\u8003<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-a9f3fe30-4766-4e3e-9f98-e755de1214ae\" href=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/16_PS_UART_TEST_XC7Z010_1.zip\">16_PS_UART_TEST_XC7Z010_1<\/a><a href=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/16_PS_UART_TEST_XC7Z010_1.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-a9f3fe30-4766-4e3e-9f98-e755de1214ae\">\u4e0b\u8f7d<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-8b034cda-ecf1-4bd4-b351-bc7b918a6cd3\" href=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/16_PS_UART_TEST_XC7Z020_1.zip\">16_PS_UART_TEST_XC7Z020_1<\/a><a href=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/16_PS_UART_TEST_XC7Z020_1.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-8b034cda-ecf1-4bd4-b351-bc7b918a6cd3\">\u4e0b\u8f7d<\/a><\/div>\n\n\n\n<p>\u5907\u6ce8 ZYNQ\u82af\u7247\u529f\u80fd\u975e\u5e38\u5f3a\u5927\uff0c\u4e0a\u8ff0\u4ec5\u8fdb\u884c\u7b80\u5355\u7684helloworld\u6f14\u793a\uff0c \u5b9e\u9645\u4e32\u53e3\u529f\u80fd\u8fd8\u53ef\u4ee5\u8c03\u7528\u4e2d\u65ad\uff0c\u8c03\u7528FIFO\u7b49\uff0c\u8fd9\u4e2a\u5404\u81ea\u81ea\u884c\u5b66\u4e60\u5c1d\u8bd5\u4e86<\/p>\n\n\n\n<p>\u5907\u6ce8 \u5982\u679c\u4f60\u4f7f\u7528\u81ea\u5df1\u7684TYPE C\u5145\u7535\u7ebf \u8bf7\u6ce8\u610f\uff0c\u90e8\u5206\u5e02\u9762\u4e0a\u7684TYPE C\u5145\u7535\u7ebf \u662f\u4ec5\u5145\u7535\u7684\uff0c\u4e0d\u5e26\u6570\u636e\u4f20\u8f93\u529f\u80fd\uff0c\u9700\u8981\u7528TYPE C \u6570\u636e\u7ebf\u624d\u80fd\u5b9e\u73b0\u901a\u8baf<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u7528MIO\u7684\u65b9\u5f0f\u5728\u4e3b\u677f\u4e0a\u6f14\u793a\u4e32\u53e3\u7684hello world\u4f8b\u7a0b\uff08\u9002\u7528\u4e8e\u4e3b\u677fType C \u7aef\u53e3\u7684UART\u8d44\u6e90\uff09<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-2570","post","type-post","status-publish","format-standard","hentry","category-smart-zynq-board"],"views":882,"_links":{"self":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/2570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/comments?post=2570"}],"version-history":[{"count":9,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/2570\/revisions"}],"predecessor-version":[{"id":2600,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/2570\/revisions\/2600"}],"wp:attachment":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/media?parent=2570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/categories?post=2570"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/tags?post=2570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}