Skip to main content
MMath.10
Associate III
February 14, 2019
Solved

Get back SWD interface [resolved]

  • February 14, 2019
  • 3 replies
  • 1000 views

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

    This topic has been closed for replies.
    Best answer by Uwe Bonnes

    Or connect under reset.

    3 replies

    Tesla DeLorean
    Guru
    February 14, 2019

    Reset with BOOT0 pulled high, and erase ​

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Uwe Bonnes
    Uwe BonnesBest answer
    Chief
    February 14, 2019

    Or connect under reset.

    MMath.10
    MMath.10Author
    Associate III
    February 14, 2019

    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
    MMath.10Author
    Associate III
    March 4, 2019

    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...