{"id":234,"date":"2021-04-18T12:30:21","date_gmt":"2021-04-18T03:30:21","guid":{"rendered":"https:\/\/drroot.page\/wp\/?p=234"},"modified":"2021-04-18T12:30:53","modified_gmt":"2021-04-18T03:30:53","slug":"mbed-cli%e3%81%a7mbed-os-2%e7%b3%bb%e3%81%ae%e3%82%b3%e3%83%b3%e3%83%91%e3%82%a4%e3%83%ab%e3%82%92%e3%81%99%e3%82%8b%ef%bc%88lpc11u35%e3%82%92%e3%83%ad%e3%83%bc%e3%82%ab%e3%83%ab%e3%83%93%e3%83%ab","status":"publish","type":"post","link":"https:\/\/drroot.page\/wp\/?p=234","title":{"rendered":"Mbed Cli\u3067Mbed OS 2\u7cfb\u306e\u30b3\u30f3\u30d1\u30a4\u30eb\u3092\u3059\u308b\uff08LPC11U35\u3092\u30ed\u30fc\u30ab\u30eb\u30d3\u30eb\u30c9\u3059\u308b\uff09"},"content":{"rendered":"<h1>Mbed \u30ed\u30fc\u30ab\u30eb\u30b3\u30f3\u30d1\u30a4\u30eb\u30d0\u30c8\u30eb<\/h1>\n<h2>\u6982\u8981<\/h2>\n<p>Mbed\u306e\u30ed\u30fc\u30ab\u30eb\u30b3\u30f3\u30d1\u30a4\u30eb\u306b\u95a2\u3057\u3066\u306f\u516c\u5f0f\u3067\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u3042\u308b\u3088\u3046\u306b\u898b\u305b\u304b\u3051\u3066\u3001\u66f8\u3044\u3066\u3042\u308b\u901a\u308a\u306b\u3084\u3063\u3066\u3082\u4e0a\u624b\u304f\u884c\u304b\u306a\u304b\u3063\u305f\u308a\u3059\u308b\u3002<br \/>\n\u305d\u3082\u305d\u3082\u73fe\u884c\u306eMbed\u306fMbed OS 5\u304c\u30e1\u30a4\u30f3\u30b9\u30c8\u30ea\u30fc\u30e0\u3067\u958b\u767a\u3055\u308c\u3066\u304a\u308a\u3001LPC11u35\u542b\u3080\u4e00\u90e8\u30de\u30a4\u30b3\u30f3\u306f\u3053\u306e\u7cfb\u5217\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u3002<br \/>\n\u3053\u308c\u3089\u65e7\u5f0f\u306eMbed\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u6240\u8b02Mbed OS 2\u7cfb\u3068\u3057\u3066\u30b5\u30dd\u7d42\u307f\u305f\u3044\u306a\u6271\u3044\u306b\u306a\u3063\u3066\u304a\u308a\u3001\u4f55\u304b\u3068\u4e0d\u9047\u3067\u3042\u308b\u3002<br \/>\n\u8272\u3005\u624b\u3053\u305a\u3063\u305f\u306e\u3067\u5099\u5fd8\u9332\u3092\u6b8b\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u624b\u9806<\/h2>\n<h3>Mbed CLI\u3092\u5165\u308c\u308b<\/h3>\n<p>\u958b\u5e55\u3044\u304d\u306a\u308a\u3001Mbed OS 2\u306fMbed CLI\u306e\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3042\u308bCLI 1\u3092\u5165\u308c\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3002<br \/>\n\u3053\u3044\u3064\u304cPython\u306a\u306e\u3067\u3001\u74b0\u5883\u5909\u6570\u4e91\u3005\u3067\u30c8\u30e9\u30d6\u3063\u305f\u308a\u3059\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u304c\u3001\u3088\u3057\u306a\u306b\u306a\u3093\u3068\u304b\u3057\u3088\u3046\u3002<br \/>\nWindows\u5411\u3051\u306a\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u304c\u3042\u308b\u306e\u3067\u3001\u3053\u3044\u3064\u3092\u53e9\u3051\u3070OK\u3002\u2026Python 2.7\u7cfb\u304b\u3088\uff01\u52d8\u5f01\u3057\u3066\u304f\u308c\u3084\u3002<br \/>\n<a href=\"https:\/\/os.mbed.com\/docs\/mbed-os\/v6.9\/build-tools\/install-and-set-up.html\">https:\/\/os.mbed.com\/docs\/mbed-os\/v6.9\/build-tools\/install-and-set-up.html<\/a><\/p>\n<p>\u30b3\u30de\u30f3\u30c9\u304c\u901a\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3089OK\u3060\u3002<\/p>\n<pre><code>> C:\\Users\\Roor&gt;mbed --version\n1.8.3<\/code><\/pre>\n<h3>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u7acb\u3061\u4e0a\u3052<\/h3>\n<p>\u9069\u5f53\u306a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067mbed new\u30b3\u30de\u30f3\u30c9\u3092\u53e9\u304f\u308f\u3051\u3060\u304c\u3001\u3053\u306e\u6642Mbed OS 2\u7cfb\u5411\u3051\u306b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u308b\u5834\u5408\u306f&#8211;mbedlib\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u8981\u308b\u3002<\/p>\n<pre><code>> mbed new your-project-name --mbedlib\n[mbed] Working path &quot;D:\\[\u7565]&quot; (directory)\n[mbed] Program path &quot;D:\\[\u7565]&quot;\n[mbed] Creating new program &quot;mbedcli-11u35&quot; (git)\n[mbed] Adding library &quot;mbed&quot; from &quot;https:\/\/mbed.org\/users\/mbed_official\/code\/mbed\/builds&quot; at branch\/tag &quot;tip&quot;\n[mbed] Downloading library build &quot;65be27845400&quot; (might take a while)\n[mbed] Unpacking library build &quot;65be27845400&quot; in &quot;D:\\[\u7565]\\your-project-name\\mbed&quot;\n[mbed] Unpacking library build &quot;65be27845400&quot; in &quot;D:\\[\u7565]\\your-project-name\\mbed&quot;\n[mbed] Updating reference &quot;mbed&quot; -&gt; &quot;https:\/\/mbed.org\/users\/mbed_official\/code\/mbed\/builds\/65be27845400&quot;\n[mbed] Couldn&#039;t find build tools in your program. Downloading the mbed 2.0 SDK tools...<\/code><\/pre>\n<p>\u3053\u306e\u6642\u306b\u3087\u308d\u3063\u3068Mbed\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u3076\u3061\u3053\u3093\u3067\u308b\u304c\u3001\u3053\u3044\u3064\u304c\u3048\u3089\u3044\u5bb9\u91cf\u3042\u3063\u3066\u3082\u3046\u65e2\u306b\u3052\u3093\u306a\u308a\u3059\u308b\u3002<br \/>\n\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u4e0a\u304c\u3063\u305f\u3089\u305d\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u3066\u3001\u8a66\u3057\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u4e00\u89a7\u3092\u51fa\u3057\u3066\u307f\u3088\u3046\u3002<\/p>\n<pre><code>> cd your-project-name\n> mbed compile --supported<\/code><\/pre>\n<p>\u3053\u306e\u6642\u554f\u984c\u306a\u304f\u30bf\u30fc\u30b2\u30c3\u30c8\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u3069\u304b\u3063\u3068\u51fa\u3066\u304d\u305f\u3089OK\u3002<br \/>\n\u3082\u3057\u3053\u3053\u3067\u3001\u4f55\u304b\u3057\u3089\u306ePython\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u8db3\u308a\u306d\u3047\u3068\u6012\u3089\u308c\u305f\u3089\u3001\u968f\u6642pip install\u3059\u308c\u3070\u826f\u3044\u3002<br \/>\n\u4f8b\u3048\u3070\u4eca\u56de\u306fpyelftools\u304c\u7121\u3044\u3068\u6012\u3089\u308c\u305f\u306e\u3067\u305d\u306e\u307e\u3093\u307e\u53e9\u304f\u3002<br \/>\n<a href=\"https:\/\/os.mbed.com\/docs\/mbed-os\/v6.9\/build-tools\/troubleshoot.html\">https:\/\/os.mbed.com\/docs\/mbed-os\/v6.9\/build-tools\/troubleshoot.html<\/a><\/p>\n<pre><code>> pip install pyelftools<\/code><\/pre>\n<h3>\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4fee\u6b63\u3059\u308b<\/h3>\n<p>\u3069\u3046\u3044\u3046\u308f\u3051\u3060\u304b\u843d\u3061\u3066\u304f\u308bMbed OS 2\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u4e0d\u5b8c\u5168\u3067\u3001\u4e00\u90e8\u306e\u30d5\u30a1\u30a4\u30eb\u30fb\u30d5\u30a9\u30eb\u30c0\u304c\u629c\u3051\u3066\u3044\u308b\u3002<br \/>\n\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u306f\u8f09\u3063\u3066\u308b\u3093\u3060\u304c\u3001\u5b9f\u969b\u306b\u843d\u3068\u3057\u3066\u304f\u308bZIP\u306e\u4e2d\u306b\u306f\u5165\u3063\u3066\u3044\u306a\u3044\u3002\u5618\u3060\u308d\u304a\u524d\uff01\uff1f<br \/>\n<a href=\"https:\/\/os.mbed.com\/users\/mbed_official\/code\/mbed\/\">https:\/\/os.mbed.com\/users\/mbed_official\/code\/mbed\/<\/a><\/p>\n<p>\u3067\u3001\u4f55\u6545\u304b\u629c\u3051\u3066\u3044\u308b\u30d5\u30a9\u30eb\u30c0\u3092\u76f4\u63a5\u6307\u5b9a\u3059\u308b\u3068\u30d5\u30a1\u30a4\u30eb\u304c\u843d\u3068\u305b\u308b\u306e\u3067\u3001\u624b\u52d5\u3067\u305d\u3044\u3064\u3089\u3092\u843d\u3068\u3057\u3066\u8db3\u3057\u3066\u3084\u308b\u3002<br \/>\ndrivers\u3001hal\u3001platform\u306e3\u3064\u306e\u30d5\u30a9\u30eb\u30c0\u3068\u3001\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u3042\u308bmbed.h\u3001targets.json\u306e5\u3064\u3060\u3002<br \/>\n<a href=\"https:\/\/os.mbed.com\/users\/mbed_official\/code\/mbed\/\/raw-file\/65be27845400\/targets.json\">https:\/\/os.mbed.com\/users\/mbed_official\/code\/mbed\/\/raw-file\/65be27845400\/targets.json<\/a><br \/>\n<a href=\"https:\/\/os.mbed.com\/users\/mbed_official\/code\/mbed\/\/raw-file\/65be27845400\/mbed.h\">https:\/\/os.mbed.com\/users\/mbed_official\/code\/mbed\/\/raw-file\/65be27845400\/mbed.h<\/a><br \/>\n<a href=\"https:\/\/os.mbed.com\/users\/mbed_official\/code\/mbed\/\/archive\/65be27845400.zip\/drivers\/\">https:\/\/os.mbed.com\/users\/mbed_official\/code\/mbed\/\/archive\/65be27845400.zip\/drivers\/<\/a><br \/>\n<a href=\"https:\/\/os.mbed.com\/users\/mbed_official\/code\/mbed\/\/archive\/65be27845400.zip\/hal\/\">https:\/\/os.mbed.com\/users\/mbed_official\/code\/mbed\/\/archive\/65be27845400.zip\/hal\/<\/a><br \/>\n<a href=\"https:\/\/os.mbed.com\/users\/mbed_official\/code\/mbed\/\/archive\/65be27845400.zip\/platform\/\">https:\/\/os.mbed.com\/users\/mbed_official\/code\/mbed\/\/archive\/65be27845400.zip\/platform\/<\/a><\/p>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304b\u3089\u898b\u3066\u3001<code>.\/mbed\/65be27845400\/<\/code>\u306e\u4f4d\u7f6e\u306b\u4e0a\u8a185\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u3002<br \/>\n\u3053\u308c\u3067\u3088\u3046\u3084\u304f\u4e0b\u6e96\u5099\u304c\u7d42\u308f\u308b\u3002<\/p>\n<h2>\u305f\u306e\u3057\u3044\u30d3\u30eb\u30c9<\/h2>\n<p>main.cpp\u3092\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u7f6e\u304f\u3002<br \/>\n\u4eca\u56de\u306fLPC11u35\u306e\u4f8b\u306a\u306e\u3067\u300111u35\u5411\u3051\u306b\u30d3\u30eb\u30c9\u3057\u3066\u307f\u305f\u3002<br \/>\n\u3061\u306a\u307f\u306b11u35\u306f_401\u3068_501\u306e\u4e8c\u7a2e\u985e\u304c\u3042\u308b\u304c\u3001\u4f55\u304c\u9055\u3046\u306e\u304b\u3055\u3063\u3071\u308a\u308f\u304b\u3089\u3093\u3002<\/p>\n<pre><code>> mbed compile -m LPC11U35_501 -t GCC_ARM\n(\u4e2d\u7565)\nImage: .\\BUILD\\LPC11U35_501\\GCC_ARM\\mbed_blinky.bin<\/code><\/pre>\n<p>\u3088\u3046\u3084\u304fbin\u304c\u51fa\u6765\u305f\u3002\u3042\u3068\u306f\u3053\u306ebin\u30d5\u30a1\u30a4\u30eb\u3092\u66f8\u304d\u8fbc\u3081\u3070\u826f\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mbed \u30ed\u30fc\u30ab\u30eb\u30b3\u30f3\u30d1\u30a4\u30eb\u30d0\u30c8\u30eb \u6982\u8981 Mbed\u306e\u30ed\u30fc\u30ab\u30eb\u30b3\u30f3\u30d1\u30a4\u30eb\u306b\u95a2\u3057\u3066\u306f &hellip; <a href=\"https:\/\/drroot.page\/wp\/?p=234\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-234","post","type-post","status-publish","format-standard","hentry","category-2"],"_links":{"self":[{"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/posts\/234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=234"}],"version-history":[{"count":0,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/posts\/234\/revisions"}],"wp:attachment":[{"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}