stm32 flash frequency issue - Page 1
Forum section: electronics / general

author: Guillaume
author_rank: Contributor
timestamp: May 31, 2023, 04:56:13 pm
content: Hello,I have trouble to flash my custom stm32 board.I use an stlinkV2 clone. But i also own an stlink V3 mini.With theses two stlink i can flash a bluepill without any problem but on my custom board i can't use the v3 mini.And I only succeed when flashing with the v2 at 140 khz using stm32cubeide (auto failed).If i try to flash using make flash and openocd, i don't know how to set a custom frequency so it failed after trying 2000khz and then 1800khz.What can be the problem ? i suggest my hardware routing ?Cause and don't want to make new version now, can i set a custom frequency on openocd to proceed with make flash ?Thanks for your helps,Guillaume

author: mikerj
author_rank: Super Contributor
timestamp: May 31, 2023, 05:10:42 pm
content: Do you have capacitors on your reset, clock or data lines that could be loading down the programmer?

author: Siwastaja
author_rank: Super Contributor
timestamp: May 31, 2023, 05:56:21 pm
content: Schematic? Picture of the layout?

author: Guillaume
author_rank: Contributor
timestamp: May 31, 2023, 06:08:58 pm
content: No, there is no capacitor on theses lines.I use SWD with only clock and data line (+gnd). The lines are directly connect to the header

author: DavidAlfa
author_rank: Super Contributor
timestamp: May 31, 2023, 08:42:20 pm
content: Are thaose extremely thin 6th traces your ground? There's no ground plane?

author: Guillaume
author_rank: Contributor
timestamp: June 01, 2023, 07:02:51 am
content: It's a two layers board. I have some ground plane on the bottom.

author: Guillaume
author_rank: Contributor
timestamp: June 01, 2023, 07:19:00 am
content: I'm still a beginner, could you confirm that openocd can work with only the two line data and clock ? Can it perform a software reset without the reset line ?

author: Siwastaja
author_rank: Super Contributor
timestamp: June 01, 2023, 08:06:51 am
content: It seems the MCU has no ground connection at all! (Or if it has, through some very long route.)

author: Guillaume
author_rank: Contributor
timestamp: June 01, 2023, 08:40:58 am
content: All via on the thermal pad aren't sufficient?Edit : oh yes, this ground plane is a bit isolated

author: Siwastaja
author_rank: Super Contributor
timestamp: June 01, 2023, 08:48:06 am
content: Those vias are fine but that plane isn't going anywhere, it's floating there... You need vias elsewhere to stitch bottom and top planes together, and avoid routing on bottom like plague. 2-layer design requires a lot of care! Working with 4 is so much easier.

author: Guillaume
author_rank: Contributor
timestamp: June 01, 2023, 09:18:46 am
content: There is a path to the ground pin connect to my stlink but it's true that is not large and use some via.Maybe my second version will be on 4 layers board

author: Guillaume
author_rank: Contributor
timestamp: June 01, 2023, 10:08:36 am
content: With stm32cuneide I can now speed up the frequency or set it to auto. I make some modification: let only stlink wired and power (no scope neither usb-uart) and modify my power wiring.But I still can't flash it using make flash and openocd, I think my conf is different here. I have to try using stlink v3