Duet 3: Two or more M122 in a macro crashes firmware.



  • Board: Duet 3 MB6HC (MB6HC)
    DSF Version: 1.1.0.5
    Firmware: RepRapFirmware for Duet 3 MB6HC v0.6 or 1.0 3.0beta12 (2019-11-02b1)

    Macro containing:

    M122 B0
    M122 B1

    or

    M122 B0
    M400
    G4 S5
    M400
    M122 B1

    Crashes on second M122. Re-ordering boards makes no difference. When it crashes, it does not reboot; it never comes back. Requires reset or power cycle. Log sometimes says:

    Error: Operation failed (Reason: Object reference not set to an instance of an object.)

    Each command works fine when entered separately from console.



  • @Danal If you click "Topic Tools" at the bottom of this post, you can mark this post as a "Question". This will put the "Unsolved" tag on it and make it easier for everyone to see that this is a bug report.



  • Fantastic, THANK YOU, I've been wondering how to get those tags!


  • administrators

    Thanks for your report. I will look into this tomorrow.


  • administrators

    @dc42 said in Duet 3: Two or more M122 in a macro crashes firmware.:

    Thanks for your report. I will look into this tomorrow.

    I have tested this running 3.0beta12 in standalone mode and it works, even if I have four M122 commands in the macro for B0 B1 B2 and B3. So I think it must be a DSF issue. We'll look into it.

    EDIT: I've logged this issue at https://github.com/chrishamm/DuetSoftwareFramework/issues/78.



  • I will also update everything I can, and re-test.


  • administrators

    I tried to reproduce this bug but it worked without problems every time on my setup (DCS 1.1.0.5 + RRF3 beta12+1).

    Can you look into the DCS log once again and this time search for 'Object reference not set to an instance of an object'? There should be a verbose log message with a stack trace that should help me to easily identify the underlying problem.



  • I can't reproduce either with latest firmwares on the boards and latest DSF.
    You don't get any output when M122 is run in a macro though.



  • Reproducible on mine.

    Duet Control Server v1.1.0.5
    Board: Duet 3 MB6HC (MB6HC)
    DSF Version: 1.1.0.5
    Firmware: RepRapFirmware for Duet 3 MB6HC v0.6 or 1.0 3.0beta12 (2019-11-02b1)
    Duet Web Control 2.0.4

    macro that causes crash:

    M122 B1
    m122 B0
    

    DCS log

    DCSlog.txt

    Log produced via:

    1. Start log capture (via pipe)
    2. Execute G28
    3. Execute macro
      Allow machine to sit for a few moments so the reboot-loop will be captured in the log multiple times.
    4. Press hardware reset button on main board.
    5. Wait until DWC reconnects.


  • @Danal it's not because the second M122 is lowercase is it?



  • If you do only B0 or only B1 does it still fail? I.E. Does it have to do with mixing boards or does multiple requests for the main board also fail?

    If it always involves the extension board, maybe it has something to do with what's configured there. Can you share how you have that board set up? I can try and duplicate it.



  • @Danal I just saw this in your log...

    [warn] Kernel SPI buffer size is smaller than RepRapFirmware buffer size (4096 configured vs 8192 required)
    

    Create a file /etc/modprobe.d/spidev.conf with one line in it...

    options spidev bufsiz=8192
    

    The reboot the Pi and test again.



  • @gtj0 said in Duet 3: Two or more M122 in a macro crashes firmware.:

    @Danal I just saw this in your log...

    [warn] Kernel SPI buffer size is smaller than RepRapFirmware buffer size (4096 configured vs 8192 required)
    

    Create a file /etc/modprobe.d/spidev.conf with one line in it...

    options spidev bufsiz=8192
    

    The reboot the Pi and test again.

    This fixed it.

    I found that in the setup instructions last night. I don't remember that being there a few weeks back when I first set up the D3. Could be wrong...

    Anyway, it definitely fixes the problem.


Log in to reply