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

ESP32C6 ROM Bootloader resets PMU_TIE_HIGH_HP_PAD_HOLD_ALL upon boot (IDFGH-12130) #13186

Closed
2 tasks done
t-moe opened this issue Feb 15, 2024 · 5 comments
Closed
2 tasks done
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@t-moe
Copy link

t-moe commented Feb 15, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

I'm on the esp32c6 and I want to keep the output state of a GPIO pin low during deep sleep.

  • First the output in question (e.g. gpio22) is set low.
  • Then, before entering deep sleep, I set the PMU_TIE_HIGH_HP_PAD_HOLD_ALL flag to 1.
  • I enter deep sleep (with wakeup source of some other lpio gpio e.g. gpio0)
  • During deep sleep the pin (gpio22) indeed hold its state (low)
  • After wakeup (e.g. with IO interrupt) the pin immediately turns to high, as soon as the ROM bootloader starts.

I've used the esp32 rust driver, but I think it is a ROM bug, because the part up and including sleeping works as expected.

Can you advise here?

@espressif-bot espressif-bot added the Status: Opened Issue is new label Feb 15, 2024
@github-actions github-actions bot changed the title ESP32C6 ROM Bootloader resets PMU_TIE_HIGH_HP_PAD_HOLD_ALL upon boot ESP32C6 ROM Bootloader resets PMU_TIE_HIGH_HP_PAD_HOLD_ALL upon boot (IDFGH-12130) Feb 15, 2024
@esp-wzh
Copy link
Collaborator

esp-wzh commented Feb 20, 2024

Thank you @t-moe for reporting this problem, I think this problem should exist on all esp chips, the reason to unhold all IOs in ROM boot is to avoid that the IOs of key system peripherals such as SPI /UART are held before reset making it impossible continue to run the flash boot.

Currently, if you want to avoid this wrong signal, you can use LP_IOs, which on esp32c6 are GPIO0~7, they don't lose configuration during deepsleep, so there is no pulse signal even if they unhold. Refer https://github.com/espressif/esp-idf/blob/master/components/esp_driver_gpio/include/driver/rtc_io.h

We are evaluating the reasonableness of this requirement, I'll update in this thread if there's any progress

@t-moe
Copy link
Author

t-moe commented Feb 20, 2024

Hi @esp-wzh,
Thanks for your response.

We also found that we can successfully hold a GPIO8..GPIO30 if we set the corresponding LP_AON_GPIO_HOLD0_REG[n] bit. This seems to work with the current ROM. This probably works in our case, as a workaround. I hope this continues to work and you dont extend the ROM in future versions to also unhold this upon boot.

Regarding the initial problem:
I understand the reasoning behind the current ROM implementation, but I would expect that the technical reference manual contains a warning near the PMU_TIE_HIGH_HP_PAD_HOLD_ALL documentation. Can you add this? Also, is the "Hold all" esp32c6 specific?

Thank you

@esp-wzh
Copy link
Collaborator

esp-wzh commented Feb 20, 2024

@t-moe I figured it out! the hold en signal for gpio[n] is arbitrated out by the following logic,
image

so there is no problem with the ROM, I have suggested to documentation colleague to add a description in this section, thanks for your feedback!

@t-moe
Copy link
Author

t-moe commented Feb 20, 2024

Not sure we're talking about the same thing here. Here is what I tried to communicate:

  • My initial bug report mentioned that the "global hold all" is cleared by the rom (by setting PMU_TIE_LOW_HP_PAD_HOLD_ALL ?). I think this is still the case (?), and should be documented in the reference manual.

  • But yes, not setting the "global hold" and only setting the individual hold (LP_AON_GPIO_HOLD0_REG[n]) works and the rom bootloader does not reset the individual holds.

@esp-wzh
Copy link
Collaborator

esp-wzh commented Feb 21, 2024

Got it, we will add these two notes to the document.

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new labels Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

3 participants