When writing code for the LoPy that uses sleep or deep-sleep I’ve noticed that you can easily put your device into a running state which makes it hard to do serial communication over USB. This little trick will safe boot your LoPy and restore your firmware (as well as your code) to a previously stored state.
Disconnect any power source and mount the LoPy to the expansion board.
Connect a jumper-cable between P12 (written G28 on the expansion board) and 3V3.
Connect a power source. The LED will flash in orange.
Remove the jumper cable within 3 seconds to safe boot the current firmware.
If you wait for more than 3 seconds a previously stored firmware will be chosen. If you wait 6 seconds the factory firmware will be chosen.