Skip to content

m5stack-official-stackchan 環境がビルドできない(StackChan-BSP のパス変更により SCSCL.h が見つからない) #76

@petitroto

Description

@petitroto

ビルドが出来ず、微修正したら動作したのでご報告します。
(以下のレポートはClaudeが書きましたが私が目を通しています)

概要

m5stack-official-stackchan 環境でビルドすると、servo.hpp がインクルードしている drivers/SCServo_lib/src/SCSCL.h が見つからずコンパイルエラーになります。

対象リビジョン

  • ブランチ: main
  • コミット: ae5c4a7126ae199a20393c249f5feb07e99a42ab

環境

  • ビルド対象環境: m5stack-official-stackchan
  • platform: https://github.com/pioarduino/platform-espressif32.git#55.03.36
  • StackChan-BSP: 1.1.0f7ed40eplatformio.ini ではタグ未指定のため最新 main を取得)

原因

公式 StackChan-BSP 側でサーボドライバのディレクトリが drivers/SCServo_lib/drivers/FTServo_Arduino/ にリネームされています。BSP 自身のコードも新パスを使用しています(M5StackChan.cpp: #include "drivers/FTServo_Arduino/src/SCSCL.h")。

一方、本リポジトリの firmware/include/servo.hpp は旧パスを参照したままのため、最新 BSP を取得するとビルドに失敗します。クラス名 SCSCL は変更されていないため、影響はインクルードパスのみです。

修正案

firmware/include/servo.hpp のインクルードパスを更新する:

-#include <drivers/SCServo_lib/src/SCSCL.h>
+#include <drivers/FTServo_Arduino/src/SCSCL.h>

エラーログ

Executing task: platformio run --environment m5stack-official-stackchan

Processing m5stack-official-stackchan (board: m5stack-cores3; platform: https://github.com/pioarduino/platform-espressif32.git#55.03.36; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/m5stack-cores3.html
PLATFORM: Espressif 32 (55.3.36+sha.aa6e97c) > M5Stack CoreS3
HARDWARE: ESP32S3 240MHz, 320KB RAM, 16MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h,
olimex-jtag-tiny, tumpa)
PACKAGES:
 - contrib-piohome @ 3.4.4
 - framework-arduinoespressif32 @ 3.3.6
 - framework-arduinoespressif32-libs @ 5.5.0+sha.f56bea3d1f
 - tool-esp-rom-elfs @ 2024.10.11
 - tool-esptoolpy @ 5.1.0
 - tool-openocd-esp32 @ 2.1200.20251215 (12.0)
 - tool-xtensa-esp-elf-gdb @ 16.3.0+20250913
 - toolchain-xtensa-esp-elf @ 14.2.0+20251107
[ComponentManager] Processed 1 ignored libraries
[ComponentManager] Session completed with 1 changes
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ deep, Compatibility ~ soft
[nanopb] No generation needed.
Found 58 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Adafruit NeoPixel @ 1.15.5
|-- WebSockets @ 2.7.3
|-- AsyncTCP @ 3.4.10
|-- ESP32Servo @ 3.2.0
|-- Nanopb @ 0.4.91
|-- ESP_SR_M5Unified @ 1.0.0+sha.9590351
|-- M5GFX @ 0.2.22
|-- M5Unified @ 0.2.16
|-- StackChan-BSP @ 1.1.0+sha.f7ed40e
|-- WiFi @ 3.3.6
|-- generated_protobuf
Building in debug mode
Compiling .pio/build/m5stack-official-stackchan/src/display.cpp.o
Compiling .pio/build/m5stack-official-stackchan/src/main.cpp.o
Compiling .pio/build/m5stack-official-stackchan/src/metadata.cpp.o
Compiling .pio/build/m5stack-official-stackchan/src/servo.cpp.o
In file included from firmware/src/servo.cpp:1:
firmware/include/servo.hpp:41:10: fatal error: drivers/SCServo_lib/src/SCSCL.h: No such file or directory
   41 | #include <drivers/SCServo_lib/src/SCSCL.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling .pio/build/m5stack-official-stackchan/FrameworkArduino/USBMSC.cpp.o
*** [.pio/build/m5stack-official-stackchan/src/servo.cpp.o] Error 1
In file included from firmware/src/main.cpp:26:
firmware/src/../include/servo.hpp:41:10: fatal error: drivers/SCServo_lib/src/SCSCL.h: No such file or directory
   41 | #include <drivers/SCServo_lib/src/SCSCL.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pio/build/m5stack-official-stackchan/src/main.cpp.o] Error 1
====================================================== [FAILED] Took 11.18 seconds ======================================================

Environment                 Status    Duration
--------------------------  --------  ------------
m5stack-official-stackchan  FAILED    00:00:11.176
================================================= 1 failed, 0 succeeded in 00:00:11.176 =================================================

 *  The terminal process "platformio 'run', '--environment', 'm5stack-official-stackchan'" terminated with exit code: 1.
 *  Terminal will be reused by tasks, press any key to close it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions