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

cpu/esp32: fix dependency for periph/rtt and module esp_rtc_timer_32k #18334

Conversation

gschorcht
Copy link
Contributor

@gschorcht gschorcht commented Jul 20, 2022

Contribution description

This PR is a split-off from PR #17844, which provides a fix of module dependency for periph_rtt.

If the ESP32 has an external 32k crystal connected, the clock from this crystal should be used for the RTT peripheral and not only for the RTC peripheral. Since the ESP32 RTC implementation uses RTT on top of RTT (module rtc_rtt), with this change the 32k crystal will be used for both RTT and RTC if present.

Testing procedure

  1. Use command:

    BOARD=esp32-wrover-kit make -j8 -C tests/periph_rtt info-modules | grep esp_rtc_timer_32k
    BOARD=esp32-wroom-32 make -j8 -C tests/periph_rtt info-modules | grep esp_rtc_timer_32k
    

    Module esp_rtc_timer_32k is used for board esp32-wrover-kit but not for board esp32-wroom-32 with this PR. Without this PR it is not used at all.

  2. Use command:

    TEST_KCONFIG=1 BOARD=esp32-wrover-kit make -j8 -C tests/periph_rtc info-modules | grep esp_rtc_timer_32k
    TEST_KCONFIG=1 BOARD=esp32-wroom-32 make -j8 -C tests/periph_rtc info-modules | grep esp_rtc_timer_32k
    

    Module esp_rtc_timer_32k is used for board esp32-wrover-kit but not for board esp32-wroom-32 with this PR. Without this PR it is not used at all.

  3. Use command:

    BOARD=esp32-wrover-kit make -j8 -C tests/periph_rtc info-modules | grep esp_rtc_timer_32k
    BOARD=esp32-wroom-32 make -j8 -C tests/periph_rtc info-modules | grep esp_rtc_timer_32k
    

    Module esp_rtc_timer_32k is still used for board esp32-wrover-kit but not for board esp32-wroom-32 with this PR.

  4. Compile and flash tests/periph_rtt for any ESP32 board that has connected an external 32k crystal:

    BOARD=esp32-wrover-kit make -j8 -C tests/periph_rtc flash term
    

    The test should still work with this change.

Issues/PRs references

Split-off from PR #17844

@github-actions github-actions bot added Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration Platform: ESP Platform: This PR/issue effects ESP-based platforms labels Jul 20, 2022
@gschorcht gschorcht changed the title cpu/esp32: fix dependency for module esp_rtc_timer_32k cpu/esp32: fix dependency for periph/rtt and module esp_rtc_timer_32k Jul 20, 2022
@gschorcht gschorcht added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jul 20, 2022
@benpicco benpicco enabled auto-merge July 20, 2022 08:52
@benpicco benpicco merged commit 8cc31c2 into RIOT-OS:master Jul 20, 2022
@gschorcht
Copy link
Contributor Author

@benpicco Thanks for reviewing and merging.

@gschorcht gschorcht deleted the cpu/esp32/fix_periph_rtt_32k_crystal_module_dependeny branch July 20, 2022 15:43
@maribu maribu added this to the Release 2022.10 milestone Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants