Getting stlink error while flashing

Post Reply
dev
Posts: 51
Joined: Sun Feb 19, 2017 8:41 am

Getting stlink error while flashing

Post by dev » Wed Aug 09, 2017 2:40 pm

hi,
I use STM32 ST-LINK Utility for flashing stm32f103xxx.
Till yesterday it was working like charm but now it is not at all working. I did usual stuff only. flashed small code for i2c scanner.
But now it is giving error while flashing.
I have attached screenshot.
Image
Attachments
Capture.JPG
Capture.JPG (32.46 KiB) Viewed 135 times

stevestrong
Posts: 1604
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Getting stlink error while flashing

Post by stevestrong » Wed Aug 09, 2017 2:51 pm

You may have used PB3/PB4 in your code as GPIO pins, and used

Code: Select all

disableDebugPorts();
You can use STlink probe only when you don't use PB3/4 in your code.

Solution:
You upload via USB DFU a code in which you remove the above mentioned function, or specify:

Code: Select all

enableDebugPorts();
This will turn on the SWD capability.

User avatar
RogerClark
Posts: 6894
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Getting stlink error while flashing

Post by RogerClark » Wed Aug 09, 2017 9:26 pm

It doesn't normally connect at all if the debug pins are disabled

But if they are disabled, use Connect Under Reset


It could be the MCU os defective

Post Reply