Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
lazydogP
@lazydogP_gitlab
void setup()
{
  M5.begin();
  // checkSDUpdater();
  checkSDUpdater(
    SD,           // filesystem (default=SD)
    MENU_BIN,     // path to binary (default=/menu.bin, empty string=rollback only)
    2000,         // wait delay, (default=0, will be forced to 2000 upon ESP.restart() )
    TFCARD_CS_PIN // (usually default=4 but your mileage may vary)
  );
  M5.Lcd.setTextSize(3);
  M5.Lcd.print("Hello World");
}
tobozo
@tobozo
I'd set the wait delay to 5000 ms instead, the touch can be sluggish to start ;)
lazydogP
@lazydogP_gitlab
That didn't work either, it went crashing after 5s
tobozo
@tobozo
are you using <M5Core2.h> or <ESP32-Chimera-Core.h> ?
lazydogP
@lazydogP_gitlab
M5Core2.h only
tobozo
@tobozo
looks like ispressed = SDU_GFX.getTouch(&t_x, &t_y); is firing a touch signal when there isn't, sounds like a regression bug in the Touch driver of M5Core.h, does it improve with <ESP32-Chimera-Core.h> ?
There's the new M5Unified driver too, with gestures support, but I haven't tested that yet
lazydogP
@lazydogP_gitlab
By changing M5Core2.h with ESP32-Chimera-Core.h, I got this error
```
libraries\M5Stack-SD-Updater\M5StackUpdater.cpp.o:(.literal._ZN9SDUpdater8_fsBeginERN2fs2FSE[SDUpdater::_fsBegin(fs::FS&)]+0x0): undefined reference to `SPIFFS'
libraries\M5Stack-SD-Updater\M5StackUpdater.cpp.o:(.literal._ZN9SDUpdater8_fsBeginERN2fs2FSE[SDUpdater::_fsBegin(fs::FS&)]+0x1c): undefined reference to `fs::SPIFFSFS::begin(bool, char const*, unsigned char)'
libraries\M5Stack-SD-Updater\M5StackUpdater.cpp.o: In function `SDUpdater::_fsBegin(fs::FS&)':
C:\Users\lazydog\Documents\ArduinoData\packages\m5stack\hardware\esp32\1.0.9\libraries\FS\src/FS.h:47: undefined reference to `fs::SPIFFSFS::begin(bool, char const*, unsigned char)'
tobozo
@tobozo
esp32\1.0.9
time to update esp32 package ?
current version is 2.0.0
also packages\m5stack sounds like you're not selecting "M5Stack Core2" from the "ESP32 Arduino" menu but from another older (and obsolete) package
lazydogP
@lazydogP_gitlab
This esp32 package is inside m5stack package, which labels "M5Stack Arduino"
tobozo
@tobozo
you can ignore it
and pick "M5Stack-Core2" from the "ESP32 Arduino" menu instead
you will get an earlier version of the ESP32-Arduino-Core
lazydogP
@lazydogP_gitlab
Oh yeah it works now, at least with this little demo!
tobozo
@tobozo
I'll probably produce a new release once I've tested the new M5Unified library
lazydogP
@lazydogP_gitlab
Now I can see the Laucher/Skip timeout. Using old package will just crash there with no timeout. A small but helpful FAQ.
Pre-built programs don't work as expected
tobozo
@tobozo
pre-built programs aren't form M5Core2
and they're very old
lazydogP
@lazydogP_gitlab
How to get SD card info like capacity? There's a method SD.cardSize(), but I can't pass SD.begin() check
tobozo
@tobozo
I'm not sure what you mean, M5.begin() does the SD.begin() for you. Also SDFS has a size limitation for partitions and may return bogus values when querying the card size.
lazydogP
@lazydogP_gitlab
Oh, M5Core2.h can operate SD card while ESP32-Chimera-Core.h can't
I'm using SD_Test project from ESP32 examples
tobozo
@tobozo
I have a M5Core2 running ESP32-Chimera-Core and it can operate the SD, I still don't know what you mean with that issue, SD_Test isn't part of M5Core2.h or ESP32-Chimera-Core.h library .
lazydogP
@lazydogP_gitlab
#include <ESP32-Chimera-Core.h>
#define SDU_APP_NAME "M5Core2 SDLoader Snippet"
#include "FS.h"
#include "SPIFFS.h"
#include <M5StackUpdater.h>


void setup()
{
  M5.begin();
  checkSDUpdater(SD, MENU_BIN, 3000,TFCARD_CS_PIN);
  Serial.begin(115200);
  File file = SD.open("/1.txt", FILE_WRITE);
  if (!file) {
    Serial.println("Failed to open file");
    return;
  }
}
It can't open file, is there a way to debug?
tobozo
@tobozo
remove the Serial.begin(115200);, because M5.begin() takes care of starting Serial, and weird things can happen when Serial is started twice
lazydogP
@lazydogP_gitlab
Sadly, still doesn't work
tobozo
@tobozo
does it improve if you use M5.sd_begin() after checkSDUpdater ?
the serial console should be more talkative with those settings
image.png
lazydogP
@lazydogP_gitlab
Yeah I tried that without M5.sd_begin()
```
[  4504][E][vfs_api.cpp:22] open(): File system is not mounted
Failed to open file
Building now, it takes a century for Arduino IDE to build
tobozo
@tobozo
yep esp32 is long to rebuild when you change the debug settings
I could reproduce the error, and adding M5.sd_begin() fixed it
this is the sketch I'm using
#include <ESP32-Chimera-Core.h>
#define SDU_APP_NAME "M5Core2 SDLoader Snippet"
#include "FS.h"
#include "SPIFFS.h"
#include <M5StackUpdater.h>


void setup()
{
  M5.begin();
  checkSDUpdater(SD, MENU_BIN, 5000,TFCARD_CS_PIN);

  M5.sd_begin();

  File file = SD.open("/1.txt", FILE_WRITE);
  if (!file) {
    Serial.println("Failed to open file");
    return;
  } else {

  }
}

void loop()
{

}
lazydogP
@lazydogP_gitlab
Now it works!
tobozo
@tobozo
I will publish a patch on ESP32-Chimera-Core soon, you can patch manually by setting SD_ENABLE to 1 in Config.h
image.png
and you'll be able to remove M5.sd_begin()
sorry I took so long to understand the problem
lazydogP
@lazydogP_gitlab
It's okay, since these toolchains are hard for beginners
Anyways thank you so much for your patience
tobozo
@tobozo
thanks for your input, it helped spot a misconfiguration of the M5Core2 driver :+1: