gpio_hal_output_enable() crashing when pin not physically connected

william.ferguson.au
Posts: 107
Joined: Wed Jan 02, 2019 8:55 am

gpio_hal_output_enable() crashing when pin not physically connected

Postby william.ferguson.au » Sat Jul 02, 2022 3:04 am

We are using a small 1" OLED with our ESP32.
When all pins for the OLED have a solid connection then the OLED works as expected.

If the power pin for the OLED for the OLED is not connected then gpio_hal_output_enable() for that pin crashes on startup with no further info.
called from gpio_output_enable(io_num)
from gpio_config(config)


I don't expect the OLED to work when the power pin is disconnected (that's clearly a manufacturing error), but I would like to able to get an error so that we are able to report or handle this scenario instead causing repetitive crashes drain the battery and are otherwise unfathomable to the user.

Is there some was to test when the pin is connected before trying to configure it?

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: gpio_hal_output_enable() crashing when pin not physically connected

Postby ESP_Sprite » Sat Jul 02, 2022 8:46 am

That is not an error that is supposed to happen; changing the mode of a pin that supports that and isn't e.g. connected to flash shoould not crash the system, connected or not. Do you have some more information: what module/chip, what GPIO are you using, what is output during the crash, can you share a schematic?

Who is online

Users browsing this forum: zelenecul and 130 guests