Xmc flash 2 by ChocolateFrogsNuts · Pull Request #7317 · esp8266/Arduino (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'm not sure what the point of checking is. The way the code is written, you'll get an error, print a failure code, clear the command buffer and then SWRESET. At that time it'll just LOAD_APP anyway, same as if it passed verification.
That said, I can't give a much better idea of what to do in that case, anyway. Don't want to continually overwrite (i.e. don't clear the cmd so next reboot will try writing again) as you could end up in a hard reboot-write-reboot-write...loop and destroy the flash.