<?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[M5Stack Core2 pin config problems]]></title><description><![CDATA[<p dir="auto">Hi, I am trying to get a project running on a Core2, I am getting errors related to the GPIO config.</p>
<p dir="auto">I am using PIO in VSC, my PIO environment is setup as follows.</p>
<pre><code>release (board: m5stack-core2; platform: espressif32; framework: arduino)
</code></pre>
<p dir="auto"><strong>These are the GPIO config errors I am getting</strong></p>
<pre><code>Initialising Hardware 
E (467) gpio: GPIO can only be used as input mode
[   495][E][esp32-hal-gpio.c:130] __pinMode(): GPIO config failed
E (484) gpio: GPIO can only be used as input mode
[   511][E][esp32-hal-gpio.c:130] __pinMode(): GPIO config failed
E (494) gpio: GPIO can only be used as input mode
[   522][E][esp32-hal-gpio.c:130] __pinMode(): GPIO config failed
E (504) gpio: GPIO can only be used as input mode
[   532][E][esp32-hal-gpio.c:130] __pinMode(): GPIO config failed
E (514) gpio: GPIO can only be used as input mode
[   542][E][esp32-hal-gpio.c:130] __pinMode(): GPIO config failed
E (525) gpio: GPIO can only be used as input mode
[   553][E][esp32-hal-gpio.c:130] __pinMode(): GPIO config failed
E (535) gpio: GPIO can only be used as input mode
[   563][E][esp32-hal-gpio.c:130] __pinMode(): GPIO config failed
E (545) gpio: GPIO can only be used as input mode
[   573][E][esp32-hal-gpio.c:130] __pinMode(): GPIO config failed
E (556) gpio: GPIO can only be used as input mode
[   583][E][esp32-hal-gpio.c:130] __pinMode(): GPIO config failed
</code></pre>
<p dir="auto"><strong>This is my pins.h configuration</strong><br />
I have used 100 for pins that are not currently used/required in the project.</p>
<pre><code>/***********************************************************
 * M5STACK CORE2
 * UNTESTED
 * NOTE M5STACK CORE2 has SD card on GPIOs 4/23/38/18
 *
  ***/
#ifdef M5_STACK_CORE2

    #define BOARD_TYPE              "m5stack-core2"

    // Define Physical Pins
    
    // VAC CONTROL
    #define VAC_SPEED_PIN               100                      // Built in DAC1 - used for speed reference for VFD (0-3v)
    #define VAC_BLEED_VALVE_PIN         100                      // Built in DAC2 - used for bleed valve control
    
    #define VAC_BANK_1_PIN              100                      // vac motor(s) on/off
    #define VAC_BANK_2_PIN              100                      // Provision for 2 stage Vac motor control
    #define VAC_BANK_3_PIN              100                      // Provision for 3 stage Vac motor control
    
    // SENSORS
    #define SPEED_SENSOR_PIN            100                      // turbine / rotor speed for turbo / blower flow bench

     // SWIRL ENCODER
    #define SWIRL_ENCODER_PIN_A         100
    #define SWIRL_ENCODER_PIN_B         100

   // ORIFICE DETECTION                                                                                    
    #define ORIFICE_BCD_BIT1_PIN        100                     
    #define ORIFICE_BCD_BIT2_PIN        100                    
    #define ORIFICE_BCD_BIT3_PIN        100     

    //STEPPER MOTOR CONTROLLER                  
    #define FLOW_VALVE_STEP_PIN         100
    #define FLOW_VALVE_DIR_PIN          100
                  
    #define AVO_STEP_PIN                100
    #define AVO_DIR_PIN                 100

    #define VCC_3V3_PIN                 100                     // Unused
    #define VCC_5V_PIN                  2                      // 10k-10k divider across 5v supply
    
    // NOTE: these inputs are handled by ADC
    #define MAF_PIN                     100                     // NOTE: I2C ADC is used instead
    #define REF_PRESSURE_PIN            100                     // NOTE: I2C ADC is used instead
    #define DIFF_PRESSURE_PIN           100                     // NOTE: I2C ADC is used instead
    #define PITOT_PIN                   100                     // NOTE: I2C ADC is used instead
    
    // NOTE: These inputs are handled by BME280
    #define TEMPERATURE_PIN             100                     // NOTE: I2C BME280 used
    #define REF_BARO_PIN                100                     // NOTE: I2C BME280 used
    #define HUMIDITY_PIN                100                     // NOTE: I2C BME280 used                     
    
    // COMMS    
    #define SERIAL0_TX_PIN              1                      // API
    #define SERIAL0_RX_PIN              3                      // API
    #define SERIAL2_TX_PIN              100                     // GAUGE PROTOCOL CLOCK
    #define SERIAL2_RX_PIN              100                     // GAUGE PROTOCOL DATA
    #define SDA_PIN                     32                     // BME280 etc
    #define SCL_PIN                     33                     // BME280 etc
    
    //#define SD_CS_PIN                   4
    //#define SD_MOSI_PIN                 23                 
    //#define SD_MISO_PIN                 38             
    //#define SD_SCK_PIN                  18                   

#endif
</code></pre>
<p dir="auto">I hope someone here can help me resolve my problem.<br />
Thanks.</p>
]]></description><link>https://community.m5stack.com/topic/6945/m5stack-core2-pin-config-problems</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 09:26:05 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6945.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 31 Oct 2024 15:45:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to M5Stack Core2 pin config problems on Sat, 02 Nov 2024 20:02:13 GMT]]></title><description><![CDATA[<p dir="auto">I managed to resolve the issue I was having by editing the hardware.cpp of the project from</p>
<pre><code>  pinMode(VCC_3V3_PIN, INPUT); 
</code></pre>
<p dir="auto">to</p>
<pre><code>  #ifdef VCC_3V3_PIN
  pinMode(VCC_3V3_PIN, INPUT); 
  #endif
