Arm Mbed OS support forum

Mbed Studio and accelstepper library

Hello friends. i’m installing Mbed studio and including library “accelstepper”. This library in browser ide is working. But in Mbed studio get error. [Error] @0,0: L6218E: Undefined symbol t and [ERROR] Warning: L3912W: Option ‘legacyalign’ is deprecated. How i can fix it?

Hello there,

on the line 43 of .cpp of that library is extern Timer t;. The keyword EXTERN is responsible for this behavior.
The solution is you need to declare the global variable t of type Timer. For example, in your main.cpp just place Timer t;

So that is not related to any Bug of any of Mbed’s parts.

BR, Jan

1 Like

in addition to Jans answer:
you can use us_ticker_read() to get the absolute timestamp, it is not necessary to use a timer here.

unsigned long time = us_ticker_read();

And using ‘long long’ for time and _lastStepTime should avoid the ‘gymnastics’ for overflow detection :slight_smile:

2 Likes

Thank you, my friends. My engine started up again. I’m happy. It helped that unsigned long time = us_ticker_read ();.