Not able to compile helloworld for M5paper

  • I am not able to compile helloworld for M5paper after following ( I am getting error as bellow. Kindly suggest solution.
    C:\Users\DELL\OneDrive\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp: In member function 'void M5EPD::begin(bool, bool, bool, bool, bool)':
    C:\Users\DELL\OneDrive\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp:67:36: error: call of overloaded 'begin(int, int, int)' is ambiguous
    Wire.begin(21, 22, (400000));
    In file included from C:\Users\DELL\OneDrive\Documents\Arduino\libraries\M5EPD\src\M5EPD.h:5,
    from C:\Users\DELL\OneDrive\Documents\Arduino\libraries\M5EPD\src\M5EPD.cpp:1:
    C:\Users\DELL\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\Wire\src/Wire.h:79:10: note: candidate: 'bool TwoWire::begin(int, int, uint32_t)'
    bool begin(int sda=-1, int scl=-1, uint32_t frequency=0); // returns true, if successful init of i2c bus
    C:\Users\DELL\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\Wire\src/Wire.h:80:10: note: candidate: 'bool TwoWire::begin(uint8_t, int, int, uint32_t)'
    bool begin(uint8_t slaveAddr, int sda=-1, int scl=-1, uint32_t frequency=0);
    Multiple libraries were found for "SD.h"
    Used: C:\Users\DELL\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\SD
    Not used: D:\arduino-1.8.18\libraries\SD
    Multiple libraries were found for "WiFiClient.h"
    Used: C:\Users\DELL\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1\libraries\WiFi
    Not used: D:\arduino-1.8.18\libraries\WiFi
    exit status 1
    Error compiling for board M5Stack-Paper.

  • Hello @hrsavla

    these error only seems to happen with the latest Arduino 2.0.1 framework but not with 1.0.6 framework. You could try to downgrade to Arduino 1.0.6 framework. Or try to fix the error yourself.

    To get rid of the ambiguous error I modified the library file M5EPD.cpp and changed this line:

      Wire.begin(21, 22, 400000);


      Wire.begin(21, 22, (uint32_t) 400000);


  • Hello @felmue
    Thanks for suggestion. It solved the problem.

  • Hey,

    So I used the esp32 board to compile and not the M5 ones, and it works fine on all latest version of IDE and 2.0 versions.

    I had the same trouble looks like the devs need to update the board filles.

    Also tested touch screen and RTC and so on and on and all worked, I think I used the M5core board in the esp32 boards to get it to work but a few of the others also worked.

  • I got the same compiler errors after inserting (uint...) the firs error disappears - thanks for your hint! But then, I receive a bunch of errors because ADC1_GPI35_CHANNEL 'was not declared in this scope'. Since M5EPD.cpp includes various *.h files, which again inclut files that include... it is hard to find out where ADC _... is declared. I would be grateful if you could tell me. Maybe, something went wrong in my installation.
    Icidentally, compilation takes extremely long, probably because I have very many paths to *.h files under ...ArduinoData\packages\m5Stack
    Thanks for any hint.

  • Hi
    I had the same problem, but the suggested (uint16_t) correction in M5EPD.cpp lead to another problem: in the files adc.h, the statement
    #include "soc/adc_channel.h" must be inserted after tge firts #include statement.