teemuatlut / TMCStepper

MIT License
501 stars 196 forks source link

Bigtreetech changes to TMC2208 SW_SERIAL implementation #75

Open salacpavel opened 5 years ago

salacpavel commented 5 years ago

Hello,

could it be possible to merge changes Bigtreetech comited to their fork back to your main tree, so we (SKR users) are not stuck with 0.4.5 forever because of their inability to issue a proper pull request? This is the only change they made: https://github.com/bigtreetech/TMCStepper/commit/b43f65aac27316504305808262bff5e817223320

teemuatlut commented 5 years ago

They are testing if an unsigned integer is greater than a negative value.

I'm planning to do away with write only mode anyway but I'd need to test if the simple change works with AVR first before releasing it as a feature. Basically platform agnostic half-duplex capabilities. I know what they're trying to do and I might make the change as a temporary step if that solves some issues.

salacpavel commented 5 years ago

Awesome :) Thank you, sir!

AbelCS commented 4 years ago

They are testing if an unsigned integer is greater than a negative value.

I'm planning to do away with write only mode anyway but I'd need to test if the simple change works with AVR first before releasing it as a feature. Basically platform agnostic half-duplex capabilities. I know what they're trying to do and I might make the change as a temporary step if that solves some issues.

It would be great for all SKR users.

LinoBarreca commented 4 years ago

No wait @salacpavel is wrong. What BTT did in reality is to include a SoftwareSerial implementation for stm32

https://github.com/bigtreetech/TMCStepper/blob/master/src/source/SW_UART.h (&cpp)

I think this can be solved at project level (references) into Marlin itself.

LinoBarreca commented 4 years ago

addendum: use this workaround: edit platformio.ini to add SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip to lib_deps in the BIGTREE_SKR_PRO section Open the "TMCStepper.h" in the library folder of your build environment (where you download libraries, mine is in C:\Users[name].platformio\lib\TMCStepper[XYZ])

Edit line #if (__cplusplus >= 201703L) && defined(__has_include) into #if defined(__has_include)

Save. Build.

extesy commented 4 years ago

@LinoBarreca Take a look at https://github.com/stm32duino/Arduino_Core_STM32/pull/645

LinoBarreca commented 4 years ago

@LinoBarreca Take a look at stm32duino/Arduino_Core_STM32#645

I see it has been merged to official stm32duino. Problem here is that the ST STM32 platform (on PlatformIO) uses package framework-arduinoststm32 but the version 3.10601.190716 hints that it has been built on 16 july 2019. Probably it's just a matter of time 'till they update the framework (or maybe we can open a feature request for it). Meanwhile using another SoftwareSerial implementation works just fine.