cancel
Showing results for 
Search instead for 
Did you mean: 

ST-Link Connection Error Using SWD

igal
Associate II
Posted on October 31, 2012 at 15:49

Hi all,

I used STM32F4Discovery successfully using SWD and IAR to develop my application.

Today I got my boards, they have STM32F405RG on them (the Discovery has the 407).

I tried to connect to the board using Segger J-Link (I setup the correct options in the project options) but it could not connect.

So, I removed SB11 from the Discovery board and connected the SWD header to my board. Initially, when the board is ''virgin'' it will seem to connect but not reach 'main' in the application, and there will be no response from the MCU on the board.

Once the board is not ''virgin'' anymore the ST-Link gives ''USB Connection Error'' or ''Reset failed - Target not halted'' message, followed by ''Failed to load flash loader....''.

The SWDIO pin has 100K pullup, the NRST has 100K pullup (initially 51.1K but I tried to mimic the Discovery board once nothing worked), BOOT0 is pulled low using 510 Ohm as in the Discovery board.

I'm sure my code is not to blame since I use it frequently on the Discovery board.

I looked at the NRST pin and it will not drop to 0, seems the ST-Link has a problem pulling it low, it has some kind of noise whenever I try to use the ST-Link.

I attached a drawing (PDF)

Any ideas?

Thank you

#st-link #swd #stm32
1 REPLY 1
igal
Associate II
Posted on November 05, 2012 at 11:48

Well, I found the problem.

There were two:

1. My segger debugger didn't support SWD.

2. On the Discovery board there was 8MHz crystal, and on my board there was 25MHz crystal, since I developed my app on the Discovery I could burn the chip on my board once and then it would hang, preventing further burns.

I temporarily pulled Boot0 high and burned the chip after adjusting the code, and now everything is OK