cancel
Showing results for 
Search instead for 
Did you mean: 

Problems when i try to program the chip

BRamo.1256
Associate II

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.

3 REPLIES 3
BRamo.1256
Associate II

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?

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
BRamo.1256
Associate II

... 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 **