2020-02-18 06:49 AM
So I just recently got an stm32f103c8t6, and I was able to connect to it with the serial pins connected to pins A8 and A9, but for whatever reason, I was not able to get it to connect with the St link v2 that I also ordered. For connections, I connected 3v pin to pin 1, as labeled in the user manual for the st link, ground to 20(power was working and the onboard power LED was on), SWIO to 7 and SWCLK to 9. I was unable to find a video of someone using the official st link online, as basically every video used a knockoff board. Is there something I'm not doing right?
Update, I was able to connect with stm32cubeprogrammer, but not write. I am able to connect with these settings:
SWD
4000khz
hot plug
software reset
I can see the contents of the memory, but I am not able to write to them. Can someone explain what I am doing wrong?
Solved! Go to Solution.
2020-02-18 03:05 PM
It is reporting the voltage observed at Pin 1
Pin 19 should be 3.3V, but not sure the the load it is allowing for.
Get a scope or meter and check it. Make sure the grounds are bonded.
Perhaps try using a bench supply.
2020-02-18 02:00 PM
I'm writing this comment so that it can hopefully get shot up to the top and someone will see it
2020-02-18 02:11 PM
Does it give some kind of error?
Option Bytes, Write Protected?
Can you erase the part?
The file write is in a different pane, ST-LINK Utilities has a somewhat better interface.
2020-02-18 02:29 PM
here is what ST-link utility gives me:
16:27:08 : ST-LINK SN : 36FF6A065250343813470343
16:27:08 : V2J35S7
16:27:08 : Connected via SWD.
16:27:08 : SWD Frequency = 4,0 MHz.
16:27:08 : Connection mode : HotPlug.
16:27:08 : Debug in Low Power mode enabled.
16:27:08 : Device ID:0x410
16:27:08 : Device flash Size : 128KBytes
16:27:08 : Device family :STM32F10xx Medium-density
16:27:17 : [blinkOnboardLED.bin] opened successfully.
16:27:17 : [blinkOnboardLED.bin] checksum : 0x00067F26
16:27:21 : Unexpected error
16:27:23 : Can not connect to device!
16:27:24 : Disconnected from device.
16:27:24 : Connection to device is lost: check power supply and debug connection.
16:27:24 : If the target is in low power mode, please enable "Debug in Low Power mode" option from Target->settings menu.
And here is what STM32CubeProgrammer gives me:
16:28:37 : ST-LINK SN : 36FF6A065250343813470343
16:28:37 : ST-LINK FW : V2J35S7
16:28:37 : Voltage : 1.56V
16:28:37 : SWD freq : 4000 KHz
16:28:37 : Connect mode: Hot Plug
16:28:37 : Reset mode : Software reset
16:28:37 : Device ID : 0x410
16:28:37 : UPLOADING OPTION BYTES DATA ...
16:28:37 : Bank : 0x00
16:28:37 : Address : 0x4002201c
16:28:37 : Size : 8 Bytes
16:28:37 : Bank : 0x01
16:28:37 : Address : 0x1ffff800
16:28:37 : Size : 16 Bytes
16:28:37 : UPLOADING ...
16:28:37 : Size : 1024 Bytes
16:28:37 : Address : 0x8000000
16:28:37 : Read progress:
16:28:37 : Data read successfully
16:28:37 : Time elapsed during the read operation is: 00:00:00.012
16:28:47 : Memory Programming ...
16:28:47 : Opening and parsing file: blinkOnboardLED.bin
16:28:47 : File : blinkOnboardLED.bin
16:28:47 : Size : 4652 Bytes
16:28:47 : Address : 0x08000000
16:28:47 : Erasing memory corresponding to segment 0:
16:28:47 : Erasing internal memory sectors [0 4]
16:28:47 : Error: failed to erase memory
16:28:47 : Error: failed to erase memory
16:28:47 : RUNNING Program ...
16:28:47 : Address: : 0x08000000
16:28:47 : Warning: The core is halted
16:28:47 : Start operation achieved successfully
2020-02-18 02:43 PM
Custom board?
The 1.56V reported seems inadequate, write/erase will need proper powering.
2020-02-18 02:52 PM
I'm not sure how to set that, but I have the voltage hardwired to the 3.3v port on the St link v2, I believe it's pin 19
2020-02-18 03:05 PM
It is reporting the voltage observed at Pin 1
Pin 19 should be 3.3V, but not sure the the load it is allowing for.
Get a scope or meter and check it. Make sure the grounds are bonded.
Perhaps try using a bench supply.
2020-02-18 08:17 PM
Update: I was able to flash the memory, by connecting pin 1 to the voltage and powering over USB. Thanks for the help!