Here is the M122 right after the motor stopped working (I can only post part of the code because otherwise the post will be reported as spam.):
=== Diagnostics ===
RepRapFirmware for Duet 2 WiFi/Ethernet version 2.05.1 running on Duet WiFi 1.02 or later
Board ID: 08DGM-9T6BU-FG3SJ-6J1DD-3SJ6P-TBY3G
Used output buffers: 1 of 24 (7 max)
=== RTOS ===
Static ram: 25712
Dynamic ram: 93568 of which 0 recycled
Exception stack ram used: 472
Never used ram: 11320
Tasks: NETWORK(ready,628) HEAT(blocked,1232) MAIN(running,3728) IDLE(ready,160)
Owned mutexes:
=== Platform ===
Last reset 00:05:07 ago, cause: power up
Last software reset at 2023-01-06 17:46, reason: Unknown, spinning module Platform, available RAM 11132 bytes (slot 2)
Software reset code 0x00b0 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0041f80f BFAR 0xe000ed38 SP 0x20001ff4 Task 0x5754454e
Stack: 0040c0c1 0040c0c6 21000000 00000000 40ba7c00 00000000 00000000 43910000 41800000 3e178897 3e1cd04f be07a50f 421dd6a9 00000000 47688900 37d33333 4354c416 00000000 40853000 80000010 0040c0bd 10000000 e000ed04
Error status: 0
Error status: 0
Free file entries: 9
SD card 0 detected, interface speed: 20.0MBytes/sec
SD card longest block write time: 0.0ms, max retries 0
MCU temperature: min 17.9, current 28.9, max 29.0
Supply voltage: min 23.9, current 24.2, max 24.4, under voltage events: 0, over voltage events: 0, power good: yes
Driver 0: standstill, SG min/max 0/1023
Driver 1: ok, SG min/max 0/115
Driver 2: ok, SG min/max 0/167
Driver 3: standstill, SG min/max not available
Driver 4: standstill, SG min/max not available
Date/time: 2023-01-07 09:20:51
Cache data hit count 851506708
Slowest loop: 247.02ms; fastest: 0.06ms
I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0
=== Move ===
Hiccups: 0, FreeDm: 157, MinFreeDm: 106, MaxWait: 125029ms
Bed compensation in use: mesh, comp offset 0.000
=== DDARing ===
Scheduled moves: 548, completed moves: 539, StepErrors: 0, LaErrors: 0, Underruns: 0, 0
=== Heat ===
Bed heaters = 0 -1 -1 -1, chamberHeaters = -1 -1
Heater 0 is on, I-accum = 0.3
Heater 1 is on, I-accum = 0.4