From 838a7ce84843aab5f5e8486447b880134c74b3de Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 16 Feb 2018 11:39:12 -0800 Subject: [PATCH] Complain if flashing cannot succeed; see #648 (#659) --- editor/extension.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/editor/extension.ts b/editor/extension.ts index 24853732..487f68e2 100644 --- a/editor/extension.ts +++ b/editor/extension.ts @@ -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