Skip to content

drivers: counter: esp32: expose autoreload via dts #92839

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

Closed
wants to merge 1 commit into from

Conversation

ain101
Copy link

@ain101 ain101 commented Jul 8, 2025

In my usecase counter_set_channel_alarm() stopped working after 100 seconds. (1ms period callback)
Using the autoreload feature fixes all my problems.

Copy link

github-actions bot commented Jul 8, 2025

Hello @ain101, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@ain101 ain101 force-pushed the expose_autoreload branch 4 times, most recently from fa17a23 to c06185e Compare July 8, 2025 16:39
@ain101
Copy link
Author

ain101 commented Jul 8, 2025

Maybe autoreload should be enabled per default.
But I am unsure.
Do other counter implementations also stop working after some time (depending on prescaler)?

After some time esp32 timer finishes and then stops. Autoreload starts
the timer again automatically.

Signed-off-by: Frederik Wenigwieser <[email protected]>
@ain101 ain101 force-pushed the expose_autoreload branch from c06185e to bfd1dbe Compare July 10, 2025 08:17
@ain101
Copy link
Author

ain101 commented Jul 10, 2025

fix "Commit message body is empty"

Copy link

@ain101 ain101 requested a review from raffarost July 10, 2025 10:55
@ain101
Copy link
Author

ain101 commented Jul 10, 2025

@raffarost To me everything looks fine now.
Can you have another look?

@raffarost
Copy link

hi @ain101
can you share a piece of code that reproduces what you are seeing, so we understand the condition a bit better?
also, have you tried using counter_set_top_value instead?

@ain101
Copy link
Author

ain101 commented Jul 11, 2025

@raffarost it happens in the sample:
https://github.com/ain101/zephyr/blob/only_counter_timer/samples/drivers/counter/alarm/src/main.c
west build --pristine -b esp32c3_devkitc ./samples/drivers/counter/alarm

test_counter_interrupt_fn() is not called after ~100seconds

counter_set_top_value() does not fix my issues. main.c

@raffarost
Copy link

@ain101 would you mind checking if these changes fix your issues? #93538

@ain101
Copy link
Author

ain101 commented Jul 23, 2025

@raffarost yes, #93538 ec4da38 fixes all my issues.
If #93538 gets merged then I do not need my changes merged (#92839)

@raffarost
Copy link

@ain101 I opened the PR for review, so you can close yours. Thank you

@ain101 ain101 closed this Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants