2020-05-15 07:31 AM
Hello, im facing a problem when i try to program the chip, im using the eclipse ide and a cheap stlink debugger, the most common error is this:
adapter speed: 24000 kHz
adapter_nsrst_delay: 100
Info : clock speed 24000 kHz
Info : STLINK v2 JTAG v34 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.192646
Error: init mode failed (unable to connect to the target)
in procedure 'program'
in procedure 'init' called at file "embedded:startup.tcl", line 495
in procedure 'ocd_bouncer'
** OpenOCD init failed **
shutdown command invoked
I already update the firmware of the stlink, i put boot0 high and use the system memory, i tried to erase the chip using stlink utility, but it appears that flash protections is activated. I also change to software system reset, but nothing works for me. Someone can help me? I think that i have enabled the flash protection in some way and now i cant reprogram the chip.
2020-05-15 07:35 AM
I have used the device many times, but now im using the low power modes, and it happened, is there some relation with this problem?
2020-05-15 09:15 AM
Low power modes turn OFF the logic you're trying to communicate with, or while the debugger gains control of the system.
Connecting NRST helps, holding BOOT0 HIGH can get your code out of the picture.
You can also provided sufficient time after startup before sleeping so the debugger can get control, or avoid using __WFI, etc.
2020-05-18 02:15 PM
... holding BOOT0 HIGH can get your code out of the picture.
Thanks, but now, when i tried to program another code, this error occurs:
** Programming Started **
auto erase enabled
Info : device id = 0x10076413
Info : flash size = 512kbytes
Error: stm32x device protected
Error: failed erasing sectors 0 to 0
embedded:startup.tcl:476: Error: ** Programming Failed **