MEAM.Design - M5 Stamp C3 - Getting Started



Hardware/software Requirements

  1. Arduino Integrated Development Environment (IDE)
  2. M5 Stamp C3
  3. USB-C cable
  4. WindowsPC or Mac

Install Arduino IDE

  1. Both Mac and Windows can download Arduino IDE. Arduino.cc e.g. version (1.8.7) or later.
  2. Install according to the instructions

ESP32 Additions to Arduino Instructions

Use the Board Manager of the Arduino IDE as described on this link:

  1. https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html
  2. This should be ESP32 version 2.0.4 or later.

Install the UART/USB driver for the C3

  1. Download the driver for PC or Mac on this webpage: https://docs.m5stack.com/en/core/stamp_c3#driver-installation
  2. Follow the instructions on the webpage.
  3. If using a Mac, you may get an error when trying the example code below: Failed to write to target RAM (result was 01070000), Follow instructions on this site: https://github.com/WCHSoftGroup/ch34xser_macos . If there is a driver privilege error. Enter "System Preferences"->"Security & Privacy"->"General" page, below the title "Allow apps downloaded from." choose choice 2 -> "Mac App Store and identified developers".
  4. If you get an error: "A fatal error occurred: Unable to verify flash chip connection..." The upload speed may be too high. Set slower (e.g. "460800").

Test with Example Code

  1. Restart the Arduino IDE (be sure the ESP32 board is connected via usb to your computer)
  2. Set the IDE to use the ESP32C3 board using this menu option Tools→Board:→ESP32 Arduino→ ESP32C3 Dev Module
  3. Set the upload speed Tools→Upload Speed921600
  4. Set the USB port you are using
    [On Windows] Tool→Port COM# (some port number)
    [On Mac] Tool→Port /dev/cu.wchusbserial1234567 (some long number)
  5. Load an example, File→Examples→ESP32→GPIO→BlinkRGB. You may need to scroll down the Examples to find the ESP32 line.
  6. In the new window, modify the file by adding a line at the very top #define RGB_BUILTIN 2 so that the compiler knows which pin is the LED on the C3. (The #define may need to be LED_BUILTIN)
  7. Click the ‘check’ (✓) <Verify> button in upper left to compile the code.
    If there are no mistakes after a few seconds text in white should appear Sketch uses...
    If there is a mistake (like a typo), text in red should appear stating the error, and the error location is highlighted with red background in the window.
  8. Click the ‘arrow’ (→) <Upload> next to the (✓), to flash the code, (burn it into the C3)
    If things are setup correctly, there should be text ending with "Leaving... Hard resetting via RTS pin..." and the RGB LED on the StampC3 should blink red, then green, then blue, then off for 1 second.
    If not, typical errors are USB port or set connection problems. You may try removing and replacing the cables into the USB ports. Check that the bottom right corner of the Arduino window says "ESP32C3 Dev Module on /dev/cu.wchusbserial34193847857" or which ever port it is on