# Microchip PIC32CM Curiosity Nano（Zephyrへのプロセス）（パート3）

**URL:** <https://forum.digikey.com/t/microchip-pic32cm-curiosity-nano-zephyr-3/70953>\
**Category:** 技術的なヒント\
**Tags:** microchip-technology\
**Created:** [July 30, 2026, 8:19am UTC](https://forum.digikey.com/t/microchip-pic32cm-curiosity-nano-zephyr-3/70953 "2026-07-30T08:19:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tsuneharu\_Fuji](https://avatars.discourse-cdn.com/v4/letter/t/54ee81/32.png) [@Tsuneharu\_Fuji](https://forum.digikey.com/u/Tsuneharu_Fuji)\
**Post date:** [July 30, 2026, 8:19am UTC](https://forum.digikey.com/t/microchip-pic32cm-curiosity-nano-zephyr-3/70953/1 "2026-07-30T08:19:45Z")

</div>

この記事は、[Microchipの PIC32CM PL10-CNANO 評価ボード](https://www.digikey.jp/ja/products/detail/microchip-technology/EV10P22A/29019648)におけるZephyr RTOSデモのパート3です。

[![image](https://global.discourse-cdn.com/digikey/original/3X/1/4/14ed2e8aaa4aee62b040b2533d06284a4a3a613a.jpeg)](https://www.digikey.jp/ja/products/detail/microchip-technology/EV10P22A/29019648)

Zephyr RTOSデモを進める前に、このシリーズの[パート1](https://forum.digikey.com/t/microchip-pic32cm-curiosity-nano-zephyr-1-6158/70958)および[パート2](https://forum.digikey.com/t/microchip-pic32cm-curiosity-nano-zephyr-2-6157/70957)を参照してください。

最初のZephyr RTOSデモはblinky demoであり、以下のソースコードを使用します。

```auto
/*
 * Copyright (c) 2016 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <stdio.h>
#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio.h>

/* 1000 msec = 1 sec */
#define SLEEP_TIME_MS 1000

/* The devicetree node identifier for the "led0" alias. */
#define LED0_NODE DT_ALIAS(led0)

/*
 * A build error on this line means your board is unsupported.
 * See the sample documentation for information on how to fix this.
 */
static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);

int main(void)
{
        int ret;
        bool led_state = true;

        if (!gpio_is_ready_dt(&led)) {
                return 0;
        }

        ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
        if (ret < 0) {
                return 0;
        }

        while (1) {
                ret = gpio_pin_toggle_dt(&led);
                if (ret < 0) {
                        return 0;
                }

                led_state = !led_state;
                printf("LED state: %s\n", led_state ? "ON" : "OFF");
                k_msleep(SLEEP_TIME_MS);
        }
        return 0;
}

```

このZephyr RTOSプログラムは、LEDを1秒に1回点滅させます。このソースコードをビルドするには、以下の手順に従ってください。

```auto
zephyrproject/zephyr$ west build -p always -b pic32cm_pl10_cnano samples/basic/blinky

...
...
[137/137] Linking C executable zephyr/zephyr.elf
Memory region Used Size Region Size %age Used
           FLASH: 12068 B 60 KB 19.64%
             RAM: 3864 B 8 KB 47.17%
        IDT_LIST: 0 B 32 KB 0.00%

```

ここまでで、Zephyr RTOS blinkyアプリケーションのビルドに成功し、ターゲット評価ボードへのダウンロード準備が整いました。次回の記事では、このZephyr RTOSデモを[Microchip PIC32CM PL10-CNANO 評価ボード](https://www.digikey.jp/ja/products/detail/microchip-technology/EV10P22A/29019648)へダウンロードします。[Microchip PIC32CM PL10-CNANO 評価ボード](https://www.digikey.jp/ja/products/detail/microchip-technology/EV10P22A/29019648)は、低コストで高性能な開発ボードであり、[DigiKey](https://www.digikey.jp/)で入手できます。

どうぞ素晴らしい一日を！

この記事はスペイン語で [こちら](https://forum.digikey.com/t/microchip-pic32cm-curiosity-nano-el-camino-a-zephyr-parte-3/69600)からご覧いただけます。

Este artículo está disponible en español [aquí.](https://forum.digikey.com/t/microchip-pic32cm-curiosity-nano-el-camino-a-zephyr-parte-3/69600)

[オリジナル・ソース（English）](https://forum.digikey.com/t/microchip-pic32cm-curiosity-nano-the-road-to-zephyr-part-3/69294)
