STLink detects MCU but fails to flash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-23 08:03 PM
Circuit (programmer given by SAMTECH part) (zoom in to see):
When I connect STLINK V3 Mini to program the STM32L4676RG MCU, it detects the chip without errors. However, when I try to flash, STLINK generates fail.text.
Any idea what's happening?
Solved! Go to Solution.
- Labels:
-
ST-Link
-
STM32L4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-30 04:47 PM
Ok I found the problem. The reset switch I used has the switch arranged diagonally (see the picture to comprehend what I mean):
Basically, the reset switch was shorted to GND all the time. I fixed it by desoldering the reset switch.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-23 10:20 PM
Please share the entire fail messages log.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-24 04:45 AM
Stlink V3 is very picky about sleeping MCUs. It is a pity that it does not do better. Try to connect under reset
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-24 08:42 AM
@RBharol​ : The error in the fail.txt is as follows: The interface firmware FAILED to download the flash programming algorithms to the target MCU. This is the only error that is visible as I am uploading the bin file of the program generated by Mbed online compiler. I don't see any error on the Serial monitor.
@Uwe Bonnes​ can you elaborate on the reset part? I did try pushing the reset button during uploading but it doesn't seem to make a difference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-24 09:27 AM
I did not notice that you flashed via the MSD way. Connect under reset needs reset controlled by the STlink. Pushing the reset button by hand is not fine-grained enough. When you use the stlink as debugger, most debug programs allow to connect under reset.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-24 09:29 AM
Should I use Mbed Studio and upload the program in debug mode?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-24 09:49 AM
Worth a try at least.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-24 02:51 PM
Ok here's what I tried:
- Tried to load blink program from Mbed Studio in debug mode, the process fails and I get the same "The interface firmware FAILED to download the flash programming algorithms to the target MCU" error from the STLink. In addition, I get "PyOCD deploy failed, deploying using mass storage device" error when I try to reset the MCU.
- To further explore the issue, I ran STLink Utility to do a hardware reset via chip erase in connect under reset mode. It seems to automatically detect the chip properly with correct voltage and model and all in hotplug mode. This means my circuit is more or less fine as well as the chip:
- However, when I try to connect in "connect under reset" mode, I get the following error:
- I don't get the same error in "hotplug" mode, however, I cant do a hardware reset as the following error is shown:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-24 02:55 PM
In addition, when I try to forcefully upload a bin file by bypassing readout protection, I get the following error:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-24 03:52 PM
Output of STLink CLI