cancel
Showing results for 
Search instead for 
Did you mean: 

Get back SWD interface [resolved]

MMath.10
Associate II

Hi,

I use SWD interface to configure my STM32 board.

It all worked out, but I changed #define and moved to a part of the program that disabled the sw interface.

Now my STLINK/V2 can not connect to the device.

Do you have an idea to erase the chip or restore the SWD interface?

#else /* DEBUG */
  /* sw interface off*/
//  GPIO_InitTypeDef GPIO_InitStructure ={0};
//
//  GPIO_InitStructure.Mode   = GPIO_MODE_ANALOG;
//  GPIO_InitStructure.Pull   = GPIO_NOPULL;
//  GPIO_InitStructure.Pin    = (GPIO_PIN_13 | GPIO_PIN_14);
//  __GPIOA_CLK_ENABLE() ;
//  HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);
//  __GPIOA_CLK_DISABLE() ;
//
//  __HAL_RCC_DBGMCU_CLK_ENABLE( );
//  HAL_DBGMCU_DisableDBGSleepMode( );
//  HAL_DBGMCU_DisableDBGStopMode( );
//  HAL_DBGMCU_DisableDBGStandbyMode( );
//  __HAL_RCC_DBGMCU_CLK_DISABLE( );
#endif

1 ACCEPTED SOLUTION

Accepted Solutions
Uwe Bonnes
Principal III

Or connect under reset.

View solution in original post

4 REPLIES 4

Reset with BOOT0 pulled high, and erase ​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Uwe Bonnes
Principal III

Or connect under reset.

Thank to you too @Community member​  @Uwe Bonnes​ 

I don't try the first method because i've a 0402 resistance in pull down but it could have been done if necessary.

Just to configure ST-LINK in another way

0690X000006Dbo3QAC.png

MMath.10
Associate II

Aie,

another problem.

I unplug my SWD with power applied and my STM32 is locked with a 3.5W conssomation..

If i put MCU_nRST to GND the power is 1.85W.

I try to put BOOT0 to high but nothing better...