Skip to content

drivers: counter: fix counter node in esp32 timers #90819

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

Conversation

joelguittet
Copy link
Contributor

@joelguittet joelguittet commented May 29, 2025

Fix counter device tree node to the esp32 timers.

@sylvioalves I have tested samples/drivers/counter/alarm:

*** Booting Zephyr OS build v4.1.0-4914-g7a4f824bae00 ***
Counter alarm sample
Set alarm in 2 sec (80000000 ticks)
!!! Alarm !!!
Now: 2
Set alarm in 4 sec (160000000 ticks)

(the 4 seconds alarm is not working but it was also the case before my modification, so it's not a regression).

And tests/drivers/counter/counter_basic_api:

TESTSUITE counter_no_callback succeeded
------ TESTSUITE SUMMARY START ------
SUITE PASS - 100.00% [counter_basic]: pass = 9, fail = 0, skip = 1, total = 10 duration = 2.177 seconds
 - PASS - [counter_basic.test_all_channels] duration = 0.131 seconds
 - PASS - [counter_basic.test_cancelled_alarm_does_not_expire] duration = 0.979 seconds
 - PASS - [counter_basic.test_late_alarm] duration = 0.102 seconds
 - PASS - [counter_basic.test_late_alarm_error] duration = 0.102 seconds
 - SKIP - [counter_basic.test_multiple_alarms] duration = 0.102 seconds
 - PASS - [counter_basic.test_set_top_value_with_alarm] duration = 0.211 seconds
 - PASS - [counter_basic.test_short_relative_alarm] duration = 0.103 seconds
 - PASS - [counter_basic.test_single_shot_alarm_notop] duration = 0.172 seconds
 - PASS - [counter_basic.test_single_shot_alarm_top] duration = 0.172 seconds
 - PASS - [counter_basic.test_valid_function_without_alarm] duration = 0.103 seconds

SUITE PASS - 100.00% [counter_no_callback]: pass = 1, fail = 0, skip = 0, total = 1 duration = 0.106 seconds
 - PASS - [counter_no_callback.test_set_top_value_without_alarm] duration = 0.106 seconds
------ TESTSUITE SUMMARY END ------

But of course if you can get your feedback on the modifications I will appreciate, or even if you can run in your pipelines ?

@sylvioalves
Copy link
Collaborator

sylvioalves commented May 29, 2025

Ok, as you provided the fix here, I guess we don't need to revert it. The only diff is the updated overlays?
@joelguittet I'll close that PR. Can you update this and submit as "fix" instead?

Regarding your comment about the 4s alarm issue, the fix is here #90817

@joelguittet
Copy link
Contributor Author

As you prefer. Yes, the overlay and also the #define TIMER in the main.c of the sample.
Do you confirm this was the expected modification to get it working ?
If yes I can also just transform this new PR to a fix by rebasing on top of main branch

@sylvioalves
Copy link
Collaborator

As you prefer. Yes, the overlay and also the #define TIMER in the main.c of the sample. Do you confirm this was the expected modification to get it working ? If yes I can also just transform this new PR to a fix by rebasing on top of main branch

Sure, update it with the new diff only. I'll run in internal CI to make sure it is all working as well. Thanks for fixing it.

@joelguittet joelguittet force-pushed the drivers/add-counter-entries-to-esp32-timer-2 branch from d191644 to 0a58e5e Compare May 29, 2025 21:08
@joelguittet joelguittet changed the title drivers: counter: introduce counter node in esp32 timers drivers: counter: fix counter node in esp32 timers May 29, 2025
@joelguittet
Copy link
Contributor Author

Done, ready for review. And sorry for disturbance.

@sylvioalves
Copy link
Collaborator

Done, ready for review. And sorry for disturbance.

No disturbance at all. Would you mind adding esp32c6_hpcore.overlay in the samples folder as well?

Fix counter device tree node of the esp32 timers in the counter sample
and test app.

Signed-off-by: Joel Guittet <[email protected]>
@joelguittet joelguittet force-pushed the drivers/add-counter-entries-to-esp32-timer-2 branch from 0a58e5e to 5f0ef01 Compare May 29, 2025 22:15
@joelguittet
Copy link
Contributor Author

Sure. Added.

Copy link

Copy link
Collaborator

@sylvioalves sylvioalves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fully tested, all working.

@sylvioalves sylvioalves self-assigned this Jun 2, 2025
@nashif nashif merged commit 05f71f3 into zephyrproject-rtos:main Jun 3, 2025
21 checks passed
@joelguittet joelguittet deleted the drivers/add-counter-entries-to-esp32-timer-2 branch June 3, 2025 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Counter area: RISCV RISCV Architecture (32-bit & 64-bit) area: Samples Samples area: Xtensa Xtensa Architecture platform: ESP32 Espressif ESP32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants