janelia-arduino/TMC2209

Compile Error Arduino UNO R4 WIFI

Opened this issue · 5 comments

C:\..Path..\libraries\TMC2209\src\TMC2209\TMC2209.cpp: In member function 'void TMC2209::setup(SoftwareSerial&, long int, TMC2209::SerialAddress)': C:\..Path..\libraries\TMC2209\src\TMC2209\TMC2209.cpp:85:25: error: 'class SoftwareSerial' has no member named 'end'; did you mean 'read'? software_serial_ptr_->end(); ^~~ read

This Error is shown on my Arduino Compiler.
Board: Arduino Uno R4 Wifi
Code: Example Code Move At Velocity

Only Change:

Line 9: HardwareSerial & serial_stream = Serial1;

Hi I'm facing similar error in ESP32, were you able to find a solution?

You can comment out line 84 of TMC2209.cpp, "software_serial_ptr_->end();", and it will compile and work with software serial. Similarly, commenting out "hardware_serial_ptr_->end();" makes hardware serial work without segfault

here is my fork that works for me on an R4 wifi: https://github.com/AlistairKeiller/TMC2209

hi this was fixed for ESP32 in the latest version of the library, hence my issue got resolved, thanks for the reply

The calls to end() were added to handle an edge case where the serial port was not closed properly before calling begin. It seems to cause problems on some platforms but not others. I will comment out those calls to end and release a new version, although that may end up breaking some setups in certain situations. Please try version 9.4.2 and let me know if it fixes your problems. Thanks!