VSCode + Platform IO M5 Paper (EPD) board type

  • There is no forum for VSCode + PIO yet it is heavily used. Many of the M5 github examples obviously use it (at least for the Paper). So I post this here, despite it not being an Arduino IDE question.

    In those github examples, the platformio.ini has this content (partial extract)
    from https://github.com/m5stack/M5EPD_Calculator

    platform = espressif32
    board = m5stack-fire

    This project builds and runs fine.
    But I am surprised at the board used. In Arduino IDE, there is a specific M5Stack board for the Paper.

    In following up with the PlatformIO community support forum, I got very helpful support from someone, who said this:

    "I see, indeed. You’re using the board package as instructed from m5-docs, which is using the Arduino core https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/m5stack-2.0.3.zip. PlatformIO only supports the official Arduino-ESP32, which does not have the M5Stack-Paper (but other M5Stack boards), see here. Seems like the M5Stack people just fork the Arduino-ESP32 core, add their own boards, and don’t merge immediately back, leaving regular core users in the dark."

    but this user then discovered: "However, looking at the core download, it nicely has a package.json, so it can be used in PlatformIO, given the right board definition (already created in Create m5stack-paper.json by TomG736 · Pull Request #669 · platformio/platform-espressif32 · GitHub)."


    I wondered about the consequence of using

    board = m5stack-fire

    his reply was: "Board board = .. selection influences a great number of things, that is, ESP32 type, flash size and the Arduino variant e.g. The m5stack_fire and and m5stack_paper variant folders each have their pins_arduino.h in them, and they might have different things (e.g., default pins for attached devices or SPI bus etc.) in them, leading to incompatibilities later."

    So, is using

    board = m5stack-fire

    with VSCode/PIO ok?