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

Add ability to define RMT channel #294

Open
gmint opened this issue Dec 2, 2024 · 7 comments
Open

Add ability to define RMT channel #294

gmint opened this issue Dec 2, 2024 · 7 comments

Comments

@gmint
Copy link

gmint commented Dec 2, 2024

Would you consider adding the ability to specifically define the RMT channel used on ESP32 or is this even possible?

My use case is as follows: I am using FastLED in conjunction with FastAccelStepper and although I should have enough RMT channels (i.e. four) on my ESP32-C6 to drive a small number of LEDs and one stepper motor, I am experiencing a condition where FastAccelStepper is unable to find sufficient TX channels even when I restrict FastLED to one RMT channel. Here is the error I am receiving:

16:01:41.268 -> E (4980) rmt: rmt_tx_register_to_group(152): no free tx channels
16:01:41.268 -> E (4980) rmt: rmt_new_tx_channel(288): register channel failed

I am currently able to workaround this by switching to LEDC but given the robustness of this library, it seems like something that might not be out of the question. Thank you for your consideration.

@gin66
Copy link
Owner

gin66 commented Dec 4, 2024

Thanks for the proposal and your compliment about the robustness of FastAccelStepper.

Good news is, that with espidf 5.x the rmt channel assignment is managed by espressif and FastAccelStepper supports >=5.3

espidf5 restricts direct access to the hw module and control of the channel is not possible. This means the proposed change would be limited to espidf4 versions. This older rmt driver hijacks the module interrupt, because there is no Interrupt service handler. This means cooperative sharing the rmt module with other libs is complex. In addition, there are three versions of rmt-drivers for the different esp32 derivates. As a result, I do not see this as a worthwhile endeavor.

Just I am puzzled about the error message with rmt_new_tx_channel(288). If this is caused by FastAccelStepper, then this would indicate, you are using the espidf5 versions. Hope you can further elaborate on the versions in use.

@gmint
Copy link
Author

gmint commented Dec 4, 2024 via email

@gin66
Copy link
Owner

gin66 commented Dec 5, 2024

Do you configure mem_block_symbols!=0 in led_strip_rmt_config_t of FastLED ? Perhaps FastLED uses all rmt memory ?

@gin66
Copy link
Owner

gin66 commented Dec 5, 2024

FastLED/FastLED#1768 related ?

@gin66
Copy link
Owner

gin66 commented Dec 5, 2024

Funny is, neither FastAccelStepper nor FastLED uses rmt_tx_register_to_group, but this is the first error…..
Question is, why espidf5 uses this ?

@gmint
Copy link
Author

gmint commented Dec 5, 2024 via email

@gmint
Copy link
Author

gmint commented Dec 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants