1
\$\begingroup\$

Circuit Diagram

Circuit Diagram

Background & What I have tried.

  • I have wired wrapped this setup myself using a fresh STM32F411RC MCU from digikey (on a proto-advantage LQFP-64 to DIP-64 breakout board).
  • I've wired up the SWCLK, SWDIO, NRST, GND, MCU_VDD, as outlined in the ST-LINK/V2 User Manual (UM1075).
  • I power my prototype using the USB, a multimeter confirms 3.3V is getting to each of the VSS/VDD pairs & VBAT pin.
  • I've tried the various frequencies for SWD as well as the various Reset Modes and Modes in the windows GUI.
  • My wiring is as minimal as this guy using the STM32F030, so i'm not sure what the problem is: https://www.newbiehack.com/categories/newbiehack-tutorial-ARM-Video6-GPIOCreatingTheCircuit-nomenu
  • I am able to connect using UART however it seems like the STM Flash Loader program only provides the capability to load to the 512K version, but I have the 256K version.

Error message

arch:~$ st-util -v99
2016-05-18T12:50:58 DEBUG src/stlink-common.c: stlink current mode: debug (jtag or swd)
2016-05-18T12:50:58 DEBUG src/stlink-common.c: stlink current mode: debug (jtag or swd)
2016-05-18T12:50:58 DEBUG src/stlink-common.c: *** looking up stlink version
2016-05-18T12:50:58 DEBUG src/stlink-common.c: st vid         = 0x0483 (expect 0x0483)
2016-05-18T12:50:58 DEBUG src/stlink-common.c: stlink pid     = 0x3748
2016-05-18T12:50:58 DEBUG src/stlink-common.c: stlink version = 0x2
2016-05-18T12:50:58 DEBUG src/stlink-common.c: jtag version   = 0x19
2016-05-18T12:50:58 DEBUG src/stlink-common.c: swim version   = 0x4
2016-05-18T12:50:58 INFO src/stlink-common.c: Loading device parameters....
2016-05-18T12:50:58 DEBUG src/stlink-common.c: *** stlink_core_id ***
2016-05-18T12:50:58 DEBUG src/stlink-common.c: core_id = 0x00000000
2016-05-18T12:50:58 DEBUG src/stlink-common.c: *** stlink_read_debug32 0 is 0xe0042000
2016-05-18T12:50:58 DEBUG src/stlink-common.c: *** stlink_read_debug32 0 is 0x40015800
2016-05-18T12:50:58 WARN src/stlink-common.c: unknown chip id! 0
2016-05-18T12:50:58 DEBUG src/stlink-common.c: *** stlink_close ***

Under linux ST-LINK/V2 is detected however the MCU is not.

Windows STM ST-LINK Utility trace.log:
Error (0x16) after target cmd F2 36 04 20 04 E0 00 00 00 00
W at 0xe0042004: 0x00000000
Error (0x12) after target cmd F2 35 04 20 04 E0 00 00 00 00
W at 0xe000edf0: 0xa05f0000
Error (0x12) after target cmd F2 35 F0 ED 00 E0 00 00 5F A0
cErrLog::SetLogTraceOn
STLinkUSBDriver.dll loaded
ST-Link/V2 device detected
Target voltage detected: 3.222947
Driving NRST low
Error getting target IDCODE: if SWD, check SWD connection
Error (4) while initializing ST-Link in SWD mode
ST-Link/V2 device detected
Target voltage detected: 3.221382
Driving NRST low
Error getting target IDCODE: if SWD, check SWD connection
Error (4) while initializing ST-Link in SWD mode
ST-Link/V2 device detected
Target voltage detected: 3.221382
Driving NRST low
Error getting target IDCODE: if SWD, check SWD connection
Error (4) while initializing ST-Link in SWD mode

The windows GUI shows "Detection Failed" for "Target" & "Target Voltage", and provides the error message "Can not connect to target.".

Questions

  1. Any ideas on what I should try next, or what might be preventing SWD from operating?
  2. I am able to connect using UART however the STM Flash Loader program detects the chip model however slightly incorrect, I only has the 512K version in the dropdown https://i.stack.imgur.com/CiwdH.png yet my chip is the 256K version, so it seems like I can't use the Flash Loader to load on a program. Are there any other tools that know the memory map of the 256K chip and are able to flash a binary?

What I have yet to try

  1. Put a 22ohm resistor on the NRST line between the ST-LINK/V2 and the board. (AN4488 pg42)
  2. Fully wire up and ground all the other ST-LINK/V2 header pins like shown in AN4488 pg42, even though I don't think it's necessary.

Datasheets

\$\endgroup\$
13
  • \$\begingroup\$ Make sure you're in SWD mode and not JTAG mode? Basically the processor just isn't responding. You could probably get the same message if your debugger were disconnected from the target! \$\endgroup\$
    – Daniel
    May 18, 2016 at 5:14
  • \$\begingroup\$ Hi. The linux utility does not seem to allow selection between JTAG and SWD, but as you can see from the output it might be trying both? I tried the windows utility again and made sure the Port was set to SWD mode, I also tried the various frequencies. I've added the windows utility trace.log if that helps diagnose the isue. \$\endgroup\$ May 18, 2016 at 5:44
  • \$\begingroup\$ Do you have UART wired? You can try with serial bootloader GUI demo from ST. \$\endgroup\$ May 18, 2016 at 9:00
  • \$\begingroup\$ Try reducing the SWD frequency. It looks like its not making any connection with the target hardware - IDCODE is the first thing that needs to be read to establish the connection, everything before that shows that the probe hardware seems to be talking fine. Check you get clock and data activity on the SWD lines too. Data is bi-directional, but always starts with some bits sent from the probe. \$\endgroup\$ May 18, 2016 at 13:39
  • \$\begingroup\$ Have a look in the datasheet, the swd pins need a pull-up or pull-down resistor. \$\endgroup\$ May 19, 2016 at 17:28

1 Answer 1

-3
\$\begingroup\$

You must separate pin VDDA (analog) from pins VDD (digital). You need to use L (inductor or SMD ferrite bead) and C (capacitor) between VDDA and VDD pins. Capacitor must be as close as possible to pin VDDA. Or use second LDO for only VDDA and VSSA pins.

\$\endgroup\$
1
  • 5
    \$\begingroup\$ This is false and misleading. Such separation is required only if one wants low noise on the analog parts. It has nothing to do with the SWD interface not working. \$\endgroup\$ Oct 23, 2017 at 0:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.