-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Output hold no longer working (GPIO32 as example) (IDFGH-2489) #4600
Comments
I expected this to pop up with the usual template, sorry. It is latest esp-idf as of today. I think this came in with some HAL stuff for the S2 changes. |
For background, I have a door lock controller. I use output hold on GPIO32 all the time, unlocking to change and holding again. This means that a reset or crash does not open the door while resetting, which is obviously useful for security. The current esp-idf means that the door does unlock whilst resetting as the hold function is not working, and as I got locked in, that suggests unhold does not work either. Using gpio_hold_en() and gpio_hold_dis() functions. Not using RTC/ULP modes at all. |
Old New |
Hi revk, I have test your issue, but not recurrence. Please let me know your case. void app_main(void)
{
gpio_config_t io_conf;
io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
io_conf.mode = GPIO_MODE_OUTPUT;
io_conf.pin_bit_mask = GPIO_SEL_32;
io_conf.pull_down_en = 0;
io_conf.pull_up_en = 0;
gpio_config(&io_conf);
gpio_hold_en(GPIO_NUM_32);
while(1)
{
gpio_set_level(GPIO_NUM_32, 1);
vTaskDelay(1000/portTICK_PERIOD_MS);
gpio_set_level(GPIO_NUM_32, 0);
vTaskDelay(1000/portTICK_PERIOD_MS);
printf("change io status\n");
}
} |
Thank you for testing - It definitely locked me in, honest :-) |
Theory: old function was using hold but the new function is using hold_force so if hold was set then update firmware and soft reboot, hold is still applied the new code would try to unset hold_force and hold would stay enabled until you hard reboot.
Must also have to do with the difference between hold and hold_force |
OK, call me thick (and I have read the data sheets, honest) but what's the difference between hold and hold-force? |
@negativekelvin @revk Thanks for your mention. |
Ah, nice solution. Thank you. |
Well they aren't exactly the same, supposedly hold_force works with RTC_PERIPH domain powered off but hold doesn't? It doesn't really explain why the new sdk would not hold through a reboot and old does if that is what @revk is seeing. |
I held on old code, and rebooted, and found that while new code was running the pin was still held. If we have changed which is set, and they "or", that makes perfect sense. It suggests new code will work find for me, just the transition from old to knew got me locked in :-) |
Though if they do behave differently, maybe we should have separate calls? |
Yes, there are cases where someone may not want to hold_force |
I am using output hold, and now on latest IDF I find it no longer works. This meant after a s/w update I was locked in my office as the output hold on the lock before the update was not unlocked to open the door! Fun. I had to power cycle!
Anyway it seems hold and unhold functions on at least GPIO32 no longer work.
The text was updated successfully, but these errors were encountered: