STAMP PICO MicroPython Quick Start

This tutorial applies to STAMP-PICO

ESP32 Downloader

Before burning, you need to connect a USB-TTL burning board for STAMP-PIOC, and proceed according to the board silkscreen connect. Install the driver corresponding to the burning board on the PC.

The most convenient way is to Purchase the STAMP-PICO package version with downloader , the line sequence of the matching downloader It is consistent with STAMP-PICO, it can be directly plugged in for programming without wiring. Currently M5 provides downloaders of two driver chip versions, CP210X (applicable to CP2104 version)/CP34X (applicable to CH9102 version) driver compressed package. After decompressing the compressed package, select the installation corresponding to the number of operating systems Package to install. (If you are not sure which USB chip your device uses, you can install two drivers at the same time)

Driver name Applicable driver chip Download link
CP210x_VCP_Windows CP2104 Download
CP210x_VCP_MacOS CP2104 Download
CP210x_VCP_Linux CP2104 Download
CH9102_VCP_SER_Windows CH9102 Download
CH9102_VCP_SER_MacOS v1.7 CH9102 Download

Burning tool.

Please click the button below to download the appropriate M5Burner firmware burning tool according to the operating system you are using. Open the application after decompression.

Software Link
M5Burner_Windows Download
M5Burner_MacOS Download
M5Burner_Linux Download

Pay attention:
MacOSAfter the user has completed the installation, please put the application into theApplication,As shown in the following figure。
LinuxFor users, please switch to the decompressed file path and run in the terminal../M5Burner, run the application。

ESP32 Downloader

You need to connect a downloader for STAMP-PIOC before burning. USB-TTL Recording board , And connect according to the screen printing of the board. The driver corresponding to the burning board is installed on the PC side.

The most convenient way is Choose the package version of STAMP-PICO with downloader , The wire sequence of the matching downloader is the same as that of STAMP-PICO, and it can be plugged and recorded directly without wiring. Click here to go to the following page to download the driver for the matching downloader CP210x & CH9102

Firmware burning

Double-click to open the Burner burning tool, select the corresponding device class in the left menu, select the firmware of the matching device, and click the download button to download.

Connect the M5 device to the computer through the Type-C data cable, select the corresponding COM port, the baud rate can use the default configuration in M5Burner, click on Burn.

In the firmware burning stage, you need to fill in the WiFi information into the WiFi configuration box. The information will be burned and saved to the M5 device along with the firmware, and click on Start to start burning. Note: If the programming timeout occurs, try to reduce the baud rate to 115200.

When the burning log prompts Burn Successfully, it means that the firmware has been burned. When the STAMP-PICO's LED light is blinking green, it means that the program can be pushed at any time. By default, after burning the firmware for the first time, the device will automatically restart and enter the online programming mode.

When burning for the first time or the firmware program runs abnormally, you can click Erase in the upper right corner to erase the flash memory. In the subsequent firmware update, there is no need to erase again, otherwise the saved Wi-Fi information will be deleted and refreshed API KEY.

Mode switching

If you keep pressing the button when the power is off and then power on, you will enter the mode switch state. In this state, LED and others will cycle between Green', Blue , YellowandPurple `, and different colors represent different modes. Release the button when LED switches the corresponding color to enter the corresponding mode. The detailed functional model is described below.

Green: Online programming mode, used to connect online version of UIFlow, You need to configure WIFI before you can connect。
Blue: Offline programming mode, connected via USB cable
Yellow: WIFI configuration mode, the device will automatically enable AP, and users can connect to the AP through the mobile device and access the 192.168.4.1 page to configure WIFI
Purple: APP mode. Default is to run the last downloaded program.

VSCode IDE Development.

Preparatory work.

Download. VSCode IDE: Click here to download
Install the M5Stack plug-in: Search the plug-in market for M5Stack and install the plug-in, as shown below.

Device offline programming mode (USB mode).

Keep pressing the button when the power is off, then connect to the PC and turn on the power, wait for the LED cycle to switch to blue and release, you can enter the USB programming mode.

Connect to Device.

Click the Add M5Stack option in the lower left corner and select the corresponding device port to complete the connection.

LED Control

After completing the above steps, let's implement a simple lighting case program, open the M5Stack file tree, and type in the following program. Click Run in M5stack to easily light a small yellow light. If the device is reset, click the refresh button to reopen the file tree.

Sample code.

from m5stack import *
from m5ui import *
from uiflow import *

rgb.setColorAll(0xffff33)
On This Page