-
Notifications
You must be signed in to change notification settings - Fork 0
Android
This guide explains step by step how to program your M5Stack with an ESP32 app (Arduino not required).
You will need an USB to USB cable to program the device, recent smartphones are USB-C but check the right type of connector on the phone side. Older phones might not support the app below: try to install it before buying the cable.

Plug your M5Stack device so that it will charge, do it now whilst you prepare the rest. It will boot up with the diagnostics firmware, or the previous version of the NightscoutMon firmware, leave it like that.
Browse the repo starting from here.
Tap the folder matching your M5Stack device:
- If you have an old M5Stack Core Basic (model prior to May 2020) -> Select Basic_4MB.
- If you have a newer M5Stack Core or a Core 2 model -> Select ESP32_16MB.
- If you have an M5Stack Core 3 model -> Select CoreS3.

You will then need to download three different files matching your device:

-
Select them one by one, first M5_NightscoutMon.ino.bin
-
Tap the three dots menu on the right
-
then Download.

- Wait until completion.
- Tap back once to return to the previous view.
- Select the second file: M5_NightscoutMon.ino.bootloader.bin
- and download it.

Same sequence to download the third and last file: M5_NightscoutMon.ino.partitions.bin
If you want to verify you have all the necessary files, you can check in your phone memory, in the Downloads folder:

Install Eric Parisot's app from the play store: ESP32_Flasher.
Open the app and verify settings, then select the files:
- Check Selected Chip is ESP32 (that's default)
- Change the BaudRate to 921600
- Write the same offset in the first box 0x1000 (zero, letter x, followed by 4 zeros) as what is displayed is only an indication
- Select file

Go to your download folder with the file browser menu.

Select details to be able to understand if you pick the right file!

The first file to select is the bootloader: M5_NightscoutMon.ino.bootloader.bin

One done, click + to add another line.

- On the new line, write down the offset, as suggested: 0x8000
- Click the file selection button

Select the partition file: M5_NightscoutMon.ino.partitions.bin

Add another line with +
- On the new line, write down the offset, as suggested: 0x10000 (zero, x, 5 zeros)
- Click the file selection button

Select the firmware file: M5_NightscoutMon.ino.bin (it's the biggest one)

Everything set correctly? Attach the USB cable and the M5Stack device directly to your phone (it should be charged by now).
Use the USB-C to USB-C cable, or one matching your phone USB plug.
Tap FLASH.

If this is the first time you use the app, you will need to authorize the connection.

If you didn't copy correctly the values in the offset fields, you'll have to do that now.

Wait until programming finishes, don't unplug the device

The M5Stack device will reboot.
Congratulations, you programmed your M5Stack.
Continue with the setup here.