You can try require("Storage").eraseAll() from IDE's command line. That should erase whole SPI flash. Then restoring your files or starting from scratch. If that doesn't work and you still see FW addr fail I'd try to drain the battery so CPU and SPI flash is power cycled and try again with eraseAll. If nothing helps and if the address reported is still the same then it could be bad flash block indeed. If that is really the case (hopefully not) than temporary workaround could be to build custom firmware with smaller storage area that does not include such bad area. I think bad block skipping is currently not part of Storage or Flash modules (as nobody had this issue so far) but if it would be real issue it could perhaps be added.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
You can try
require("Storage").eraseAll()
from IDE's command line. That should erase whole SPI flash. Then restoring your files or starting from scratch. If that doesn't work and you still see FW addr fail I'd try to drain the battery so CPU and SPI flash is power cycled and try again with eraseAll. If nothing helps and if the address reported is still the same then it could be bad flash block indeed. If that is really the case (hopefully not) than temporary workaround could be to build custom firmware with smaller storage area that does not include such bad area. I think bad block skipping is currently not part of Storage or Flash modules (as nobody had this issue so far) but if it would be real issue it could perhaps be added.