I’ve built off lastnight’ss 2.0.8 bugfix branch and have a working LR2 (x/y/z and endstops all go in their proper direction) laser changes PWM on G1 moves. Sometimes G0 doesn’t work to turn off the laser PWM even though it is enabled in the config (does G0 expect an x/y/z move as well not just G0 S0?). M5 also sometimes doesn’t work to turn off the laser module. This is just through manual GCODE input to get an idea of how to configure my post processor now. I haven’t tried M4 S0 as you stated above (I would use this for retracts maybe?).
On a side note, I now have noise in my stepper motors which seems to be a common issue that has cropped up with the NEMA17 steppers driven by TMC2209 drivers since I compiled on 2.0.5.7 IIRC?
Edit: found my answer
Anywho, this is the build I have M106 controlling the laser.
This is what I am currently working with that just seems to have the issues with stepper noise.
Update: tested with Ryan’s Test gcode. Turned up this.
Update 2: more more things tweaked.
Update 3: Almost there!