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

[TW#23301] When num_pin set to GPIO25, gpio bootloader_common_check_long_hold_gpio will not work proerly (IDFGH-4698) #2030

Closed
mashaoze opened this issue Jun 5, 2018 · 5 comments
Assignees

Comments

@mashaoze
Copy link

mashaoze commented Jun 5, 2018

When num_pin set to GPIO25, gpio bootloader_common_check_long_hold_gpio will not work proerly. this function always return GPIO_LONG_HOLD, event if the pin is not pull down. Because GPIO25 is also used by RTC and DAC/ADC, need set peripheral register in addition.

@bart112233
Copy link

bart112233 commented Jun 7, 2018

Pins 24,25,32-39 is not enabled on reset, so need to enable it. Something like:

#include "soc/io_mux_reg.h"**
...
esp_comm_gpio_hold_t bootloader_common_check_long_hold_gpio(uint32_t num_pin, uint32_t delay_sec)
{
       //-------------------------------------------------------------------------------------------------------
	const uint32_t disabled_io2[]={IO_MUX_GPIO32_REG, IO_MUX_GPIO33_REG, IO_MUX_GPIO34_REG, IO_MUX_GPIO35_REG, IO_MUX_GPIO36_REG, IO_MUX_GPIO37_REG, IO_MUX_GPIO38_REG, IO_MUX_GPIO39_REG};
	const uint32_t disabled_io1[]={IO_MUX_GPIO25_REG, IO_MUX_GPIO26_REG};
	switch (num_pin) {
		case 25 ... 26:
			PIN_INPUT_ENABLE(disabled_io1[num_pin-25]);
			break;
		case 32 ... 39:
			PIN_INPUT_ENABLE(disabled_io2[num_pin-32]);
			break;
		default:
			break;
	}
    //-------------------------------------------------------------------------------------------------------
    gpio_pad_select_gpio(num_pin);
    gpio_pad_pullup(num_pin);
    uint32_t tm_start = esp_log_early_timestamp();
    if (GPIO_INPUT_GET(num_pin) == 1) {
        return GPIO_NOT_HOLD;
    }
    do {
        if (GPIO_INPUT_GET(num_pin) != 0) {
            return GPIO_SHORT_HOLD;
        }
    } while (delay_sec > ((esp_log_early_timestamp() - tm_start) / 1000L));
    return GPIO_LONG_HOLD;
}

@Tanmayagarwal14

This comment has been minimized.

@xiongyumail

This comment has been minimized.

@Tanmayagarwal14

This comment has been minimized.

@xiongyumail

This comment has been minimized.

@FayeY FayeY closed this as completed Jun 12, 2018
@igrr igrr reopened this Jun 12, 2018
@igrr igrr added the Status: In Progress Work is in progress label Jun 12, 2018
@FayeY FayeY changed the title When num_pin set to GPIO25, gpio bootloader_common_check_long_hold_gpio will not work proerly [TW#23301] When num_pin set to GPIO25, gpio bootloader_common_check_long_hold_gpio will not work proerly Jun 12, 2018
@igrr igrr closed this as completed in 32da455 Jun 26, 2018
igrr pushed a commit that referenced this issue Jun 27, 2018
Fix factory_reset_pin init as input
Move definition a structure rtc_gpio_desc to soc

Closes #2030
@igrr igrr removed the Status: In Progress Work is in progress label Aug 4, 2018
catalinio pushed a commit to catalinio/pycom-esp-idf that referenced this issue Jun 28, 2019
Fix factory_reset_pin init as input
Move definition a structure rtc_gpio_desc to soc

Closes espressif/esp-idf#2030
catalinio pushed a commit to catalinio/pycom-esp-idf that referenced this issue Jun 28, 2019
Fix factory_reset_pin init as input
Move definition a structure rtc_gpio_desc to soc

Closes espressif/esp-idf#2030
@github-actions github-actions bot changed the title [TW#23301] When num_pin set to GPIO25, gpio bootloader_common_check_long_hold_gpio will not work proerly [TW#23301] When num_pin set to GPIO25, gpio bootloader_common_check_long_hold_gpio will not work proerly (IDFGH-4698) Feb 6, 2021
0xFEEDC0DE64 pushed a commit to 0xFEEDC0DE64/esp-idf that referenced this issue May 5, 2021
* adding d-duino-32 board/pins, fixes espressif#930

* remove OLED_RST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants