LSS Library compatibility with SAMD architecture

Hello,

I attempted to run the #include<LSS.h> line on a blank arduino sketch for the M0 feather using the Arduino IDE. The compiler failed.

Turns out that the library is written for AVR architecture, such as the Arduino Mega. Attempting to compile the code gives a slew of error messages, mostly of the form: error: ‘static’ may not be used when defining (as opposed to declaring) a static data member [-fpermissive]
Searching online, it seems to be due to the difference in the way the two architectures store memory.

Furthermore, the Arduino M0 lacks the <SoftwareSerial.h> library; there is a commented line in the LSS.h file that you can uncomment to remove this dependence; I did take that option but used or not it’s unrelated to the compatibility issue.

Can anyone who’s successfully used the LSS servos with SAMD chips give me advice on how to proceed?

Thank you for reading.

1 Like

@Cucumber_Harvester Welcome to the RobotShop Community. You are entirely correct that the LSS Library was not tested with the M0 or Cortex-based MCUs, and your reasoning behind its not working seems to be correct. The library would need to be adapted, though it would be unfortunately quite low on the list of priorities.

There is a group working on an LSS-based hexapod which may use the Teensy board (which is based on the Cortex-M7. They may or may not chose to adapt or write a new library.
https://community.robotshop.com/forum/t/lynxmotion-ses-v2-legged-robots/62511/281

1 Like

Hey @Cucumber_Harvester,

Welcome to the RobotShop community!

You can try it out yourself pretty easily.
First, uninstall the copy you have obtained from the Arduino IDE library manager.
Once removed, get a ZIP copy of the latest release here. Extract this file into your Libraries folder in your Arduino folder. On most system that is under a “My Documents”, “Documents” or “/home/user” folder.
Then, modify the file ** library.properties** as follows:
On line 9 simply add the architecture you’d like the library to run on.

You should then be able to compile for that architecture. You can probably simply use “*” instead of “AVR” to target all architectures. As @cbenson said though, just note that this library was only tested officially on AVR platforms and may need some changes to run on other architectures. That being said, as far as I know, there are no special AVR specific hardware features in use so it should not be an issue / code should be portable.

You can read more about that file and its contents here. Also, here’s the list of architectures.

I hope this helps!

Wow! Thanks for the very fast replies. I’ll look for the library.properties file and edit it as instructed.

1 Like

Tried modifying the library.properties file. Unfortunately, the problem persists. It’s a lot bulkier, but I’ve resorted to switching to an arduino MEGA for the time being. Thank you both for replying to my thread.

error: ‘static’ may not be used when defining (as opposed to declaring) a static data member [-fpermissive]
17 | static bool LSS::hardwareSerial;
| ^~~~~~

1 Like