I got a problem when I tried to verify whether the IIC SCL pin and the STLINK SWCLK pin could be connected to the same GF pin. The hardware design is as below: [enter image description here](https://i.stack.imgur.com/YQgX8.png)

Previously, I have done tests on the MCU STM32F412. The results shows that when the IIC SCL pin and the STLINK SWCLK pin are connected to the same GF pin(i.e. CASE 1), signals from IIC host(Aardvark v5.15) will be regarded as those from STLINK, and may cause MCU entering debug mode during IIC communication. In CASE 2, there would be no problem. Now I want to do similar tests on MCU STM32H563. [enter image description here](https://i.stack.imgur.com/7ugEF.png) STM32H5 Nucleo-144 board(order code NUCLEO-H563ZI) is adopted, PA13 and PA14 are shared with SWD signals connected to STLINK-V3EC. So I connect PA14(SWCLK) to the SCL pin of IIC host(Aardvark v5.15) and use a oscilloscope to record pulses on this line. The test board and IIC host share the same GND. Then I use the IIC host to launch a READ/WRITE IIC communication with the test board NUCLEO-H563ZI, however I could see no signals on the oscilloscope. It means, the SCL signals from IIC host cannot drive the SWCLK line low. I also tried to disconnect PA14 and the SCL pin of IIC host, as a result there were IIC SCL signals on SCL line while IIC communication. And there were SWCLK signals on PA14 while downloading MCU firmware. I guess these phenomenon are due to the hardware design of STLINK but I cannot completely understand the schematic. I am not good at English, any question please ask me. Thanks very much!

1

There are 1 answers

1
0___________ On

No. Debug pins have to be not used only for debugging. If you use them as other role pins, the debug will not work.

BTW SWDIO & SWCLK have nothing in common with I2C interface.

So I connect PA14(SWCLK) to the SCL pin of IIC host(Aardvark v5.15) and use a oscilloscope to record pulses on this line.

Nothing will happen as SWD is not I2C.

Of course if you micro shares debug pins with I2C then your program can change the pin configuration, but you will not be able to debug anymore. You will be able to upload new software by connecting under reset.