Skip to main content
MMath.10
Associate III
Feb 14, 2019 12:51 PM UTC
Solved

Get back SWD interface [resolved]

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.
    Uwe Bonnes
    Uwe BonnesBest answer
    Chief
    Feb 14, 2019 1:23 PM UTC

    Or connect under reset.

    4 replies

    Tesla DeLorean
    Guru
    Feb 14, 2019 12:55 PM UTC

    Reset with BOOT0 pulled high, and erase ​

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Uwe Bonnes
    Uwe BonnesBest answer
    Chief
    Feb 14, 2019 1:23 PM UTC

    Or connect under reset.

    MMath.10
    MMath.10Author
    Associate III
    Feb 14, 2019 2:00 PM UTC

    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
    Mar 4, 2019 4:00 PM UTC

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