2015-03-12 06:34 AM
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-link2015-03-12 08:29 AM
That's because when you go to debug mode, pins are defined as ''debug'' purpose, and PB3 is SWO pin for SWD.
2015-03-12 08:32 AM
That's because when you go to debug mode, pins are defined as ''debug'' purpose, and PB3 is SWO pin for SWD.
2015-03-12 08:56 AM
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);2015-03-14 05:17 AM
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).2024-06-21 02:06 AM
Someone in my team is having the same problem with a Bare Metal project using IAR and STM32F4.
The SPI works correctly on SPI1 until execution is paused with the debugger, then the SPI clock on PB3 does not function correctly once the program is continued.
We do not see this behaviour with a Cube project, as in, we can pause and then continue, and the SPI1 clock on PB3 continues.
In the cube we have selected Debug Serial Wire.
We have inspected the DBG, GPIOB, SYSCFG, and Debug registers and they are both identical. We have looked through the IAR .ewd and .ewp files and they are the same.
Can anyone please advise?
2024-06-25 01:23 AM
For anyone else struggling we found the problem:
During debug, under ST-LINK drop down and the SWO Configuration Options, ITM stimulus 0 had options ticked. This makes IAR hijack the SWO pin. Untick to Disable this and it will update the file stored in EWARM>Settings, and will pause and continue during debug now.