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

RMT with Power Management and Dynamic Frequency Scaling enabled screws up data transfer (IDFGH-11122) #12292

Closed
3 tasks done
aircable opened this issue Sep 22, 2023 · 1 comment
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@aircable
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

master 5.2.2

Operating System used.

Windows

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

Development Kit.

ESP32-S3-PICO-1

Power Supply used.

External 3.3V

What is the expected behavior?

I'm working with the standard example/peripherals/rmt/led-stript
My goal is to have power management and dynamic frequency scaling enabled and still have a correct RMT data transfer.

What is the actual behavior?

But when I enable PM and DFS, the example does not work anymore.
I mean, the lights are flickering, but in a bad way and not intended. Addressing single LEDs is no longer correct.
It looks to me that the bits are mangled, even trying to address a single LED shows up at two LEDs.

I know that RMT is dependent on the frequency when using the APB as a clock source.
I added power management locks to the code:

    esp_pm_lock_create( ESP_PM_APB_FREQ_MAX, 0, "my_rmt_apb_lock", &hd );
    esp_pm_lock_acquire( hd );
...
    esp_pm_lock_release(hd);

Even changed the APB to the XTAL as clock source. No change.
When both PM and DFS is enabled, RMT does no longer work correctly.

Steps to reproduce.

1: create a file sdkconfig.defaults with the following content:

CONFIG_IDF_TARGET="esp32s3"
CONFIG_PM_ENABLE=y
CONFIG_PM_DFS_INIT_AUTO=y

2: change clock source

        .clk_src = RMT_CLK_SRC_XTAL, // select source clock

Or put some power management locks around the code.
3: observe

Debug Logs.

no error logs, no faults
just wrongly flickering lights

More Information.

switching off DFS makes it work correctly

@aircable aircable added the Type: Bug bugs in IDF label Sep 22, 2023
@espressif-bot espressif-bot added the Status: Opened Issue is new label Sep 22, 2023
@github-actions github-actions bot changed the title RMT with Power Management and Dynamic Frequency Scaling enabled screws up data transfer RMT with Power Management and Dynamic Frequency Scaling enabled screws up data transfer (IDFGH-11122) Sep 22, 2023
@suda-morris
Copy link
Collaborator

suda-morris commented Sep 25, 2023

@aircable Thanks for reporting. The RMT driver doesn't require the user to allocate an extra PM lock. The driver can handle the lock acquire and release in rmt_enable and rmt_disable.

Could you test if you set the clock source to e.g. a "default" one " .clk_src = RMT_CLK_SRC_DEFAULT, like what we did in the unit test. In fact we have the DFS enabled in our CI test: https://github.com/espressif/esp-idf/blob/master/components/driver/test_apps/rmt/sdkconfig.ci.release#L3

I'm guessing the issue may be related the XTAL clock source, and we're using the wrong PM lock type internally.

@espressif-bot espressif-bot added Status: In Progress Work is in progress Status: Reviewing Issue is being reviewed Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new Status: In Progress Work is in progress Status: Reviewing Issue is being reviewed labels Sep 26, 2023
espressif-bot pushed a commit that referenced this issue Sep 30, 2023
espressif-bot pushed a commit that referenced this issue Oct 13, 2023
movsb pushed a commit to movsb/esp-idf that referenced this issue Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

5 participants