gin66 / FastAccelStepper

A high speed stepper library for Atmega 168/328p (nano), Atmega32u4, Atmega 2560, ESP32, ESP32S2, ESP32S3, ESP32C3, ESP32C6 and Atmel SAM Due
MIT License
299 stars 69 forks source link

Incompatibility with the version 3.0.4 of the Arduino IDE ESP32 support #275

Closed emc3las closed 1 week ago

emc3las commented 1 month ago

To compile a sketch using DOIT ESP32 DEVKIT V1 board and FastAccelStepper I reverted to the version 2.0.17 of the ESP32 Arduino Core (using the Board Manager available at the left tools column - it is the second tool, immediately under the Sketchbook Folder - in the Arduino IDE).

Tobi90as commented 1 month ago

Is this the only solution for the incompatibility issue with the 3.x Version? Is there any solution in sight to make this library compatible with ESP Platform Version 3.x? I would really appreciate it, if I could use this library in the future as well, as it is by far the most advanced library for high speed stepper control on an ESP32.

gin66 commented 1 month ago

@emc3las That‘s great solution. Thanks for this

@Tobi90as issue #261 is dealing with the v3.x incompatibility.

Tobi90as commented 1 month ago

Thanks for your quick reply and your great work on this library. I'm not sure if I understand correctly, but can we assume that there will be support for ESP32 platform version 3.x in the future? That would be great to know as I can easily work around with the downgrade solution for now. But if there are no plans to support the board version 3.x, I would know that I need to keep my eyes open for a possible alternative (I am not aware of any with comparable performance). I guess if I subscribe to issue #261 I'll be notified if there's any development, right?

gin66 commented 1 month ago

There are no immediate plans to address the incompatibility introduced by espressif 3.x, because I am currently not able to spend the needed days for the rewrite of rmt and mcpwm/pcnt-modules. Eventually I will do this, but I cannot predict when this will be.

Great would be, if someone provides a PR.

Tobi90as commented 1 month ago

Thank you very much for the quick response. I can totally understand that. I'm afraid I can't make a real contribution, because unfortunately this is far beyond my level of understanding. I'm already happy if I can realise a few small projects with the help of great libraries like this one. But maybe someone else will feel able to help out here.

astorun commented 3 weeks ago

i really appreciate if this library is ported to v3.x in a timely manner since my project mostly depends on this library and arduino core v3!

gin66 commented 2 weeks ago

I have now implemented support for esp-idf 5.3.0 (barely tested, but works with simple example) and only rmt with pulse counter support. no mcpwm/pcnt combo. esp-idf up to 5.2.x will not work. Now it is up to espressif/arduino to update to 5.3.0 as the v3.0.4 uses esp-idf 5.1 And no, I will not downgrade to support esp-idf 5.1/5.2.

astorun commented 2 weeks ago

I have now implemented support for esp-idf 5.3.0 (barely tested, but works with simple example) and only rmt with pulse counter support. no mcpwm/pcnt combo. esp-idf up to 5.2.x will not work. Now it is up to espressif/arduino to update to 5.3.0 as the v3.0.4 uses esp-idf 5.1 And no, I will not downgrade to support esp-idf 5.1/5.2.

That complicates things, at least on my case. Any specific reason why is it limited with 5.3.0? I am using esp-idf and arduino via https://github.com/pioarduino/platform-espressif32 and currently it is only supported up to 5.1.4 idf version.

Regardless, thanks for the update.

gin66 commented 2 weeks ago

the new rmt support prevents access to the rmt interrupts, so the whole scheme has to be adapted to the espressif opinionated way of their driver. Now an encoder is needed, which translates into the needed input for the rmt module and there are few choices, thereof only one is reasonable. That encoder is created by rmt_new_simple_encoder() and this function is not available in older idf releases.

Actually I have started to write an own encoder, because from the docs it has seemed, this is possible. Until I have found out, that a key structure is defined privately in the rmt driver….cool.

And there is another annoying espressif opinionated implementation for the pulse counter. If the pulse counter has been obtained from the driver, there is no way to find out the underlying hardware information. This underlying information is needed, to hook the pulse counter to any gpio pin or - what I need - to the rmt output pin. Solution is a hack to define just the needed espressif private struct to derive that information.

Overall the espressif opinionated 5.x esp-idf is very much limiting, the hardware possibilities of the esp32 products.

gin66 commented 2 weeks ago

in regard to the pulse counter: (https://github.com/espressif/esp-idf/issues/14431)

Tobi90as commented 2 weeks ago

First of all, thank you for taking the time to look into the problem. Since I'm not really familiar with the technical details in the background: I can't use your new version in the current Arduino IDE with the esp32 platform version 3.0.3 at the moment, can I? Did I understand correctly that it is now up to Espressif to make your solution work at all?

gin66 commented 2 weeks ago

Firstly, testing has revealed, that the esp-idf5 version of FastAccelStepper has still some issues. So I am not finished with debugging and so the lib is not yet released.

Secondly, the current implementation needs a idf5.3 feature. But IMHO it is only a matter of time, until arduino core gets upgraded

Tobi90as commented 2 weeks ago

This sounds promising. Thanks for the insight.

gin66 commented 1 week ago

arduino v3.1.0-RC1 is supporting esp-idf 5.3.0