@Raxtus14 M997 S2 updates the Raspberry Pi. Send M997 or M997 S0 to update the 6HC itself. See https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m997-perform-in-application-firmware-update

For SBC setup, see https://docs.duet3d.com/en/User_manual/Machine_configuration/SBC_setup

Ian