]> git.sur5r.net Git - openocd/commitdiff
adi_v5_swd: Add error message when SWD fails to connect
authorJonas Norling <jonas.norling@cyanconnode.com>
Wed, 25 Oct 2017 08:38:49 +0000 (10:38 +0200)
committerSpencer Oliver <spen@spen-soft.co.uk>
Wed, 6 Dec 2017 20:55:14 +0000 (20:55 +0000)
Error message instead of failing silently.

Change-Id: Ie54a5bf68459d3c0e96cc38080ffad8de0a4b5ce
Signed-off-by: Jonas Norling <jonas.norling@cyanconnode.com>
Reviewed-on: http://openocd.zylin.com/4269
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/target/adi_v5_swd.c

index 41ddbd7895698aae256955a04993d1702c30a2e3..a6aada32611ba26884ebf4e739f113e26ead3e3c 100644 (file)
@@ -427,7 +427,10 @@ static int swd_init(struct command_context *ctx)
        /* First connect after init is not reconnecting. */
        dap->do_reconnect = false;
 
-       return swd_connect(dap);
+       int retval = swd_connect(dap);
+       if (retval != ERROR_OK)
+               LOG_ERROR("SWD connect failed");
+       return retval;
 }
 
 static struct transport swd_transport = {