-
Notifications
You must be signed in to change notification settings - Fork 167
Installing NEMO
Supported Devices: M5Cardputer, M5StickC, M5StickCPlus/M5StickCPlus2.
M5Stick C Plus Quick Start has links to the M5Burner app for Linux, MacOS and Windows. This is the official tool to install UIFlow and other official firmware. Up-to-date binaries for NEMO are there.
Launch M5Burner
Select "StickC" from the menu on the left (StampS3 for Cardputer, use common sense for other devices)
Click on the Search at the type and search for "NEMO". Official releases are from "4x0nn" and have photos!
Click Download
Click Burn
Install ESP-IDF tools per the Espressif Getting Started Guide
Open the esp-idf CMD tool (on Windows) - on Mac or Linux, esp-idf.py and esptool.py should be in the system path.
esptool.py --port COMPORT -b 115200 write_flash -z 0x0 M5Nemo-VERSION.bin
- port may be a COM port e.g. COM4, COM11 on Windows. On Mac and Linux it will usually be in /dev such as /dev/ttyUSB0, /dev/ttyACM0 or /dev/cu.usbserial-3
- M5Nemo-VERSION.bin should be a version you downloaded from a GitHub Release -- preferably the latest available.
Install Arduino IDE. I've used Arduino 1.8 on Linux and Windows, and Arduino 2.2 on Windows successfully.
Install the M5Stack boards for Arduino IDE: In File -> Preferences, paste this URL into the "Boards Manager URLs" text box. Use commas between URLs if there are already URLs present. https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
If M5Stack -> M5Stick-C-Plus doesn't show up under Tools -> Boards, then use Tools -> Boards -> Boards Manager and search for M5Stack. This will install support for most of the M5Stack boards including the Stick C Plus.
Ensure the correct device model (e.g. M5Stick-C, M5Stick-C-Plus or M5Cardputer) is selected in the boards menu.
Install necessary libraries. In Sketch -> Include Library -> Library Manager, search for and install the following libraries and any dependencies they require:
- M5 device
- IRRemoteESP8266
Un-comment the appropriate #define
line near the top for your platform (STICK_C, STICK_C_PLUS or CARDPUTER)
Switch partition schemes. Tools
-> Partition Scheme
-> No OTA (Large APP)
- sometimes this option is labeled Huge APP
Configuration
- The code should compile cleanly and work on an M5Stick C Plus out of the box from the master branch or a release tag.
- Uncomment only the one appropriate
#define
option or compiler errors will occur. - If for some reason the screen jumps from very dim at level 0 to almost fully bright at level 1 and further brightness levels don't affect anything, set the pct_brightness variable to false.
Compile and upload the project
Install Arduino CLI
Add M5Stack Index to Arduino Core
Add M5Stack Libraries
Install m5stack boards
arduino-cli core install m5stack:esp32 --additional-urls https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json --log-level warn --verbose
Install required library
arduino-cli lib install M5Cardputer --log-level warn --verbose
arduino-cli lib install IRRemoteESP8266 --log-level warn --verbose
Compile sketch
arduino-cli compile --fqbn m5stack:esp32:m5stack_cardputer -e --build-property build.partitions=huge_app --build-property upload.maximum_size=3145728 ./m5stick-nemo.ino
This will create multiple binaries based on partition sketch, you can merge a single binary using "esptool"
Install esptool - pip install -U esptool
esptool.py --chip esp32s3 merge_bin --output final.bin 0x0000 m5stick-nemo.ino.bootloader.bin 0x8000 m5stick-nemo.ino.partitions.bin 0x10000 m5stick-nemo.ino.bin
You can now flash the merged binary firmware using esptool
esptool.exe write_flash -z 0 final.bin
Install Docker
Run ./scripts/docker-build.sh <configs/.env.>
Run ./scripts/flash.sh --device=<your-device-port>
This will build an image will all required libraries based on the configured platform, and it will compile, output and merge binaries
By default this will compile for the M5Cardputer in en-us locale, ./config/.env.M5Cardputer
./scripts/docker-build.sh
If you want to select a different build config you can pass it as a parameter. See ./configs/ for various configurations
./scripts/docker-build.sh ./config/.env.M5Cardputer
Binary files will be output to ./build
ls ./build
This will flash the build output from the build step, it reuses the container image from the previous step.
By default this will compile for the M5Cardputer in en-us locale, ./config/.env.M5Cardputer
./scripts/flash.sh --device=/dev/ttyusb0
If you passed a different build config make sure to pass it along to the flash script
./scripts/flash.sh --device=/dev/ttyusb0 --build-config=./config/.env.M5Cardputer