{"id":47,"date":"2019-09-05T18:17:06","date_gmt":"2019-09-05T09:17:06","guid":{"rendered":"http:\/\/drroot.page\/wp\/?p=47"},"modified":"2019-10-23T07:49:02","modified_gmt":"2019-10-22T22:49:02","slug":"platformio%e3%81%a7lpc11u35%e3%81%abusbdevice%e3%82%92%e4%b9%97%e3%81%9b%e3%82%8b","status":"publish","type":"post","link":"https:\/\/drroot.page\/wp\/?p=47","title":{"rendered":"PlatformIO\u3067LPC11u35\u306bUSBDevice\u3092\u4e57\u305b\u308b"},"content":{"rendered":"<h1>\u3082\u304f\u3072\u3087\u3046<\/h1>\n<p>PlatformIO\u3067USBSerial\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8f09\u305b\u305f\u30b3\u30fc\u30c9\u3092\u66f8\u304dLPC11u35\u5411\u3051\u306b\u30d3\u30eb\u30c9\u3059\u308b\u3002<br \/>\n\u3053\u3053\u3067\u4f7f\u3046LPC11u35\u306f\u4e00\u500b\u524d\u306e\u8a18\u4e8b\u3067\u3082\u53d6\u308a\u4e0a\u3052\u305f\u79cb\u6708\u306e\u88f8\u30de\u30a4\u30b3\u30f3\u3060\u3002<\/p>\n<p><!--more--><\/p>\n<h1>\u307e\u305a\u306fL\u30c1\u30ab<\/h1>\n<p>PIO\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u308b\u969b\u306f\u300cCQ Publishing TG-LPC11U35-501\u300d\u30dc\u30fc\u30c9\u3092\u9078\u3079\u3070OK\u3002<\/p>\n<p><a href=\"https:\/\/drroot.page\/wp\/?p=42\">1114\u5411\u3051\u30d3\u30eb\u30c9<\/a>\u540c\u69d8\u3001Mbed\u30e9\u30a4\u30d6\u30e9\u30ea\u30923.5\u306b\u843d\u3068\u3059\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u307e\u305a\u305d\u308c\u3092\u3084\u308b\u3002<br \/>\nPlatformIO\u306e\u30db\u30fc\u30e0\u753b\u9762\u304b\u3089Platform\u3092\u9078\u3093\u3067\u3001NXP LPC\u306e\u30d0\u30fc\u30b8\u30e7\u30f33.5\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306eplatformio.ini\u306b<code><code>platform = nxplpc@3.5.0<\/code><\/code>\u3092\u8a18\u8ff0\u3059\u308b\u3002<\/p>\n<p>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u3053\u3093\u306a\u611f\u3058\u3002<\/p>\n<pre><code class=\"language-c++\">#include <mbed.h>\n\nDigitalOut p(LED1);\n\nint main() {\n\n  \/\/ put your setup code here, to run once:\n  while(1) {\n    p=!p;\n    wait(0.5);\n  }\n}<\/code><\/pre>\n<p>\u30d3\u30eb\u30c9\u3067\u304d\u305f\u3089\u6210\u529f\u3060\u3002<br \/>\nLPC1114\u306f\u3053\u3053\u307e\u3067\u304d\u305f\u3089\u5f8c\u306f\u30d0\u30a4\u30ca\u30ea\u3092\u66f8\u304d\u8fbc\u3080\u3060\u3051\u306a\u3093\u3060\u304c\u3001USB\u3067\u66f8\u304d\u8fbc\u308011u35\u306f\u3082\u3046\u3072\u3068\u624b\u9593\u5fc5\u8981\u306b\u306a\u308b\u3002<br \/>\n\u3068\u3044\u3046\u306e\u3082\u3001USB\u7d4c\u7531\u3067\u30d0\u30a4\u30ca\u30ea\u3092\u66f8\u304f\u5834\u5408\u306f\u30d0\u30a4\u30ca\u30ea\u306e\u30b1\u30c4\u306b\u30c1\u30a7\u30c3\u30af\u30b5\u30e0\u3092\u3064\u3051\u306a\u304d\u3083\u306a\u3089\u305a\u3001ISP\u5411\u3051\u30d0\u30a4\u30ca\u30ea\u3092\u5410\u304fPIO\u3067\u306f\u3053\u306e\u51e6\u7406\u3092\u3057\u3066\u304f\u308c\u306a\u3044\u304b\u3089\u3060\u3002<br \/>\n<a href=\"https:\/\/github.com\/platformio\/platform-nxplpc\/issues\/6\">https:\/\/github.com\/platformio\/platform-nxplpc\/issues\/6<\/a><\/p>\n<p>\u3068\u3044\u3046\u308f\u3051\u3067<a href=\"https:\/\/github.com\/basilfx\/lpc_checksum\">lpc_checksum<\/a>\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3063\u3066\u81ea\u524d\u3067\u30c1\u30a7\u30c3\u30af\u30b5\u30e0\u3092\u3064\u3051\u3066\u3084\u308b\u3002<br \/>\n\u4ee5\u4e0b\u306fPython\u304c\u5165\u3063\u3066\u3044\u308b\u524d\u63d0\u306a\u306e\u3067\u3001\u7121\u3044\u306a\u3089\u5165\u308c\u3088\u3046\uff08PlatformIO\u306f\u305d\u306e\u8fba\u30ab\u30b9\u3067\u3001\u5185\u90e8\u3067Python\u4f7f\u3063\u3066\u308b\u304f\u305b\u306b\u74b0\u5883\u5909\u6570\u3068\u304b\u901a\u3057\u3066\u304f\u308c\u306a\u3044\u306e\u3067\u81ea\u524d\u3067\u5165\u308c\u308b\u306a\u308a\u3057\u3088\u3046\uff09\u3002<\/p>\n<p>\u307e\u305a\u7ba1\u7406\u8005\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3067<\/p>\n<pre><code>pip install lpc_checksum<\/code><\/pre>\n<p>\u3068\u3057\u3066\u3084\u308b\u3002\u4e0a\u624b\u304f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u305f\u3089\u3001\u30d3\u30eb\u30c9\u3057\u305f\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u306e\u3042\u308b\u5834\u6240\u306b\u79fb\u52d5\u3057\u3001<\/p>\n<pre><code>lpc_checksum firmware.bin<\/code><\/pre>\n<p>\u3068\u53e9\u304f\u3002<em>&#8220;Succesfully updated checksum to 0x&#8230;&#8221;<\/em>\u3068\u51fa\u305f\u3089\u6210\u529f\u3060\u3002<br \/>\n\u3053\u308c\u3067\u30d0\u30a4\u30ca\u30ea\u306b\u30c1\u30a7\u30c3\u30af\u30b5\u30e0\u304c\u4ed8\u4e0e\u3055\u308c\u305f\u306e\u3067\u3001USB\u7d4c\u7531\u306711u35\u306b\u66f8\u304d\u8fbc\u3082\u3046\u3002<\/p>\n<p>\u5c1a\u3001\u30d4\u30f3\u306e\u540d\u524d\u306fPIO0_0\u306a\u3089P0_0\u3068\u66f8\u3051\u3070\u826f\u3044\u3002<\/p>\n<h1>Serial\u901a\u4fe1\u3057\u3088\u3046<\/h1>\n<p>PlatformIO\u306flib_deps\u3068\u3044\u3046\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u3042\u308a\u3001\u308f\u3056\u308f\u3056\u81ea\u5206\u3067\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u843d\u3068\u3055\u306a\u304f\u3066\u3082\u30d3\u30eb\u30c9\u6642\u306b\u52dd\u624b\u306b\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u843d\u3068\u3057\u3066\u304f\u308c\u308b\u6a5f\u80fd\u304c\u3042\u308b\u3002<br \/>\n\u4eca\u56de\u306f<a href=\"https:\/\/platformio.org\/lib\/show\/2820\/USBDevice\">USBDevice<\/a>\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3046\u306e\u3067\u3001platformio.ini\u306b\u4e0b\u8a18\u3092\u8ffd\u52a0\u3060\u3002<\/p>\n<pre><code>lib_deps = USBDevice<\/code><\/pre>\n<p>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u3068\u308a\u3042\u3048\u305a\u30b7\u30ea\u30a2\u30eb\u306b\u9069\u5f53\u306a\u6587\u5b57\u3092\u5410\u304d\u7d9a\u3051\u308b\u30b5\u30f3\u30d7\u30eb\u306b\u3057\u305f\u3002<\/p>\n<pre><code class=\"language-cpp\">#include <mbed.h>\n#include <USBSerial.h>\n\nUSBSerial pc;\n\nint main() {\n\n  \/\/ put your setup code here, to run once:\n  while(1) {\n    pc.printf(\"fuck\\r\\n\");\n    wait(0.5);\n  }\n}<\/code><\/pre>\n<p>\u3055\u3066\u3001\u3053\u308c\u3067\u30d3\u30eb\u30c9\u3092\u304b\u3051\u308b\u3068\u3001\u3044\u3089\u3093\u30d5\u30a1\u30a4\u30eb(\u4ed6\u306e\u30bf\u30fc\u30b2\u30c3\u30c8\u306e\u30dc\u30fc\u30c9\u5411\u3051\u30b3\u30fc\u30c9)\u307e\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u305f\u6319\u3052\u53e5No such file\u3057\u3084\u304c\u3063\u3066\u5931\u6557\u3059\u308b\u3002<br \/>\n\u30d3\u30eb\u30c9\u30d1\u30b9\u304b\u3089\u4e0a\u624b\u3044\u3053\u3068\u9664\u3044\u3066\u3084\u308a\u305f\u3044\u3093\u3060\u304c\u3001<strong>\u3084\u308a\u65b9\u304c\u308f\u304b\u3089\u306a\u3044\u306e\u3067\u3044\u3089\u3093\u30d5\u30a9\u30eb\u30c0\u3092\u6d88\u3059<\/strong>\u3002<br \/>\n\u77e5\u80fd\u6307\u6570\u304c\u4e00\u6841\u3057\u304b\u7121\u3044\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u3060\u304c\u52d5\u304d\u3083\u30a1\u826f\u3044\u3093\u3060\u3088\u52d5\u304d\u3083\u3088\u3002<br \/>\n\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30d5\u30a9\u30eb\u30c0>.pio>libdeps>lpc11u35>USBDevice_ID2820>targets\u3068\u6398\u308a\u9032\u3093\u3067\u3001TARGET_NXP\u4ee5\u5916\u306e\u30d5\u30a9\u30eb\u30c0\u3092\u5168\u90e8\u524a\u9664\u3057\u3066\u3057\u307e\u304a\u3046\u3002\u3053\u308c\u3067\u30d3\u30eb\u30c9\u304c\u901a\u308b\u3002\u30de\u30b8\u304b\u3088\u3002<br \/>\n\u3061\u306a\u307f\u306b\u4e00\u5ea6\u30d3\u30eb\u30c9\u3092\u304b\u3051\u3066\u304a\u304b\u306a\u3044\u3068\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u843d\u3061\u3066\u3053\u306a\u3044\u304b\u3089\u6ce8\u610f\u3002<\/p>\n<p>\u5f8c\u306f\u3055\u3063\u304d\u306e\u624b\u9806\u3067\u30cf\u30c3\u30b7\u30e5\u3092\u3064\u3051\u3066\u66f8\u304d\u8fbc\u307f\u3057\u3066\u3084\u308c\u3070OK\u3060\u3002<br \/>\n\u30c9\u30e9\u30a4\u30d0\u306f\u308f\u3056\u308f\u3056\u7f72\u540d\u306e\u306a\u3044\u3082\u306e\u3092\u5165\u308c\u306a\u304f\u3066\u3082\u3001Mbed\u8b39\u88fd\u306e\u30b7\u30ea\u30a2\u30eb\u30c9\u30e9\u30a4\u30d0\u3092\u5165\u308c\u308c\u3070\u826f\u3044\u3002<br \/>\n<a href=\"https:\/\/os.mbed.com\/docs\/mbed-os\/v5.13\/tutorials\/windows-serial-driver.html\">https:\/\/os.mbed.com\/docs\/mbed-os\/v5.13\/tutorials\/windows-serial-driver.html<\/a><\/p>\n<p>\u3053\u308c\u3067Teraterm\u306a\u308a\u306b\u6587\u5b57\u304c\u51fa\u529b\u3055\u308c\u308c\u3070\u6674\u308c\u3066500\u5186USBDevice\u306e\u51fa\u6765\u4e0a\u304c\u308a\u3060\u3002<br \/>\n\u3053\u3053\u307e\u3067\u9762\u5012\u306a\u3089PlatformIO\u4f7f\u3046\u30e1\u30ea\u30c3\u30c8\u306f\u306d\u3047\u306a\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3082\u304f\u3072\u3087\u3046 PlatformIO\u3067USBSerial\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8f09\u305b\u305f\u30b3\u30fc\u30c9\u3092\u66f8 &hellip; <a href=\"https:\/\/drroot.page\/wp\/?p=47\">\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-47","post","type-post","status-publish","format-standard","hentry","category-2"],"_links":{"self":[{"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/posts\/47","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=47"}],"version-history":[{"count":2,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/posts\/47\/revisions"}],"predecessor-version":[{"id":134,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/posts\/47\/revisions\/134"}],"wp:attachment":[{"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}