Adding new board, M5StickC-Plus2

I recently got one of the M5StickC PLUS2 boards. (what a name)
Unfortunately, it looks there’s not already a board definition in PIO.
Although the earlier version the “M5StickC” does exist, so I am trying to adapt it.

While I haven’t dove too deeply into it, it looks like the ESP32 PICO module used is mostly similar.

Copying the board definition, and changing a few options to match what is in Arduino (8MB flash, 80Mhz flash freq, qio mode), a simple “hello world” does not work, and results in a boot loop. But the same code works fine in Arudino.
And looking at the invocation of esptool, the options are the same and binaries are getting flashed to the same addresses.
So, down to the binaries themselves.
Build flags, linker script, etc.

Any insight on what to tweak here?

I would like to get this working, as I find the Arduino IDE impossible to use except for the most basic stuff

2 Likes

Hi, I also have a problem with the M5StickC-Plus2

I Was using platform IO to upload a working config of ESPaltherma. It worked previously on a M5StickCPlus (that died) . But setting the environment to M5StickCPlus did not result in a succesfull upload. On the website of M5 they mention the something about powering up. I have no experience on how to implement it. But could this be a usefull hint?

Power on:
Wake up can be started by pressing "BUTTON C" for more than 2 seconds, or IRQ signal triggered by RTC regularly. After triggering the wake up signal, the hold(G4) pin needs to be set to a high level (1) in program initialization to maintain the power supply, otherwise the device will enter the shutdown state again.
Power off:
When there is no USB external power supply, press "BUTTON C" for more than 6 seconds; Or when there is no USB external power supply, set HOLD(GPIO4)=0 in the program operation, that is, to achieve power off.