Open almusil opened 4 years ago
You should tell what the program you flashed is supposed to to. I guess you put the CPU to sleep. During sleep, the MCUID can not be read, so the chip can not be identified. Did you try connect under reset?
Yes the program sleeps a lot. But I did set mon connect_srst enable
is that right? Without this I was not able to even attach. I mean once I attach load
says everything is fine but compare-sections
throws mismatch, and unfortunately the program is still the same as before nothing has changed.
Thanks
Please try https://github.com/UweBonnes/blackmagic/tree/demcr and report back
Won't compile without applying:
diff --git a/src/target/cortexm.c b/src/target/cortexm.c
index f7d653a..4289f67 100644
--- a/src/target/cortexm.c
+++ b/src/target/cortexm.c
@@ -243,6 +243,7 @@ static void cortexm_priv_free(void *priv)
static bool cortexm_forced_halt(target *t)
{
+ struct cortexm_priv *priv = t->priv;
target_halt_request(t);
/* Request halt on reset */
target_mem_write32(t, CORTEXM_DEMCR, priv->demcr);
But unfortunately even then it is the same story.
On the other hand the PR #507 helped.
I had the exact same problem as @almusil.
My first workaround was to add the following to my bmp.gdb
script:
mon tpwr disable
mon tpwr enable
But of course that doesn't work for battery-powered devices. So then I tested PR #507 and it also works for me!
Reworked #507 misses handling WFI and the needed setup of of RCC to write DEBUG_MCU. However the detection works so far that probe is called, at least what I tested. In that case, probe for L0/G0 can set up RCC and DEBUG_MCU. Will try the next days.
misses handling WFI for STM32L0/G0
Is this issue now resolved? Can we close it?
Hi, I was able to flash the chip few times, then it suddenly "locked" itself and every attempt ends up like the snippet:
Any idea what might be wrong?
Thank you