HI @felmue ,
Thankyou for your reply :)
I had already striped the LCD code its the M5Stack header (and includes) itself that doesn't want to compile.
The only samples that compile are the factory test and Ethernet stream which leads me to believe their isn't a board specific header as such.
digging through the platform library there is a pin_header
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 16
#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1)
#define digitalPinToInterrupt(p) (((p)<40)?(p):-1)
#define digitalPinHasPWM(p) (p < 34)
static const uint8_t TX = 1;
static const uint8_t RX = 3;
static const uint8_t SDA = 25;
static const uint8_t SCL = 33;
static const uint8_t G23 = 23;
static const uint8_t G25 = 25;
static const uint8_t G27 = 27;
static const uint8_t G22 = 22;
static const uint8_t G26 = 26;
static const uint8_t G21 = 21;
static const uint8_t G32 = 32;
static const uint8_t G35 = 35;
static const uint8_t G34 = 34;
static const uint8_t G5 = 5;
static const uint8_t G39 = 39;
static const uint8_t G18 = 18;
static const uint8_t G36 = 36;
static const uint8_t G19 = 19;
static const uint8_t G15 = 15;
static const uint8_t G2 = 2;
static const uint8_t G33 = 33;
static const uint8_t G13 = 13;
static const uint8_t G4 = 4;
static const uint8_t G0 = 0;
static const uint8_t DAC1 = 25;
static const uint8_t DAC2 = 26;
static const uint8_t ADC1 = 35;
static const uint8_t ADC2 = 36;
#endif /* Pins_Arduino_h */
which of course is one of the many reasons why the example library doesn't compile,my device simply has different pins.
In the factory test I see the references to UART Ext_PIN_1 and Ext_PIN_2 :
Serial.println("UART INIT");
uart_init(Ext_PIN_1, Ext_PIN_2);
which is defiend in timer_cam_config.h
#define Ext_PIN_1 33
#define Ext_PIN_2 25
So lets strip off the header and run it with the pure Arduino.
#include <Arduino.h>
void setup() {
pinMode(33, INPUT_PULLUP);
Serial.begin(115200);
}
void loop() {
Serial.println(digitalRead(33));
delay(1000);
}
It works but only if I set the board to M5Stack-Timer-CAM.
Additionally the Ethernet-Stream example needs the network.h header lines 16-17 altered as below else it will not compile
static ip4_addr_t ip_addr; // For platform = espressif32@ ^3.5.0
//static esp_ip4_addr_t ip_addr; // For platform = espressif32@ ^5.1.0
I will post this in the modules forum for other users trying to build the examples, apologies for putting this in FAQ (it was late/early)