Complain if flashing cannot succeed; see #648 (#659)

This commit is contained in:
Peli de Halleux 2018-02-16 11:39:12 -08:00 committed by GitHub
parent 28cd4fc7a5
commit 838a7ce848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -285,6 +285,11 @@ namespace pxt.editor {
log("reset")
return wrap.cortexM.reset(true)
})
.then(() => wrap.cortexM.memory.readBlock(0x10001014, 1, pageSize))
.then(v => {
if (HF2.read32(v, 0) != 0x3C000)
U.userError(U.lf("Please flash any MakeCode hex file using drag and drop. Flashing from app will work afterwards."))
})
.then(() => getFlashChecksumsAsync(wrap))
.then(buf => {
checksums = buf