cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with SWD Debugging on STM32F429I board.

VCsom.1
Associate

Hi Everyone,

For my university project I work on a simple SWD debugging of an ST32 board. First I would like to establish some communication between the 2 boards (like: write the memory of board no. 2 with board no. 1 one using DAP and blink a led in response on board no. 2)

I have two STM32F429I-DISC1 Boards with the following configuration (see the attachedimage at the end). The left one is the debugger board used for debugging the ToBeDebugged board. First I would only like to read the DPIDR register of the DAP protocol  from the 2B Debugged board using the SWD protocol (as it was suggested in many other posts) to see if the communication is working. I am using the STM32CubeIDE 1.3.0.

As far as I know on the 2B Debugged board no configuration shall be done to make SWD work. Yet I configured these pins to be active to avoid any possibility to use them for anything else accidentally. (attached image)

(Source: Application note: STM32 microcontroller debug toolbox)

I know that after reset the board is configured for the JTAG debug, so I have to change it to SWD.

(Source: RM0090 Reference manual STM32F429/439 advanced Arm®-based 32-bit MCUs) (atteched image)

Question 1: In some source on the web, I read that after this switching sequence two Idle cycles required (SWDIO driven low). If this is true could someone explain it to me why?

On the 2B debugged board there is a simple blinky program running in an infinite loop with toggleing a LED in every second.

For „base�? code  on the debugger board I am using ARM CMSIS version 4 DAP, of course with some slight modifications. For the code please see the attached image. (JtagToSwdSwitch function is my own, SWD Transfer is part of the CMSIS DAP code, I have also Configured the Dap_Config.h).

Question 2: My problem is that whatever I try to do the answer from the DAP is always ’111’, which is not a valid answer (O would expect one of the followings: 100,010,001). At least when I connect the Debugger Board SWDIO pin to the GND I get ’000’. Any ideas on what could go wrong would be appeciated.

I would gladly provide more details.

Thank you very much in advance

Viktor

0693W000000WYdGQAW.jpg0693W000000WYcwQAG.jpg0693W000000WYb7QAG.jpg0693W000000WYcDQAW.jpg0693W000000WYbyQAG.jpg0693W000000WYboQAG.jpg

2 REPLIES 2
TDK
Guru

You shouldn't need to do anything manually to switch to SWD. The ST-Link should take care of this for you. Or are you trying to create your own debugger program?

If you feel a post has answered your question, please click "Accept as Solution".

Yes I m trying to make my own debugger program. I take off the CN4 Jumper on the 2B Debugged Board and try to debug it with another board.