Author Topic: stm32 flash frequency issue  (Read 1249 times)

0 Members and 1 Guest are viewing this topic.

Offline GuillaumeTopic starter

  • Contributor
  • Posts: 15
  • Country: fr
stm32 flash frequency issue
« on: May 31, 2023, 04:56:13 pm »
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
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3339
  • Country: gb
Re: stm32 flash frequency issue
« Reply #1 on: May 31, 2023, 05:10:42 pm »
Do you have capacitors on your reset, clock or data lines that could be loading down the programmer?
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8888
  • Country: fi
Re: stm32 flash frequency issue
« Reply #2 on: May 31, 2023, 05:56:21 pm »
Schematic? Picture of the layout?
 

Offline GuillaumeTopic starter

  • Contributor
  • Posts: 15
  • Country: fr
Re: stm32 flash frequency issue
« Reply #3 on: May 31, 2023, 06:08:58 pm »
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

 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6273
  • Country: es
Re: stm32 flash frequency issue
« Reply #4 on: May 31, 2023, 08:42:20 pm »
Are thaose extremely thin 6th traces your ground? There's no ground plane?
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline GuillaumeTopic starter

  • Contributor
  • Posts: 15
  • Country: fr
Re: stm32 flash frequency issue
« Reply #5 on: June 01, 2023, 07:02:51 am »
It's a two layers board. I have some ground plane on the bottom.
 

Offline GuillaumeTopic starter

  • Contributor
  • Posts: 15
  • Country: fr
Re: stm32 flash frequency issue
« Reply #6 on: June 01, 2023, 07:19:00 am »
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 ?
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8888
  • Country: fi
Re: stm32 flash frequency issue
« Reply #7 on: June 01, 2023, 08:06:51 am »
It seems the MCU has no ground connection at all! (Or if it has, through some very long route.)
 

Offline GuillaumeTopic starter

  • Contributor
  • Posts: 15
  • Country: fr
Re: stm32 flash frequency issue
« Reply #8 on: June 01, 2023, 08:40:58 am »
All via on the thermal pad aren't sufficient?
Edit : oh yes, this ground plane is a bit isolated
« Last Edit: June 01, 2023, 08:43:15 am by Guillaume »
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8888
  • Country: fi
Re: stm32 flash frequency issue
« Reply #9 on: June 01, 2023, 08:48:06 am »
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.
 

Offline GuillaumeTopic starter

  • Contributor
  • Posts: 15
  • Country: fr
Re: stm32 flash frequency issue
« Reply #10 on: June 01, 2023, 09:18:46 am »
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
 

Offline GuillaumeTopic starter

  • Contributor
  • Posts: 15
  • Country: fr
Re: stm32 flash frequency issue
« Reply #11 on: June 01, 2023, 10:08:36 am »
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
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf