Hi!
I'm having a problem with the TMCStepper library. I'm using PlatformIO ESP32 Arduino with the latest TMCStepper and a Fysetc E4 (multiple TMC2209s, bidirectional UART comm) board. All the read communication works, but the write function does not seem to work – it does not generate any errors, but it does not seem to write anything.
drv1.microsteps(16);
drv1.rms_current(400);
...
All of these functions leave the registers the same if I check them before and after. The motor's behaviour also suggests that it does not receive them.
However, when I do
drv1.GCONF(0x000001C1).
drv1.CHOPCONF(0x14020055);
drv1.IHOLD_IRUN(0x00060408).
it works every time!
Does anyone have any idea what is going on? Could it be some kind of compiler optimisation breaking the functions?
Edit: It seems that calling push() fixed the issue but why?