Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
khoih-prog opened this issue Nov 10, 2021 · 7 comments
Closed

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

khoih-prog opened this issue Nov 10, 2021 · 7 comments
Assignees
Labels
Area: Peripherals API Relates to peripheral's APIs. Status: Solved

Comments

@khoih-prog
Copy link

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);
}
@khoih-prog khoih-prog changed the title ESP32 Core v2.0.1 / 2.0.1 RC1 crashes if using pin pinMode with GPIO1 ESP32 Core v2.0.1 / 2.0.1 RC1 crashes if using pinMode with GPIO1 Nov 10, 2021
@me-no-dev
Copy link
Member

any logs from that crash?

@khoih-prog
Copy link
Author

Even with Core Debug Level: "Verbose", the terminal debug has almost nothing

Using

#define PIN_OUT           PIN_D2

the debug terminal is

Starting D1_Crash using with pin = 2 on ESP32_DEV
H
L
H
L
H
L
H
L
H
...

khoih-prog added a commit to khoih-prog/ESP32TimerInterrupt that referenced this issue Nov 14, 2021
### Releases v1.4.1

1. Avoid using D1 in examples due to issue with core v2.0.0 and v2.0.1. Check [ESP32 Core v2.0.1 / 2.0.1 RC1 crashes if using pinMode with GPIO1 #5868](espressif/arduino-esp32#5868)
2. Add changelog.md
khoih-prog added a commit to khoih-prog/ESP32TimerInterrupt that referenced this issue Nov 14, 2021
### Releases v1.4.1

1. Avoid using D1 in examples due to issue with core v2.0.0 and v2.0.1. Check [ESP32 Core v2.0.1 / 2.0.1 RC1 crashes if using pinMode with GPIO1 #5868](espressif/arduino-esp32#5868)
2. Add changelog.md
khoih-prog added a commit to khoih-prog/ESP32TimerInterrupt that referenced this issue Nov 14, 2021
### Releases v1.4.1

1. Avoid using D1 in examples due to issue with core v2.0.0 and v2.0.1. Check [ESP32 Core v2.0.1 / 2.0.1 RC1 crashes if using pinMode with GPIO1 #5868](espressif/arduino-esp32#5868)
2. Add changelog.md
khoih-prog added a commit to khoih-prog/ESP32_New_TimerInterrupt that referenced this issue Nov 15, 2021
### Releases v1.0.1

1. Avoid using `PIN_D1 (GPIO1)` in your code due to issue with core v2.0.0 and v2.0.1. Check [ESP32 Core v2.0.1 / 2.0.1 RC1 crashes if using pinMode with GPIO1 #5868](espressif/arduino-esp32#5868). Only OK with core v1.0.6-
2. Don't use `float` in `ISR` due to issue with core v2.0.0 and v2.0.1. Only OK with core v1.0.6-.
3. Delete Blynk-related examples
4. Add changelog.md
@VojtechBartoska
Copy link
Contributor

Hello, is this still valid @khoih-prog?

GPIO was refactored in meantime, if yes, are you able to test this on v2.0.3-RC1?

@VojtechBartoska VojtechBartoska added Resolution: Awaiting response Waiting for response of author Area: Peripherals API Relates to peripheral's APIs. labels Apr 7, 2022
@khoih-prog
Copy link
Author

khoih-prog commented Apr 7, 2022

Hi @VojtechBartoska

Just retest on ESP32_DEV and still have crashes when using PIN_D1 and v2.0.3-RC1

No crash at all when testing with ESP32_S2, ESP32_S3 and ESP32_C3 using PIN_D1

@VojtechBartoska VojtechBartoska added Status: Needs investigation We need to do some research before taking next steps on this issue and removed Resolution: Awaiting response Waiting for response of author labels Apr 8, 2022
@P-R-O-C-H-Y
Copy link
Member

Hi @khoih-prog,
what board are you using with ESP32_DEV?

@P-R-O-C-H-Y
Copy link
Member

@khoih-prog
For ESP32 the Serial uses by default these pins:
UART0 RX pin 3
UART0 TX pin 1
Thats when you do pinMode on pin 1, the Serial no longer works.

@P-R-O-C-H-Y P-R-O-C-H-Y added Resolution: Awaiting response Waiting for response of author and removed Status: Needs investigation We need to do some research before taking next steps on this issue labels Apr 13, 2022
@khoih-prog
Copy link
Author

Hi @P-R-O-C-H-Y

Thanks for the clarification. So sorry, this is my weird and funny mistake. The board is still working, not crash at all. Just the Serial @ UART0 in not working.

Repository owner moved this from Todo to Done in Arduino ESP32 Core Project Roadmap Apr 13, 2022
@VojtechBartoska VojtechBartoska added Status: Solved and removed Resolution: Awaiting response Waiting for response of author labels Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Peripherals API Relates to peripheral's APIs. Status: Solved
Projects
Development

No branches or pull requests

4 participants