<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Core2 Arduino samples do not work]]></title><description><![CDATA[<p dir="auto">I have a brand new Core2 and a Macbook with the latest Arduino IDE. The IDE is freshly installed, I have only installed the M5Core2 library. The Espressif boards are already up to date. I have tested sample code and everything concerning the display fails. I can flash an empty sketch.<br />
Here is the code:</p>
<pre><code>/*
*******************************************************************************
* Copyright (c) 2021 by M5Stack
*                  Equipped with M5Core2 sample source code
*                          配套  M5Core2 示例源代码
* Visit for more information: https://docs.m5stack.com/en/core/core2
* 获取更多资料请访问: https://docs.m5stack.com/zh_CN/core/core2
*
* Describe: Hello World
* Date: 2021/7/21
*******************************************************************************
*/
#include &lt;M5Core2.h&gt;

/* After M5Core2 is started or reset
the program in the setUp () function will be run, and this part will only be run
once. 在 M5Core2
启动或者复位后，即会开始执行setup()函数中的程序，该部分只会执行一次。 */
void setup() {
    M5.begin();  // Init M5Core2.  初始化 M5Core2
    /* Power chip connected to gpio21, gpio22, I2C device
           Set battery charging voltage and current
           If used battery, please call this function in your project */
    M5.Lcd.print("Hello World");  // Print text on the screen (string)
                                  // 在屏幕上打印文本(字符串)
}

/* After the program in setup() runs, it runs the program in loop()
The loop() function is an infinite loop in which the program runs repeatedly
在setup()函数中的程序执行完后，会接着执行loop()函数中的程序
loop()函数是一个死循环，其中的程序会不断的重复运行 */
void loop() {
}
</code></pre>
<p dir="auto">Errors:</p>
<pre><code>In file included from /Users/jonathan/Documents/Arduino/libraries/M5Core2/src/M5Display.h:10,
                 from /Users/jonathan/Documents/Arduino/libraries/M5Core2/src/M5Core2.h:12,
                 from /private/var/folders/6m/wp1p74qn5djfp08mcy83nzgr0000gn/T/.arduinoIDE-unsaved2024930-70928-12jngy4.v8s9/helloworld/helloworld.ino:13:
/Users/jonathan/Documents/Arduino/libraries/M5Core2/src/M5Display.h: In member function 'void M5Display::startWrite()':
/Users/jonathan/Documents/Arduino/libraries/M5Core2/src/utility/In_eSPI.h:231:5: error: 'GPIO' was not declared in this scope
  231 |     GPIO.out_w1tc = (1 &lt;&lt; TFT_CS); \
      |     ^~~~
/Users/jonathan/Documents/Arduino/libraries/M5Core2/src/M5Display.h:54:9: note: in expansion of macro 'CS_L'
   54 |         CS_L;
      |         ^~~~
/Users/jonathan/Documents/Arduino/libraries/M5Core2/src/M5Display.h: In member function 'void M5Display::endWrite()':
/Users/jonathan/Documents/Arduino/libraries/M5Core2/src/utility/In_eSPI.h:233:14: error: 'GPIO' was not declared in this scope
  233 | #define CS_H GPIO.out_w1ts = (1 &lt;&lt; TFT_CS)  //;GPIO.out_w1ts = (1 &lt;&lt; TFT_CS)
      |              ^~~~
/Users/jonathan/Documents/Arduino/libraries/M5Core2/src/M5Display.h:66:9: note: in expansion of macro 'CS_H'
   66 |         CS_H;
      |         ^~~~
Multiple libraries were found for "SD.h"
  Used: /Users/jonathan/Library/Arduino15/packages/esp32/hardware/esp32/3.0.7/libraries/SD
  Not used: /Users/jonathan/Library/Arduino15/libraries/SD
exit status 1

Compilation error: exit status 1
</code></pre>
]]></description><link>https://community.m5stack.com/topic/6941/core2-arduino-samples-do-not-work</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 17:03:33 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6941.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 30 Oct 2024 16:31:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Core2 Arduino samples do not work on Wed, 30 Oct 2024 17:53:49 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/178061">@G00TH</a></p>
<p dir="auto">I think the issue is with M5Core2 library not being ready/compatible for Arduino library version 3.x.x. (I get the same compilation errors as you are reporting.)</p>
<p dir="auto">That said, you could downgrade Arduino library to version 2.x.x - then the Hello World example of the M5Core2 library works for me.</p>
<p dir="auto">Or I suggest you try M5Unified with M5GFX libraries instead. For me they compile and run fine with Arduino library 2.x.x or 3.x.x.</p>
<pre><code>#include &lt;M5Unified.h&gt;
#include &lt;M5GFX.h&gt;

void setup() {
  auto cfg = M5.config();
  M5.begin(cfg);
  M5.Display.println("M5Core2 - Hello world");
}

void loop() {
}
</code></pre>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/26902</link><guid isPermaLink="true">https://community.m5stack.com/post/26902</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Wed, 30 Oct 2024 17:53:49 GMT</pubDate></item></channel></rss>