{"id":3768,"date":"2023-06-06T17:20:11","date_gmt":"2023-06-06T08:20:11","guid":{"rendered":"https:\/\/oohito.com\/nqthm\/?p=3768"},"modified":"2023-07-03T08:58:09","modified_gmt":"2023-07-02T23:58:09","slug":"raspberry-pi-pico-%e3%81%ae%e3%83%96%e3%83%bc%e3%83%88%e3%82%b9%e3%83%88%e3%83%a9%e3%83%83%e3%83%97","status":"publish","type":"post","link":"https:\/\/oohito.com\/nqthm\/archives\/3768","title":{"rendered":"Raspberry Pi pico \u306e\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7"},"content":{"rendered":"\n<p>CQ\u51fa\u7248\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u8a8c\uff17\u6708\u53f7\u7279\u96c6\u300c\u30e9\u30ba\u30d1\u30a4Pico\u30671500\u884c \u30bc\u30ed\u304b\u3089\u4f5c\u308bOS\u300d\u304b\u3089\u3001\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u306e\u6d41\u308c\u3092\u6574\u7406\u3057\u3066\u307f\u305f\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">\u96fb\u6e90\u30aa\u30f3\u304b\u3089\u306e\u8d77\u52d5<\/h2>\n\n\n\n<p>Raspberry Pi pico \u306e\u96fb\u6e90\u304c\u5165\u308b\u3068\u3001\u4ee5\u4e0b\u304c\u8d77\u3053\u308b\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30a2\u30c9\u30ec\u30b9 0x0000 0000 \u306e32\u30d3\u30c3\u30c8\u30c7\u30fc\u30bf\u304c\u30b9\u30bf\u30c3\u30af\u30dd\u30a4\u30f3\u30bf\u306b\u30bb\u30c3\u30c8\u3055\u308c\u308b\u3002<\/li>\n\n\n\n<li>\u30a2\u30c9\u30ec\u30b9 0x0000 0004 \u306e32\u30d3\u30c3\u30c8\u30c7\u30fc\u30bf\u304c\u30d7\u30ed\u30b0\u30e9\u30e0\u30ab\u30a6\u30f3\u30bf\u306b\u30bb\u30c3\u30c8\u3055\u308c\u308b\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u5f53\u7136\u3001\u3053\u306e\u9818\u57df\u306fROM\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001ROM\u5185\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u5b9f\u884c\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308b\u3002\u3061\u306a\u307f\u306b\u3001\u30a2\u30c9\u30ec\u30b9\u7a7a\u9593\u4e0a\u3067ROM\u306e\u9818\u57df\u306f\u30010x0000 0000 \u304b\u3089 0x0000 3FFF \u306e16KiB \u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p>\u3055\u3066\u3001\u6700\u521d\u306b\u5b9f\u884c\u3055\u308c\u308b\u30d6\u30fc\u30c8\u30ed\u30fc\u30c0\uff08\u30d5\u30a1\u30fc\u30b9\u30c8\u30b9\u30c6\u30fc\u30b8\uff09\u306fROM\u306b\u683c\u7d0d\u3055\u308c\u3066\u304a\u308a\u3001\u305d\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/raspberrypi\/pico-bootrom\/blob\/master\/bootrom\/bootrom_rt0.S\">https:\/\/github.com\/raspberrypi\/pico-bootrom\/blob\/master\/bootrom\/bootrom_rt0.S<\/a><\/p>\n\n\n\n<p>_start \u3067\u59cb\u307e\u308b\u90e8\u5206\u304c\u305d\u308c\u3067\u3001\u30b3\u30e1\u30f3\u30c8\u306b\u300cEntry point for both cores\u300d\u3068\u3042\u308b\u3088\u3046\u306b\u3001Cortex-M0+ \u306e\uff12\u3064\u306e\u30b3\u30a2\u3068\u3082\u540c\u6642\u306b\u30b9\u30bf\u30fc\u30c8\u3055\u308c\u308b\u3002\u305d\u306e\u5f8c\u306e\u6d41\u308c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CPU\u30b3\u30a2\u306eID\u304c\uff10\u4ee5\u5916\u306e\u5834\u5408\u306f\u30b9\u30ea\u30fc\u30d7\u3059\u308b\uff08\u307f\u305f\u3044\u3060\u3051\u3069\u8ffd\u3063\u304b\u3051\u304d\u308c\u3066\u306a\u3044\uff09<\/li>\n\n\n\n<li>NMI \u3092\u8a2d\u5b9a\u3059\u308b<\/li>\n\n\n\n<li>\u30d5\u30e9\u30c3\u30b7\u30e5\u30e1\u30e2\u30ea\u306e\u5148\u982d\u304b\u3089\u306e256\u30d0\u30a4\u30c8\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3001SRAM\u306e\u672b\u5c3e256\u30d0\u30a4\u30c8\u306b\u30b3\u30d4\u30fc\u3059\u308b<\/li>\n\n\n\n<li>\u30c1\u30a7\u30c3\u30af\u30b5\u30e0\u3092\u8a08\u7b97\u3057\u3066\u4e00\u81f4\u3059\u308c\u3070\u3001\u8aad\u307f\u8fbc\u3093\u3060\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u30b8\u30e3\u30f3\u30d7\u3059\u308b<\/li>\n<\/ul>\n\n\n\n<p>ARM\u306e\u547d\u4ee4\u306b\u99b4\u67d3\u307f\u304c\u306a\u3044\u306e\u3067\u30a2\u30e4\u30d5\u30e4\u3060\u304c\u3001\u3060\u3044\u305f\u3044\u5408\u3063\u3066\u3044\u308b\u3068\u601d\u3046\u3002<\/p>\n\n\n\n<p>pico-sdk \u306e <a href=\"https:\/\/github.com\/raspberrypi\/pico-sdk\/blob\/master\/src\/rp2040\/hardware_regs\/include\/hardware\/regs\/addressmap.h\">src\/rp2040\/hardware_regs\/include\/hardware\/regs\/addressmap.h<\/a> \u306b\u30e1\u30e2\u30ea\u30de\u30c3\u30d7\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3002\u305d\u308c\u306b\u3088\u308b\u3068\u3001SRAM \u306e\u9818\u57df\u306f 0x2000 0000 \u304b\u3089 0x2004 2000 \u306e264KiB\u3068\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u30010x2004 1F00 \u304b\u3089\u306e256\u30d0\u30a4\u30c8\u306b\u30bb\u30ab\u30f3\u30c9\u30b9\u30c6\u30fc\u30b8\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u683c\u7d0d\u3055\u308c\u3001\u5b9f\u884c\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u306e\u30bb\u30ab\u30f3\u30c9\u30b9\u30c6\u30fc\u30b8<\/h2>\n\n\n\n<p>\u30d5\u30e9\u30c3\u30b7\u30e5\u30e1\u30e2\u30ea\u306e\u5148\u982d256\u30d0\u30a4\u30c8\u304c\u30bb\u30ab\u30f3\u30c9\u30b9\u30c6\u30fc\u30b8\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u306a\u308b\u305f\u3081\u3001256\u30d0\u30a4\u30c8\u4ee5\u5185\u3067\u3042\u308c\u3070\u4f55\u3092\u8a18\u8ff0\u3057\u3066\u3082\u3088\u3044\u3002\u305f\u3060\u3057\u3001\u6700\u5f8c\u306e4\u30d0\u30a4\u30c8\u306f\u30c1\u30a7\u30c3\u30af\u30b5\u30e0\u306b\u4f7f\u3046\u306e\u3067\u3001\u5b9f\u8cea252\u30d0\u30a4\u30c8\u3068\u306a\u308b\u3002<\/p>\n\n\n\n<p>Try Kernel \u3067\u306f pico-sdk \u306e\u30bb\u30ab\u30f3\u30c9\u30b9\u30c6\u30fc\u30b8\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u305d\u306e\u307e\u307e\u4f7f\u7528\u3057\u3066\u304a\u308a\u3001\u305d\u306e\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306b\u3042\u308b\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/raspberrypi\/pico-sdk\/blob\/26653ea81e340cacee55025d110c3e014a252a87\/src\/rp2_common\/boot_stage2\/boot2_w25q080.S\">https:\/\/github.com\/raspberrypi\/pico-sdk\/blob\/26653ea81e340cacee55025d110c3e014a252a87\/src\/rp2_common\/boot_stage2\/boot2_w25q080.S<\/a><\/p>\n\n\n\n<p>boot_stage2\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u306f\u3001SPI Flash \u306e\u7a2e\u985e\u306b\u3042\u308f\u305b\u3066\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u304c\u5206\u304b\u308c\u3066\u3044\u308b\u304c\u3001\u56de\u8def\u56f3\u306b\u3088\u308b\u3068 Raspberry Pi pico \u306e\u30d5\u30e9\u30c3\u30b7\u30e5\u30e1\u30e2\u30ea\u306e\u30c1\u30c3\u30d7\u306f W25Q16JV \u306a\u306e\u3067\u3001\u305d\u306e\u30c1\u30c3\u30d7\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u4e0a\u8a18\u304c\u8a72\u5f53\u3059\u308b\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u30bb\u30ab\u30f3\u30c9\u30b9\u30c6\u30fc\u30b8\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\u3001\u307e\u305aSPI\u306e\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u304b\u3089\u3001\u30d5\u30e9\u30c3\u30b7\u30e5\u30e1\u30e2\u30ea\u3092\u30a2\u30c9\u30ec\u30b9\u7a7a\u9593\uff08XIP_BASE=0x1000 0000\uff09\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3059\u308b\u3002\u30d5\u30e9\u30c3\u30b7\u30e5\u30e1\u30e2\u30ea\u306e\u30a2\u30c9\u30ec\u30b9 0x0100 \u4ee5\u964d\uff08\u30a2\u30c9\u30ec\u30b9\u7a7a\u9593\u4e0a\u3067\u306f 0x1000 0100\u4ee5\u964d\uff09\u3092\u30d9\u30af\u30bf\u30c6\u30fc\u30d6\u30eb\u3068\u3057\u3066VTOR\u30ec\u30b8\u30b9\u30bf\u306b\u8a2d\u5b9a\u3057\u3001\u6700\u5f8c\u306b\u30d9\u30af\u30bf\u30c6\u30fc\u30d6\u30eb\u5148\u982d\u306e\u30b9\u30bf\u30c3\u30af\u30dd\u30a4\u30f3\u30bf\u3092SP\u30ec\u30b8\u30b9\u30bf\u306b\u8a2d\u5b9a\u3059\u308b\u3068\u3068\u3082\u306b\u3001\u30ea\u30bb\u30c3\u30c8\u30d9\u30af\u30bf\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u76f4\u5f8c\u306e\u30a2\u30c9\u30ec\u30b9\uff08\u3064\u307e\u308a\u30ea\u30bb\u30c3\u30c8\u30cf\u30f3\u30c9\u30e9\uff09\u3078\u30b8\u30e3\u30f3\u30d7\u3059\u308b\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/raspberrypi\/pico-sdk\/blob\/master\/src\/rp2_common\/boot_stage2\/asminclude\/boot2_helpers\/exit_from_boot2.S\">https:\/\/github.com\/raspberrypi\/pico-sdk\/blob\/master\/src\/rp2_common\/boot_stage2\/asminclude\/boot2_helpers\/exit_from_boot2.S<\/a><\/p>\n\n\n\n<p>\u4ee5\u4e0a\u304c\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u306e\u30bb\u30ab\u30f3\u30c9\u30b9\u30c6\u30fc\u30b8\u306e\u6d41\u308c\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30ea\u30bb\u30c3\u30c8\u30cf\u30f3\u30c9\u30e9\u306e\u5b9f\u884c<\/h2>\n\n\n\n<p>Try Kernel \uff08\u306e\u7b2c\uff12\u90e8\u7b2c\uff13\u7ae0\uff09\u306e\u30ea\u30bb\u30c3\u30c8\u30cf\u30f3\u30c9\u30e9\u3067\u306f\u4ee5\u4e0b\u3092\u884c\u3063\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PendSV \u4f8b\u5916\u3068SysTick \u4f8b\u5916\u306e\u512a\u5148\u5ea6\u8a2d\u5b9a<\/li>\n\n\n\n<li>\u30af\u30ed\u30c3\u30af\u306e\u521d\u671f\u5316<\/li>\n\n\n\n<li>\u5185\u8535\u5468\u8fba\u88c5\u7f6e\u306e\u521d\u671f\u5316<\/li>\n\n\n\n<li>\u30e1\u30e2\u30ea\u306e\u521d\u671f\u5316<\/li>\n\n\n\n<li>\u30b7\u30b9\u30c6\u30e0\u30bf\u30a4\u30de\u306e\u521d\u671f\u5316<\/li>\n\n\n\n<li>main\u95a2\u6570\u306e\u5b9f\u884c<\/li>\n<\/ul>\n\n\n\n<p>PendSV \u3068\u306f\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u4f8b\u5916\u306e\u3053\u3068\u3060\u305d\u3046\u3067\u3001\u30bf\u30b9\u30af\u306e\u5207\u308a\u66ff\u3048\u7b49\u306b\u7528\u3044\u308b\u306e\u304c\u4e00\u822c\u7684\u306a\u3088\u3046\u3067\u3042\u308b\u3002\u3053\u308c\u306f\u6700\u4f4e\u30ec\u30d9\u30eb\u306b\u8a2d\u5b9a\u3057\u3001\u9006\u306b SysTick \u306f\u6700\u9ad8\u30ec\u30d9\u30eb\u306b\u8a2d\u5b9a\u3059\u308b\u3002<\/p>\n\n\n\n<p>\u5185\u8535\u5468\u8fba\u88c5\u7f6e\u306e\u521d\u671f\u5316\u3068\u3057\u3066\u306fGPIO\u3068UART0\u3092\u6709\u52b9\u5316\u3057\u3001\u30dc\u30fc\u30c9\u4e0a\u306eLED\u306b\u63a5\u7d9a\u3055\u308c\u3066\u3044\u308bGPIO25\u306e\u521d\u671f\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>\u30e1\u30e2\u30ea\u306e\u521d\u671f\u5316\u3067\u306f\u3001.rodata \u30bb\u30af\u30b7\u30e7\u30f3\u306e\u5185\u5bb9\u3092 .data \u30bb\u30af\u30b7\u30e7\u30f3\u306b\u30b3\u30d4\u30fc\u3057\u3001.bss \u30bb\u30af\u30b7\u30e7\u30f3\u3092\u30bc\u30ed\u30af\u30ea\u30a2\u3057\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>\u30af\u30ed\u30c3\u30af\u3084\u30bf\u30a4\u30de\u95a2\u4fc2\u306f\u304b\u306a\u308a\u306e\u8a2d\u5b9a\u304c\u5fc5\u8981\u307f\u305f\u3044\u3002\u3088\u304f\u308f\u304b\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u7701\u7565\u3002<\/p>\n\n\n\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001Raspberry Pi pico \u306e\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u306e\u6d41\u308c\u304c\u3060\u3044\u305f\u3044\u3064\u304b\u3081\u305f\u3002\u30a2\u30bb\u30f3\u30d6\u30ea\u8a00\u8a9e\u3092\u771f\u9762\u76ee\u306b\u8aad\u3080\u306e\u306f 8086 \u4ee5\u6765\u304b\u306a\u3041\u3002\u3061\u3083\u3093\u3068ARM\u306e\u52c9\u5f37\u3082\u3057\u3088\u3046\u3063\u3068\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ELF \u30d0\u30a4\u30ca\u30ea\u306e\u9006\u30a2\u30bb\u30f3\u30d6\u30eb<\/h2>\n\n\n\n<p>arm-none-eabi-objdump \u3092\u4f7f\u3046\u3068\u3001\u30d3\u30eb\u30c9\u3057\u305fELF\u30d0\u30a4\u30ca\u30ea\u3092\u9006\u30a2\u30bb\u30f3\u30d6\u30eb\u3067\u304d\u308b\u304c\u3001\u30bb\u30ab\u30f3\u30c9\u30b9\u30c6\u30fc\u30b8\u90e8\u5206\u304cthumb\u30b3\u30fc\u30c9\u3068\u3057\u3066\u89e3\u91c8\u3055\u308c\u305a\u56f0\u3063\u305f\u3002\u5f37\u5236\u7684\u306bthumb\u30b3\u30fc\u30c9\u306b\u9006\u30a2\u30bb\u30f3\u30d6\u30eb\u3059\u308b\u65b9\u6cd5\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/usr\/bin\/arm-none-eabi-objdump -D -m arm -M force-thumb \uff1celf\u30d5\u30a1\u30a4\u30eb\u540d\uff1e<\/code><\/pre>\n\n\n\n<p>\u30d9\u30af\u30bf\u30fc\u30c6\u30fc\u30d6\u30eb\u3082thumb\u30b3\u30fc\u30c9\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u304c\u96e3\u70b9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CQ\u51fa\u7248\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u8a8c\uff17\u6708\u53f7\u7279\u96c6\u300c\u30e9\u30ba\u30d1\u30a4Pico\u30671500\u884c \u30bc\u30ed\u304b\u3089\u4f5c\u308bOS\u300d\u304b\u3089\u3001\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u306e\u6d41\u308c\u3092\u6574\u7406\u3057\u3066\u307f\u305f\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[76,73,72],"class_list":["post-3768","post","type-post","status-publish","format-standard","hentry","category-raspberry-pi-pico","tag-bootstrap","tag-pico","tag-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/3768","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=3768"}],"version-history":[{"count":7,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/3768\/revisions"}],"predecessor-version":[{"id":3779,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/3768\/revisions\/3779"}],"wp:attachment":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/media?parent=3768"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/categories?post=3768"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/tags?post=3768"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}