2016-05-23 01:28 AM
Circuit Diagram
http://i.stack.imgur.com/0cqvh.png
Background & What I have triedI 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 have Boot0 set to 1 and Boot1 set to 0, which should start the System Memory which contains the bootloader (AN4488), but I don't think it matters what is selected for SWD to work.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-nomenuError 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 modeThe windows GUI shows ''Detection Failed'' for ''Target'' & ''Target Voltage'', and provides the error message ''Can not connect to target.''.Questions2016-05-23 01:46 AM
Leaving aside SWD connectivity in the first instance, and leaving the STlink disconnected, does the MCU boot up successfully in DFU mode and enumerate as a DFU device?
[edit] Looking at your circuit diagram, it is possible that you haven't actually connected the USB D+/- pins or Vusb or an XTAL, but all of that should be correctable?2016-05-23 02:11 AM
Hi.
I was following the reference design on () which went straight to SWD first.It's all wired up on a wire-wrap board, , so I can indeed easily change anything.It seems like DFU mode needs a HSE connected first (), I can have a go at wiring up the HSE and USB D+/D- if you think DFU might work. Though I thought getting SWD working first using the HSI would allow me to verify the board is working before trying to wire up the HSE.Thanks.2016-05-23 08:44 AM
Not sure how the 20-pin JTAG is manifested on your board, but the schematic version looks mirrored. ie Pin 1 should be physically top left looking from above.
http://www.keil.com/support/man/docs/mcbtmpm330/mcbtmpm330_to_jtag.htm
The System Loader via USART1 PA9/PA10 is an alternate signs-of-life indicator2016-05-23 04:17 PM
Hi.
The ST-Link/V2 output is indeed like you have sown (confirmed on ). Though I believe the connectors end up mirrored on ribbon cables, e.g: , you can follow the red stripe to find pin 1.I might have a go using my own wire from the ST-Link/V2 to the board, and leave out the ribbon cable and see if that helps.Ok. I'll order a USB UART adaptor and see how that goes when it arrives.Thanks.2016-05-24 01:00 AM
Hi.
I got a FT232 USB to Serial today.I am able to successfully connect to the chip. At least I think successfully as the STM Flash Loader Demonstrator only succeeds (shows ''Target is readable.'') when I have the boot pins set to System Memory.However when I click next the only targets in the dropdown list are ''STM32F4_11_512K'' however my chip is 256K, so I don't expect flashing the chip with a bin/hex will work because the memory map is different, right? I tried SWD after connecting with UART, however SWD still does not detect.