cancel
Showing results for 
Search instead for 
Did you mean: 

Error in Initializing ST-Link device

adrian239955_stm1_st
Associate II
Posted on July 02, 2010 at 15:04

Error in Initializing ST-Link device

1 REPLY 1
adrian239955_stm1_st
Associate II
Posted on May 17, 2011 at 13:57

Solved: I think I was confused by the fact that I had apparenty got 2-wire SWD debug working between TrueSudio and ST-Link. Because of this I focussed on the hardware as the cause of the problem. But in my haste to regain the JTAG lines in my program code I used:

AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE;

But now I see that the three SWJ_CFG bits in AFIO_MAPR register are only writable so the read/modify/write instruction I used to set them would give unpredictable results. I got lucky for long enough to distract me from the proper operation:

GPIO_PinRemapConfig(GPIO_Remap_SWJ_NoJTRST, ENABLE);