cancel
Showing results for 
Search instead for 
Did you mean: 

ST-LINK stoppes SPI clock

bob
Associate II
Posted on March 12, 2015 at 14:34

I have problems with my IAR and ST-LINK debugger tool. As soon as I start the debugger, the SPI clock (STM32F103R8 SPI1 at PB3) stops. I use the ST-LINK over SWD. What could I have done wrong?

#spi-st-link
4 REPLIES 4
tm3341
Associate II
Posted on March 12, 2015 at 16:29

That's because when you go to debug mode, pins are defined as ''debug'' purpose, and PB3 is SWO pin for SWD.

tm3341
Associate II
Posted on March 12, 2015 at 16:32

That's because when you go to debug mode, pins are defined as ''debug'' purpose, and PB3 is SWO pin for SWD.

bob
Associate II
Posted on March 12, 2015 at 16:56

As far as I can see in STM32F103R8T6LQFP-64_CD00161566 and STM32F10_refmanual__CD00171190,

SWDIO = PA13 and SWCLK = PA14

I use PB13 for SPI_CLK.

 /*JTAG-DP Disabled and SW-DP Enabled*/

      GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE);              /*JTAG-DP Disabled and SW-DP Enabled*/      

      /* Configure REmapped- SPI pins: SCK, MISO and MOSI*/

      GPIO_PinRemapConfig (GPIO_Remap_SPI1,ENABLE );

/*SPI_SCK_PIN             GPIO_Pin_3       SPI1    PB3*/

/*SPI_SCK_GPIO_PORT       GPIOB    PB*/

SPI_GPIO_InitStructure.GPIO_Pin = SPI_SCK_PIN ;

SPI_GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;

SPI_GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

GPIO_Init(SPI_SCK_GPIO_PORT, &SPI_GPIO_InitStructure);

tm3341
Associate II
Posted on March 14, 2015 at 13:17

And SWO pin is PB3.

You told about PB3 which is exact problem as I told you. Now you are saying that you use PB13.

Test on another SPI port (SCK pin).