You are here

Reprogramming the STM32 uController


After trying to follow my previously posted method of reprogramming the STM32 without any luck, I thought it might be an idea to document a more robust hook up.

Looking at the ST-Link/v2 docs I noticed that pins 1 & 2 on the programmer are used to detect "Target Voltage".
Swapping the DAM's 3.3V and GND from pins 19 & 20 to pins 2 & 4 (4 = GND) didn't have the desired effect.

What does work is a 6 wire connection.

DAM -> ST-Link

SMD-3.3V -> Pin 2   (Target Voltage detect)
SMD-GND -> Pin 4 (GND)

SMD-SWDIO -> Pin 7
SMD-SWCLK -> Pin 9

J2-3.3V -> Pin 19 (Target Power)
J2-GND -> Pin 20 (GND)

Illustration of hookup below (thanks to glt for the pilfered dam pcb photo!)

The advantage of this hookup is that the ST-Link powers the board, and correctly senses the target voltage levels.

Make sure that you disconnect everything from the DAM1021 before attempting hooking up the programmer.

With the DAM hooked up, fire up the programming software then go into settings.  The Programmer serial should be shown regardless of whether the STM32 is detected or not.  If the connection between the ST-Link and DAM is correct you should see a Target Voltage of 2.7-3.3V or there abouts, and the type of STM32 chip installed on the board displayed.  If not you have some trouble shooting to do!

Once you have the target displayed as "Detected", go to the Target menu and select "program and verify". If you haven't loaded the uManager .bin file, you will prompted to select it at this point.

With any luck the firmware should load program and verify in a matter of seconds....

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.