{"id":3749,"date":"2023-06-04T11:58:15","date_gmt":"2023-06-04T02:58:15","guid":{"rendered":"https:\/\/oohito.com\/nqthm\/?p=3749"},"modified":"2023-07-03T08:58:33","modified_gmt":"2023-07-02T23:58:33","slug":"try-kernel-%e3%82%92-eclipse-%e6%8a%9c%e3%81%8d%e3%81%a7%e3%83%93%e3%83%ab%e3%83%89%e3%81%99%e3%82%8b1","status":"publish","type":"post","link":"https:\/\/oohito.com\/nqthm\/archives\/3749","title":{"rendered":"Try Kernel \u3092 eclipse \u629c\u304d\u3067\u30d3\u30eb\u30c9\u3059\u308b(1)"},"content":{"rendered":"\n<p>CQ\u51fa\u7248\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u8a8c\uff17\u6708\u53f7\u3067\u300c\u30e9\u30ba\u30d1\u30a4Pico\u30671500\u884c \u30bc\u30ed\u304b\u3089\u4f5c\u308bOS\u300d\u3068\u3044\u3046\u7279\u96c6\u8a18\u4e8b\u304c\u3042\u308a\u3001\u9762\u767d\u305d\u3046\u306a\u306e\u3067\u8cfc\u5165\u3057\u3066\u307f\u305f\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/interface.cqpub.co.jp\/magazine\/202307\/\">https:\/\/interface.cqpub.co.jp\/magazine\/202307\/<\/a><\/p>\n\n\n\n<p>Raspberry Pi pico \u306bRTOS\u3092\u81ea\u524d\u3067\u5b9f\u88c5\u3057\u3088\u3046\u3068\u3044\u3046\u8a66\u307f\u3067\u3001\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u306e\u6d41\u308c\u3082\u3066\u3044\u306d\u3044\u306b\u66f8\u304b\u308c\u3066\u304a\u308a\u3001RTOS\u306e\u52c9\u5f37\u306b\u3082\u306a\u308b\u3057\u3001\u7406\u89e3\u304c\u3042\u3084\u3075\u3084\u3060\u3063\u305f\u30de\u30a4\u30b3\u30f3\u306e\u8d77\u52d5\u306e\u4ed5\u7d44\u307f\u3082\u308f\u304b\u308b\u304b\u3068\u601d\u3044\u3001\u66f8\u7c4d\u306b\u5f93\u3063\u3066\u5b9f\u9a13\u3057\u3088\u3046\u3068\u601d\u3063\u305f\u3002<\/p>\n\n\n\n<p>\u305f\u3060\u3001\u8aad\u307f\u9032\u3081\u3066\u3044\u304f\u3068\u958b\u767a\u74b0\u5883\u3068\u3057\u3066 Windows \u4e0a\u306e eclipse \u3092\u4f7f\u3046\u3053\u3068\u304c\u66f8\u304b\u308c\u3066\u3044\u308b\u3002\u533b\u8005\u306b eclipse \u306e\u4f7f\u7528\u3092\u56fa\u304f\u7981\u3058\u3089\u308c\u3066\u3044\u308b\u8eab\u3068\u3057\u3066\u306f\u540c\u3058\u3088\u3046\u306b\u8a66\u305b\u306a\u3044\u3002\u305d\u3053\u3067\u3001eclipse \u3092\u4f7f\u308f\u305a\u3001ubuntu 22.04 \u4e0a\u3067\u30d3\u30eb\u30c9\u3059\u308b\u65b9\u6cd5\u3092\u8003\u3048\u3066\u307f\u305f\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Try Kernel \u30bd\u30fc\u30b9\u306e\u6e96\u5099<\/h2>\n\n\n\n<p>Try Kernel \u306e\u30b3\u30fc\u30c9\u306f github \u304b\u3089\u6700\u65b0\u7248\u3092\u5165\u624b\u3067\u304d\u308b\u306e\u3067\u3001\u30af\u30ed\u30fc\u30f3\u3057\u3066\u304a\u304f\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/ytoyoyama\/interface_trykernel\">https:\/\/github.com\/ytoyoyama\/interface_trykernel<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/ytoyoyama\/interface_trykernel.git<\/code><\/pre>\n\n\n\n<p>\u7ae0\u3054\u3068\u306b\u30d5\u30a9\u30eb\u30c0\u304c\u5225\u308c\u3066\u304a\u308a\u3001\u9806\u306b\u5b9f\u88c5\u3057\u306a\u304c\u3089\u5b66\u3079\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002\u307e\u305a\u306f\u3001\u6700\u521d\u306e\u4e00\u6b69\u3068\u3057\u3066\u7b2c\uff12\u90e8\u7b2c\uff13\u7ae0\u306eL\u30c1\u30ab\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u30d3\u30eb\u30c9\u3057\u3066\u307f\u308b\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u96fb\u6e90\u30aa\u30f3\u6642\u306e\u30ea\u30bb\u30c3\u30c8\u30cf\u30f3\u30c9\u30e9\u304b\u3089\u3001\u30de\u30a4\u30b3\u30f3\u306e\u521d\u671f\u5316\u3092\u884c\u3044\u3001L\u30c1\u30ab\u306e\u30e1\u30a4\u30f3\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u307e\u3067\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u30b3\u30f3\u30d1\u30af\u30c8\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>\u30b3\u30fc\u30c9\u306f interface_trykernel\/part_2\/sect_3 \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u4ee5\u4e0b\u306e\u69cb\u9020\u3067\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ tree .\n.\n\u251c\u2500\u2500 application\n\u2502&nbsp;&nbsp; \u2514\u2500\u2500 main.c\n\u251c\u2500\u2500 boot\n\u2502&nbsp;&nbsp; \u251c\u2500\u2500 boot2.c\n\u2502&nbsp;&nbsp; \u251c\u2500\u2500 reset_hdr.c\n\u2502&nbsp;&nbsp; \u2514\u2500\u2500 vector_tbl.c\n\u251c\u2500\u2500 include\n\u2502&nbsp;&nbsp; \u251c\u2500\u2500 knldef.h\n\u2502&nbsp;&nbsp; \u251c\u2500\u2500 sysdef.h\n\u2502&nbsp;&nbsp; \u251c\u2500\u2500 syslib.h\n\u2502&nbsp;&nbsp; \u2514\u2500\u2500 typedef.h\n\u2514\u2500\u2500 linker\n    \u2514\u2500\u2500 pico_memmap.ld\n\n4 directories, 9 files<\/code><\/pre>\n\n\n\n<p>\u30b7\u30f3\u30d7\u30eb\u306a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210\u3067\u3001application\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30a2\u30d7\u30ea\u672c\u4f53\u306e\u30bd\u30fc\u30b9\u304c\u3001boot\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u5fc5\u8981\u306a\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u3084\u30e9\u30a4\u30d6\u30e9\u30ea\u30bd\u30fc\u30b9\u304c\u3001include\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\u304c\u305d\u308c\u305e\u308c\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u3002linker \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u306f\u30ea\u30f3\u30af\u30de\u30c3\u30d7\u306e\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u958b\u767a\u74b0\u5883\u306e\u6e96\u5099<\/h2>\n\n\n\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u306e\u30d3\u30eb\u30c9\u306b\u306f\u3001ARM\u306e\u30af\u30ed\u30b9\u30b3\u30f3\u30d1\u30a4\u30e9\u304c\u5fc5\u8981\u3068\u306a\u308b\u304c\u3001Raspberry Pi pico \u306eSDK\u306e\u958b\u767a\u74b0\u5883\u304c\u4ee5\u4e0b\u306e github \u306b\u4e00\u5f0f\u6574\u3048\u3089\u308c\u3066\u304a\u308a\u3001\u5c0e\u5165\u65b9\u6cd5\u306e\u8aac\u660e\u3082\u66f8\u304b\u308c\u3066\u3044\u308b\u306e\u3067\u53c2\u8003\u306b\u3059\u308b\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/raspberrypi\/pico-sdk\">https:\/\/github.com\/raspberrypi\/pico-sdk<\/a><\/p>\n\n\n\n<p>\u3053\u306e github \u3067\u306f\u3001cmake \u3068 gcc cross compiler \u304c\u5fc5\u8981\u3068\u3042\u308a\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3088\u3046\u66f8\u304b\u308c\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib<\/code><\/pre>\n\n\n\n<p>\u81ea\u5206\u306e\u74b0\u5883\u3067\u306f\u5168\u3066\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u3060\u3063\u305f\u306e\u3067\u4f55\u3082\u3059\u308b\u5fc5\u8981\u306f\u306a\u304b\u3063\u305f\u304c\u3001Try Kernel \u306e\u30d3\u30eb\u30c9\u306b\u306f gcc-arm-none-eabi \u3060\u3051\u3042\u308c\u3070\u4f55\u3068\u304b\u306a\u308b\u3093\u3058\u3083\u306a\u3044\u304b\u3068\u601d\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u3068\u308a\u3042\u3048\u305a\u30b3\u30f3\u30d1\u30a4\u30eb\uff06\u30ea\u30f3\u30af<\/h2>\n\n\n\n<p>\u307e\u305a\u306f\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u3069\u3093\u306a\u611f\u3058\u306b\u306a\u308b\u304b\u78ba\u8a8d\u3059\u308b\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ cd interface_trykernel\/part_2\/sect_3\n$ \/usr\/bin\/arm-none-eabi-gcc -I include -mthumb -mcpu=cortex-m0plus -c application\/*.c boot\/*.c<\/code><\/pre>\n\n\n\n<p>\u30b3\u30f3\u30d1\u30a4\u30eb\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u30b0\u30b0\u3063\u3066\u9069\u5f53\u306b\u8a2d\u5b9a\u3057\u3066\u307f\u305f\u3082\u306e\u3060\u304c\u3001\u7279\u306b\u4f55\u306e\u30a8\u30e9\u30fc\u3082\u51fa\u306a\u304b\u3063\u305f\u3002\u5e78\u5148\u3088\u3057\u3002<\/p>\n\n\n\n<p>\u6b21\u306b\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u30ea\u30f3\u30af\u3057\u3066\u307f\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ \/usr\/bin\/arm-none-eabi-gcc -nostartfiles -Wl,--script=linker\/pico_memmap.ld -Wl,-z,max-page-size=4096 -Wl,--gc-sections *.o -o out.elf\n\/usr\/lib\/gcc\/arm-none-eabi\/10.3.1\/..\/..\/..\/arm-none-eabi\/bin\/ld: main.o: in function `delay_ms':\nmain.c:(.text+0x3a): undefined reference to `__aeabi_uidiv'\n\/usr\/lib\/gcc\/arm-none-eabi\/10.3.1\/..\/..\/..\/arm-none-eabi\/bin\/ld: reset_hdr.o: in function `init_pll':\nreset_hdr.c:(.text+0xaa): undefined reference to `__aeabi_uidiv'\n\/usr\/lib\/gcc\/arm-none-eabi\/10.3.1\/..\/..\/..\/arm-none-eabi\/bin\/ld: reset_hdr.c:(.text+0xc8): undefined reference to `__aeabi_uidiv'\n\/usr\/lib\/gcc\/arm-none-eabi\/10.3.1\/..\/..\/..\/arm-none-eabi\/bin\/ld: reset_hdr.o: in function `clock_config':\nreset_hdr.c:(.text+0x1b4): undefined reference to `__aeabi_uldivmod'\ncollect2: error: ld returned 1 exit status<\/code><\/pre>\n\n\n\n<p>\u3053\u3061\u3089\u306e\u30ea\u30f3\u30ab\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3042\u308c\u3053\u308c\u691c\u7d22\u3057\u3066\u3084\u3063\u3068\u305f\u3069\u308a\u7740\u3044\u305f\u3082\u306e\u3002\u7279\u306b &#8211;script \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30ea\u30f3\u30af\u30de\u30c3\u30d7\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5\u304c\u308f\u304b\u3089\u306a\u304f\u3066\u82e6\u52b4\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3068\u306f\u3044\u3048\u3001__aeabi_uidiv \u3068 __aeabi_uldivmod \u304c\u5b9f\u88c5\u3055\u308c\u3066\u3044\u306a\u3044\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u306e\u304c\u308f\u304b\u308b\u3002\u6a19\u6e96\u7684\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30ea\u30f3\u30af\u3057\u3066\u304a\u3089\u305a\u3001\u975e\u8ca0\u6574\u6570\u306e\u5272\u308a\u7b97\u3092\u884c\u3046\u95a2\u6570\u304c\u306a\u3044\u305f\u3081\u306b\u767a\u751f\u3057\u305f\u30a8\u30e9\u30fc\u306a\u306e\u3067\u3001\u4f55\u3089\u304b\u306e\u5f62\u3067\u7528\u610f\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002<\/p>\n\n\n\n<p>\u8a18\u4e8b\u304c\u9577\u304f\u306a\u3063\u305f\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u3053\u3053\u307e\u3067\u3002\u6b21\u56de\u306f\u3061\u3083\u3093\u3068\u30b3\u30fc\u30c9\u3092\u7528\u610f\u3057\u3066\u30d3\u30eb\u30c9\u3092\u884c\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CQ\u51fa\u7248\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u8a8c\uff17\u6708\u53f7\u3067\u300c\u30e9\u30ba\u30d1\u30a4Pico\u30671500\u884c \u30bc\u30ed\u304b\u3089\u4f5c\u308bOS\u300d\u3068\u3044\u3046\u7279\u96c6\u8a18\u4e8b\u304c\u3042\u308a\u3001\u9762\u767d\u305d\u3046\u306a\u306e\u3067\u8cfc\u5165\u3057\u3066\u307f\u305f\u3002 https:\/\/interface.cqpub.co.jp\/magazine\/20&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58,17],"tags":[77,73,72],"class_list":["post-3749","post","type-post","status-publish","format-standard","hentry","category-raspberry-pi-pico","category-ubuntu","tag-eclipse","tag-pico","tag-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/3749","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/comments?post=3749"}],"version-history":[{"count":9,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/3749\/revisions"}],"predecessor-version":[{"id":3769,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/3749\/revisions\/3769"}],"wp:attachment":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/media?parent=3749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/categories?post=3749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/tags?post=3749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}