</code></pre>
<p dir="auto">This has then enabled me to comment out the unused pins in the pins.h</p>
<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/4037">@felmue</a> and <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/443">@ajb2k3</a> thanks for your help</p>
]]></description><link>https://community.m5stack.com/post/26934</link><guid isPermaLink="true">https://community.m5stack.com/post/26934</guid><dc:creator><![CDATA[Phil_C]]></dc:creator><pubDate>Sat, 02 Nov 2024 20:02:13 GMT</pubDate></item><item><title><![CDATA[Reply to M5Stack Core2 pin config problems on Sat, 02 Nov 2024 11:37:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/4037">@felmue</a> Thanks again, I have tried this already and it causes issue with the code, which has not been written by me so more difficult to work though currently.</p>
<p dir="auto">Currently the unused pins that are defined in the code are there as place holders for future development of the code and parts of which have not been written yet</p>
<p dir="auto">It looks the problem is coming from the board type defined in the environment in platformio. See my comments in the replies above.</p>
<p dir="auto">Appreciate your help.</p>
]]></description><link>https://community.m5stack.com/post/26929</link><guid isPermaLink="true">https://community.m5stack.com/post/26929</guid><dc:creator><![CDATA[Phil_C]]></dc:creator><pubDate>Sat, 02 Nov 2024 11:37:15 GMT</pubDate></item><item><title><![CDATA[Reply to M5Stack Core2 pin config problems on Sat, 02 Nov 2024 11:31:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/443">@ajb2k3</a> I understand the message, I just don't understand where it is coming from.<br />
I believe it is related to the board type in platformio I have my environment set up as</p>
<pre><code>platform = espressif32
framework = arduino
board = m5stack-core2
</code></pre>
<p dir="auto">If I change the board type to</p>
<pre><code>platform = espressif32
framework = arduino
board = esp32-s3-devkitc-1
</code></pre>
<p dir="auto">Then I don't get the error messages about the invalid pins, I am reasonably new to all this so just trying to better my understanding.</p>
<p dir="auto">Is it that the board type m5stack-core2 is it looking for the pins already used on the M5Stack Core2?</p>
]]></description><link>https://community.m5stack.com/post/26928</link><guid isPermaLink="true">https://community.m5stack.com/post/26928</guid><dc:creator><![CDATA[Phil_C]]></dc:creator><pubDate>Sat, 02 Nov 2024 11:31:37 GMT</pubDate></item><item><title><![CDATA[Reply to M5Stack Core2 pin config problems on Sat, 02 Nov 2024 09:03:57 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/174546">@Phil_C</a></p>
<p dir="auto">you could also try to not define the not used GPIO, e.g. comment out those lines. Maybe that is a better approach than setting it to -1 as I suggested before.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/26924</link><guid isPermaLink="true">https://community.m5stack.com/post/26924</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Sat, 02 Nov 2024 09:03:57 GMT</pubDate></item><item><title><![CDATA[Reply to M5Stack Core2 pin config problems on Sat, 02 Nov 2024 08:13:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/174546">@Phil_C</a> In all honesty its actually telling you what's wrong.<br />
What part or the messages are you not understanding?</p>
]]></description><link>https://community.m5stack.com/post/26923</link><guid isPermaLink="true">https://community.m5stack.com/post/26923</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sat, 02 Nov 2024 08:13:51 GMT</pubDate></item><item><title><![CDATA[Reply to M5Stack Core2 pin config problems on Fri, 01 Nov 2024 14:01:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/4037">@felmue</a> thanks, that has made a difference and given me a working I2C bus and prevents the crashing.</p>
<p dir="auto">I am still curious to know what is causing the following messages during hardware initialisation,  this is now displayed since changing the pins to -1</p>
<pre><code>Initialising Hardware 
[   494][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
[   507][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
[   513][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
[   519][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
[   525][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
[   531][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
[   538][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
[   544][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
[   550][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
[   556][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
[   562][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
[   568][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
[   574][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
[   580][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
</code></pre>
]]></description><link>https://community.m5stack.com/post/26920</link><guid isPermaLink="true">https://community.m5stack.com/post/26920</guid><dc:creator><![CDATA[Phil_C]]></dc:creator><pubDate>Fri, 01 Nov 2024 14:01:19 GMT</pubDate></item><item><title><![CDATA[Reply to M5Stack Core2 pin config problems on Fri, 01 Nov 2024 08:06:26 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/174546">@Phil_C</a></p>
<p dir="auto">instead of <code>100</code> for non used GPIOs have you tried <code>-1</code>?</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/26917</link><guid isPermaLink="true">https://community.m5stack.com/post/26917</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Fri, 01 Nov 2024 08:06:26 GMT</pubDate></item></channel></rss>