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

Deep Sleep Example Fix #9904

Merged
merged 4 commits into from
Jun 19, 2024
Merged

Deep Sleep Example Fix #9904

merged 4 commits into from
Jun 19, 2024

Conversation

SuGlider
Copy link
Collaborator

Description of Change

IDF 5.1 has changed the way how RTC IO shall be configured in order to make it work as Wakeup source.
This PR fixes the example to work within Arduino Core 3.0.x that uses IDF 5.1.

Tests scenarios

Using ESP32 + the example provided. Tested using EXT0 and EXT1.

Related links

Closes #9809

Fixes the Deep Sleep wakup example to run with IDF5.1. The API has changed and a adjustment was necessary.
Changed the example to use a #define for the RTC IO Pin (GPIO) used in the example.
@SuGlider SuGlider added the Type: Example Issue is related to specific example. label Jun 19, 2024
@SuGlider SuGlider added this to the 3.0.2 milestone Jun 19, 2024
@SuGlider SuGlider self-assigned this Jun 19, 2024
Copy link
Contributor

github-actions bot commented Jun 19, 2024

Test Results

 56 files   56 suites   5m 18s ⏱️
 21 tests  21 ✅ 0 💤 0 ❌
135 runs  135 ✅ 0 💤 0 ❌

Results for commit d367d39.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Jun 19, 2024

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "fix(example): EXT0 and EXT1 wakeup":
    • body's lines must not be longer than 100 characters

Please fix these commit messages - here are some basic tips:

  • follow Conventional Commits style
  • correct format of commit message should be: <type/action>(<scope/component>): <summary>, for example fix(esp32): Fixed startup timeout issue
  • allowed types are: change,ci,docs,feat,fix,refactor,remove,revert,test
  • sufficiently descriptive message summary should be between 20 to 72 characters and start with upper case letter
  • avoid Jira references in commit messages (unavailable/irrelevant for our customers)

TIP: Install pre-commit hooks and run this check when committing (uses the Conventional Precommit Linter).

Messages
📖 You might consider squashing your 4 commits (simplifying branch history).

👋 Hello SuGlider, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- Addressing info messages (📖) is strongly recommended; they're less critical but valuable.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against d367d39

Fixes the commentary to the correct IDF terms.
Copy link
Contributor

Memory usage test (comparing PR against master branch)

The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32S30⚠️ +3680.00⚠️ +0.13000.000.00
ESP32S20⚠️ +3200.00⚠️ +0.12000.000.00
ESP320⚠️ +120.000.00000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32S3ESP32S2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAM
ESP32/examples/DeepSleep/ExternalWakeUp⚠️ +3680⚠️ +3200⚠️ +120

@SuGlider SuGlider mentioned this pull request Jun 19, 2024
1 task
@me-no-dev me-no-dev added the Status: Pending Merge Pull Request is ready to be merged label Jun 19, 2024
@me-no-dev me-no-dev merged commit 206c0c7 into master Jun 19, 2024
39 checks passed
@me-no-dev me-no-dev deleted the deepsleep branch June 19, 2024 16:19
@pfeerick
Copy link
Contributor

pfeerick commented Jul 18, 2024

Is that actually correct?

With ESP-IDF 5.0.4, it is still esp_sleep_enable_ext1_wakeup()

With ESP-IDF 5.1.4, it is still esp_sleep_enable_ext1_wakeup()

Whereas ESP-IDF 5.2.x introduces esp_sleep_enable_ext1_wakeup_io(), but esp_sleep_enable_ext1_wakeup() is nonetheless still present, but with a depreciation notice for v6. This is also the case for the "release-v5.1" documentation.

@SuGlider
Copy link
Collaborator Author

SuGlider commented Aug 2, 2024

Arduino 3.0.x is based on IDF 5.1.x exclusively.
No support for IDF 5.0.x or 5.2.x.

@pfeerick
Copy link
Contributor

pfeerick commented Aug 2, 2024

Exactly... which is why this PR seems incorrect... 🤦 it is using 5.2.x syntax, not 5.1.x syntax. esp_sleep_enable_ext1_wakeup_io() is not correct for 5.1, hence my comment.

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

Exactly... which is why this PR seems incorrect... 🤦 it is using 5.2.x syntax, not 5.1.x syntax. esp_sleep_enable_ext1_wakeup_io() is not correct for 5.1, hence my comment.

@pfeerick Take a look at the IDF docs, where esp_sleep_enable_ext1_wakeup_io() is already available for release/v5.1.

@pfeerick
Copy link
Contributor

pfeerick commented Aug 2, 2024

Ok, thanks for pointing that out. Any idea what is actually different between the two, as I was expecting 5.1.4 to be the latest release for 5.1, not this release/v5.1. What is the release structure here?

@SuGlider
Copy link
Collaborator Author

SuGlider commented Aug 2, 2024

Maybe the documentation for 5.1.4 is incomplete.
5.1 is the major and latest version, which also is, at this time, 5.1.4.
Arduino Core 3.0.0 .. 3.0.4 are all based on IDF 5.1.4.

@pfeerick
Copy link
Contributor

pfeerick commented Aug 3, 2024

Ok, I see the problem I think... 5.1.4 was released 3 months ago... whereas this is relying on changes made to 5.1 branch since then which haven't made it to a tagged release. I was clearly mistaken expecting the changes made here to be based on a tagged release, not a moving target release branch 😢 This all started as I was trying to build using actual 5.1.4, and the compiler said no. The documentation is correct, simply 5.1.4 is the wrong version! 😆

i.e. tagged 5.1.4
image

vs release/5.1 (which displays as 5.1.4 since the version number hasn't been bumped)
image
image

@SuGlider
Copy link
Collaborator Author

SuGlider commented Aug 3, 2024

Thanks @pfeerick for and investigation. I guess we can keep the PR. Please let me know if you have any other disagreement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Merge Pull Request is ready to be merged Type: Example Issue is related to specific example.
Projects
Development

Successfully merging this pull request may close these issues.

External wake up ext1 problem
5 participants