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
284 stars 67 forks source link

I can´t compile "ussageExample" for ESP32. I get #error "Unsupported derivate" #127

Open plop510 opened 2 years ago

plop510 commented 2 years ago

I´m comming from AccelStepper lib and your library is very very promising but I ´m not able to complile any of the samples. I´ve tried version 0.27.5 on Arduino 1.8.13, over:

Thanks plop510

gin66 commented 2 years ago

unknown derivate errors comes for esp32 compilation in this scenario:

#if defined(ARDUINO_ARCH_ESP32)
#if CONFIG_IDF_TARGET_ESP32

The first passes, which is good. The latter seems to fail. Could you please try, if alternatively an #ifdef CONFIG_IDF_TARGET_ESP32 is positively evaluated ?

FastAccelStepper is compiled with esp32 arduino core under platformio using github actions. The test runs against 3.4, 4.4 beta and latest. The execution was two months ago. arduino 1.8.13 is from 2020. perhaps not recent enough !?

gin66 commented 2 years ago

The conditional test above is in src/common.h. For a quick test, you could override the second test to be always true. Then check, if compilation works or not.

plop510 commented 2 years ago

Hi, thanks for your answer. Arduino version last digit was not correcttly written: it´s current 1.8.19 I´ve modidified common.h, line 97 inserting a line:

define CONFIG_IDF_TARGET_ESP32

to make true the following conditional and compilation is now succesful.

Thanks a lot Now, I´ll prepare a test circuit to give a tray.

gin66 commented 2 years ago

Good to hear, that this is a solution for you. So I need to find out, how to detect the current ESP32 derivate with 1.8.19 and how to check under CI aka platform

plop510 commented 2 years ago

I´ve tested your library with a real project: my telescope control (dobson like). I've been migrating all app from AccelStepper to FastAccelStepper and everything is working. I´ve been even able to uncomment many functions that with the previous library needed more CPU than what was available during motors movements. Many thanks for such a great library!

José López. plop510@gmail.com

bradMatias commented 1 year ago

Wanted to say I hit the same issue and also the same suggestion from plop510 fixed my problem: adding #define CONFIG_IDF_TARGET_ESP32 to line 97 of common.h (right above #ifdef CONFIG_IDF_TARGET_ESP32)

gin66 commented 1 year ago

still this problem ? Which version do you use ?

bradMatias commented 1 year ago

image 0.27.5 via the Arduino Library Manager

gin66 commented 1 year ago

ok. The latest fix to avoid this problem is not included in 0.27.5 Any chance, that you can check the latest version from GitHub ?

gin66 commented 1 year ago

stalled

rorosaurus commented 3 weeks ago

@gin66 I've run into a similar issue.

Version 0.30.15 downloaded from Github and manually copied to my Arduino libraries folder.

In file included from F:\OneDrive\Documents\Arduino\libraries\FastAccelStepper\src/FastAccelStepper.h:5:0,
                 from F:\OneDrive\Documents\Arduino\StepperDemo\StepperDemo.ino:2:
F:\OneDrive\Documents\Arduino\libraries\FastAccelStepper\src/fas_common.h:201:2: error: #error "Unsupported derivate"
 #error "Unsupported derivate"

It seems to think I'm using an undefined ESP32 derivative.

If I apply a similar fix to @bradMatias above, adding #define CONFIG_IDF_TARGET_ESP32 to line 112 and changing line 113 to #ifdef instead of #if, compilation and upload complete successfully.

gin66 commented 3 weeks ago

Still no idea, what is the problem in the undocumented preprocessor symbol djungle of too many versions. If you only change #if to #ifdef without #define, does it work ?

If CONFIG_IDF_TARGET_ESP32 is defined, but evaluates to 0, then this could occur, too.

rorosaurus commented 1 week ago

Testing only changing #if to #ifdef and I still get the same unsupported derivate error! :/