M404 Crashes and Goes Offline

Is your M404 connecting by cellular or Wi-Fi?

If Wi-Fi, it could be related to this issue which is still being investigated. It seems to be related to specific access points that cause this issue.

If the device does not respond to USB, it is either completely locked up, or in mutex deadlock between threads.

Using the hardware watchdog can help in this case.

Note that the hardware watchdog and the reset button do not reset the cellular modem. If you fail to connect for 10 minutes, the modem should be powered down to reset it, however.

The one case where this does not help is if you have run out of RAM. In this case, the modem will be reset, but the underlying problem of insufficient RAM has not been solved, so you will fail to connect again. Using an out of memory handler will catch this case.