-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Ledc driver bug, after fast switching between 0% and 100% duty with fade, the leds stays on (IDFGH-4918) #6710
Comments
Thanks for the very detailed report and sorry for the inconvenience, we will look into. |
Hey, what is your progress? @Alvin1Zhang Thanks in advance. |
@mvarchdev Thanks for reporting and sorry for the slow turnaround. Thanks for being patient, we had a fix under internal reviewing. The issue will be closed automatically once the fix is available on GitHub. Thanks. |
Hello. How is the fix going on? Thanks in advance. |
Add test cases for fade concurrency issue and fade timing check. Closes espressif#6710
Add test cases for fade concurrency issue and fade timing check. Closes espressif#6710
Add test cases for fade concurrency issue and fade timing check. Closes espressif#6710 cherry-pick be2ab09 Conflicts: components/driver/ledc.c
Environment
Problem Description
I am working on a project, something like smart home, just school project... I created IFTTT (If this then this) mechanism where conditions can be added while running. There is one loop checking if something was changed (button high, etc...), I added ledc to make led bars easily controllable with it. gpio_set_level works fine, and ledc_set_fade_with_time with low click frequency too, but as soon as I start clicking faster, the ledc_set_fade_with_time bugs, and some leds will stay on. (The main function is just from duty 0% to 100%, then inverted after button click (100% to 0%) and so on). The debug output showing some weird things, like there would be actual duty 10000 and more. You will see in the videos:
First: VIDEO1
Second: VIDEO2
Can you please help me?
Here is debug log with ledc:
NORMAL
D (00:00:30.093) ledc: cur duty: 0; target: 2047, step: 1023, cycle: 1; scale: 1; dir: 1
D (00:00:31.061) ledc: cur duty: 2047; target: 0, step: 1023, cycle: 1; scale: 1; dir: 0
D (00:00:31.062) ledc: cur duty: 0; target: 2047, step: 1023, cycle: 1; scale: 1; dir: 1
D (00:00:31.985) ledc: cur duty: 2047; target: 0, step: 1023, cycle: 1; scale: 1; dir: 0
D (00:00:31.986) ledc: cur duty: 0; target: 2047, step: 1023, cycle: 1; scale: 1; dir: 1
D (00:00:32.975) ledc: cur duty: 2047; target: 0, step: 1023, cycle: 1; scale: 1; dir: 0
D (00:00:32.976) ledc: cur duty: 0; target: 2047, step: 1023, cycle: 1; scale: 1; dir: 1
D (00:00:33.415) ledc: cur duty: 0; target: 2047, step: 1023, cycle: 1; scale: 1; dir: 1
GLITCHED
D (00:00:41.912) ledc: cur duty: 9587; target: 2047, step: 1023, cycle: 1; scale: 1; dir: 0
D (00:00:42.034) ledc: cur duty: 9098; target: 0, step: 1023, cycle: 1; scale: 2; dir: 0
D (00:00:42.035) ledc: cur duty: 291; target: 2047, step: 1023, cycle: 2; scale: 1; dir: 1
D (00:00:42.158) ledc: cur duty: 291; target: 0, step: 291, cycle: 13; scale: 1; dir: 0
D (00:00:42.159) ledc: cur duty: 193; target: 2047, step: 1023, cycle: 2; scale: 1; dir: 1
D (00:00:42.264) ledc: cur duty: 507; target: 2047, step: 1023, cycle: 2; scale: 1; dir: 1
D (00:00:42.265) ledc: cur duty: 193; target: 0, step: 193, cycle: 20; scale: 1; dir: 0
D (00:00:42.403) ledc: cur duty: 783; target: 0, step: 783, cycle: 5; scale: 1; dir: 0
D (00:00:42.404) ledc: cur duty: 10243; target: 2047, step: 1023, cycle: 1; scale: 2; dir: 0
D (00:00:42.509) ledc: cur duty: 9399; target: 0, step: 1023, cycle: 1; scale: 2; dir: 0
D (00:00:42.510) ledc: cur duty: 224; target: 2047, step: 1023, cycle: 2; scale: 1; dir: 1
D (00:00:42.633) ledc: cur duty: 224; target: 0, step: 224, cycle: 17; scale: 1; dir: 0
D (00:00:42.634) ledc: cur duty: 149; target: 2047, step: 1023, cycle: 2; scale: 1; dir: 1
D (00:00:42.754) ledc: cur duty: 502; target: 2047, step: 1023, cycle: 2; scale: 1; dir: 1
D (00:00:42.756) ledc: cur duty: 149; target: 0, step: 149, cycle: 26; scale: 1; dir: 0
V (00:00:42.892) esp_adapter: thread sem get: sem=0x3ffccb50
D (00:00:43.111) ledc: cur duty: 705; target: 0, step: 705, cycle: 5; scale: 1; dir: 0
D (00:00:43.112) ledc: cur duty: 8680; target: 2047, step: 1023, cycle: 1; scale: 1; dir: 0
D (00:00:43.234) ledc: cur duty: 8191; target: 0, step: 1023, cycle: 1; scale: 2; dir: 0
D (00:00:43.235) ledc: cur duty: 114; target: 2047, step: 1023, cycle: 2; scale: 1; dir: 1
I tried to create similiar code because i do not want to post here my work, so here it is - same problem, try. Thanks for help.
Expected Behavior
It should create something like snake following leds (fade on, fade off when clicked button, in this sequence: gpio 17,16,4,0)
Actual Behavior
It is doing its work, but after switching and clicking button faster, it glitches and leds stays on (video)
Steps to reproduce
Code to reproduce this issue
The text was updated successfully, but these errors were encountered: