Skip to content

ESP32 Core v2.0.1 / 2.0.1 RC1 crashes if using pinMode with GPIO1 #5868

Closed
@khoih-prog

Description

@khoih-prog

Core ESP32 Core v2.0.1 / 2.0.1 RC1 crashes if using pin pinMode with GPIO1, INPUT or OUTPUT mode. No issue with core v2.0.0-

With the following simple sketch, it's working OK if using PIN_D2 or PIN_D3, but crash if using PIN_D1

#define PIN_D1            1         // Pin D1 mapped to pin GPIO1/TX0 of ESP32
#define PIN_D2            2         // Pin D2 mapped to pin GPIO2/ADC12/TOUCH2/LED_BUILTIN of ESP32
#define PIN_D3            3         // Pin D3 mapped to pin GPIO3/RX0 of ESP32

#define PIN_OUT           PIN_D1

void setup() 
{
  // put your setup code here, to run once:
  Serial.begin(115200);
  while (!Serial);

  delay(1000);
  
  Serial.print("\nStarting D1_Crash using with pin = "); Serial.print(PIN_OUT); Serial.print(" on "); Serial.println(ARDUINO_BOARD);

  pinMode(PIN_OUT, OUTPUT);
}

void loop() 
{
  digitalWrite(PIN_OUT, HIGH);
  Serial.println("H");        // H means High
  delay(1000);
  digitalWrite(PIN_OUT, LOW);
  Serial.println("L");        // H means High
  delay(1000);
}

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions