diff --git a/esp8266/Makefile b/esp8266/Makefile
index ebf5fc95b622d63ffd7aefabaeafa8be7a0ed436..117ab53f9e8471b5b0b942a0aa01d81dacc34b7c 100644
--- a/esp8266/Makefile
+++ b/esp8266/Makefile
@@ -180,6 +180,10 @@ deploy: $(BUILD)/firmware-combined.bin
 	$(ECHO) "Writing $< to the board"
 	$(Q)esptool.py --port $(PORT) --baud $(BAUD) write_flash --verify --flash_size=$(FLASH_SIZE) --flash_mode=$(FLASH_MODE) 0 $<
 
+erase:
+	$(ECHO) "Erase flash"
+	$(Q)esptool.py --port $(PORT) --baud $(BAUD) erase_flash
+
 reset:
 	echo -e "\r\nimport machine; machine.reset()\r\n" >$(PORT)