Keil Logo

SWDIO No target connected

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Francesco Sfragara
Posted
19-Feb-2018 12:39 GMT
Toolset
ARM
New! SWDIO No target connected

I'm using a stm32f407vg board. Suddenly I can't download my code to flash memory. It gives me this error " Debugger - Cortex-M error: no target connected". In options for target > Debug > Settings in SW Device tab I see " SWDIO: Error No target connected".

How can I solve this?

Read-Only
Author
Andrew Neil
Posted
19-Feb-2018 12:47 GMT
Toolset
None
New! RE: SWDIO No target connected

Start by testing basic connectivity & comms with ST's ST-Link Utility:

* If that doesn't work, then you have a fundamental issue - nothing to do with Keil;

* If that does work, then the issue is somewhere in your Keil stuff ...

Read-Only
Author
Andrew Neil
Posted
19-Feb-2018 14:57 GMT
Toolset
None
New! Cross post

https://community.st.com/thread/47602-keil-swdio-no-target-connected

Read-Only
Author
Kevin from Support
Posted
20-Feb-2018 22:47 GMT
Toolset
None
New! RE: Cross post

I assume you are connecting using the on board debugger. If so, here are some ideas for troubleshooting a ST-Link.

I) Test with a pack example

  • the pack example are already setup to work on a board. Verify with one of those examples. This rules out issues with your code.
  • In the Keil IDE, under Project-> Options for Target -> on the "Debug" tab, on the top right of the dialog, next the "USE: ST-Link Debugger, click the "Settings" button - the "Cortex-M Target Driver Setup" dialog appears.

If the top right of the dialog says "No ST-Link detected", or on the top left, next to "Unit" the pull down box is empty: - Make sure there are no Windows USB drivers or board debugger firmware issues. If not - Swap out USB cables - Don't connect the ST-Link to your computer via USB hub

If the box on the top left says - "Unknown target connected" - On the middle-left of the screen, in the 'Target Com" box, switch the Port from "JTAG" to "SW" - ST-LINK requires a Serial Wire interface, not JTAG.

======

If that works, close the dialogues. Still using the sample pack example, Select Debug-> Start/ Stop debug session. If you get a pop up box, that says

  • "st-link usb communication error" then see "uVISION DEBUGGER: ST-LINK USB communication error" at http://www.keil.com/support/docs/3662.htm
  • Internal command error, make sure to check the command window for additional information, then see: "uVISION DEBUGGER: ST-Link Does Not Connect to STM32F4 Discovery Board" at http://www.keil.com/support/docs/3634.htm
    • Internal command error" and then "Error while attempting to read 64 bytes from memory 0x00000000"
    • Check the Boot jumpers on the board to make sure you are booting to the correct memory
    • Internal command error" A previous program running on the board is locking up.
      • Pull the BOOT0 or BOOT pin high, and restart the board, and perform a flash erase.
      • In the Keil IDE, under Project-> Options for Target -> on the "Debug" tab, on the top right of the dialog, next the "USE: ST-Link Debugger, click the "Settings" button - the "Cortex-M Target Driver Setup" dialog appears. Try using "connect under reset", close the dialogs and then perform a flash erase.
    • Try other connection/reset option "Connect under Reset"
  • Internal DLL Error, then see "Internal DLL Error Debugging with ST-Link" at http://www.keil.com/support/docs/3666.htm
  • Finally, try the ST-LINK Utilities to erase and reconfigure the device
Read-Only
Author
Jon Diller
Posted
15-Jul-2018 19:44 GMT
Toolset
ARM
New! RE: SWDIO No target connected

I had this same issue with my STM32F446RE Nucleo board. This is what I had to do to get my onboard ST-Link to talk to uVision again:

-Download the STM32 ST-LINK Utility tool and try to connect to the board.

STM32 ST-LINK Utility:
https://www.st.com/en/development-tools/stsw-link004.html#getsoftware-scroll

-If the Utility tool fails to connect with the board try tying your boot0 pin high, resetting the board, and reconnecting. On my board this meant using one of the extra jumpers from CN11/12 and connecting pins 7 (boot0) and 5 (VDD) together. Your board's User Manual will tell you where the boot0 pin is and might also tell you how to tie it high. If this doesn't work then the rest of my instructions may not work for you.

-Once connected to the board, in Utility go to menu option ST-Link -> Firmware update. A new window will appear, select "device connect". The window will determine if your ST-Link firmware is out dated and give you the option to update it, select "yes>>>>".

-Return to uVision and try flashing to your device again without boot0 tied high.

-If still failing, tie boot0 high again and retry flashing the device in uVision. If this works, then retry flashing with boot0 tied low again.

This worked for me, hope it helps.

Next Thread | Thread List | Previous Thread Start a Thread | Settings

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.