gin66 / FastAccelStepper

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

ESP32-S3, RMT driver on 5th stepper fails #245

Closed cmlpreston closed 2 months ago

cmlpreston commented 3 months ago

Hi,

I am finding a problem with this library when using more than 4 steppers with an ESP32-S3.

I have four steppers working (using TMC2209 driver chips and the TMC2209Stepper with UART control) correctly.

I previously had eight working correctly with this library with an ESP32. However with the ESP32-S3 (selected for improved IO options) I find that on the 5th call to engine.stepperConnectToPin(), the following error is emitted:

(1124) rmt: rmt_isr_register(716): RMT driver installed, can not install generic ISR handler

None of steppers 5 through 8 work correctly. When movement is requested with .moveTo() the steppers just commence slow rotation and never stop.

Perhaps this is related: https://github.com/espressif/esp-idf/issues/11478 ?

I am using the Arduino IDE, and also FreeRTOS if that matters.

Thanks!

gin66 commented 3 months ago

Which other libraries/peripherals are used in the application ? Sounds more like a conflict, where another library has already installed an interrupt handler.

gin66 commented 3 months ago

and right. it is a problem, that FastAccelStepper still return a stepper instance….

cmlpreston commented 3 months ago

It seems you were right that it was a conflict as by removing the below (and related calls) to:

include

include

include

include

(Also, SPI library is loaded through the TMCStepper library).

motor #5 now works normally and no error is emitted when the stepper is configured.

Of those, I really only need the I2C Wire library and I have just re-enabled that and it seems ok, so presumable the Wifi or graphics libs were the issue. I will do some further debugging and advise if it is helpful.

gin66 commented 2 months ago

apparently no issue in FastAccelStepper besides the tracked issue 246