Skip to content

PWM is not atomic/sync with WFI and cleared clk_sys_pwm #561

Closed
@kolbma

Description

@kolbma

When sleeping with disabled clk_sys_pwm there is some undefined result for PWM-channels.
I set_duty(0) or disable() the channel before going to sleep, but sometimes the LEDs stay on the old duty, rare it is lighting with full power instead going off.
If I do about 2000 or more asm::nop() before wfi() the chance of occurrence is lower, but not gone.
With clk_sys_pwm-bit set, there is no problem.
When I interpret the datasheet correctly, there should be no problem with disabling pwm during sleep and reusing it afterwards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions