Skip to content

Separate functions not working (microsteps, rms_current) but direct register write works #313

@analogic

Description

@analogic

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions