From: wieniawski <wie...@ou...> - 2024-04-28 03:36:39
|
<html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <style> font{ line-height: 1.6; } ul,ol{ padding-left: 20px; list-style-position: inside; } </style> <div style="font-family:微软雅黑,Verdana,"Microsoft Yahei",SimSun,sans-serif;font-size:14px; line-height:1.6;"> <div> <div> <span>hi, </span> </div><div><span><br></span></div><div><span>I am trying to using OpenOCD using a FT232H board. (BTW, I am successfully using JLINK as the hardware adapter to connect to target STM32F407 board, so my software env and target board is OK).</span></div><div><span><br></span></div><div><span>and my command is</span></div><div><span>```bash</span></div><div><span>openocd -s d:/un-setup/OpenOCD/share/openocd/scripts/ -f interface/ftdi </span><span style="line-height: 1.6;">/ft232h-module-swd.cfg -f target/stm32f4x.cfg</span></div><div><span>```</span></div><div><span><br></span></div><div><span>However, it turns out an error:</span></div><div><span>Error: Error connecting DP: cannot read IDR.</span></div><div><span><br></span></div><div><span>I guess that is due to an bus connection error between my FT232H board and target STM32F407 board.</span></div><div><span><br></span></div><div><span>I noticed that there are several lines in swd.cfg file:</span></div><div><span># Adafruit FT232H JTAG SWD </span></div><div><span># Name Pin Name Func Func </span></div><div><span># D0 J1-3 ADBUS0 TCK SWDCLK </span></div><div><span># D1 J1-4 ADBUS1 TDO/DI SWDIO </span></div><div><span># D2 J1-5 ADBUS2 TDI/DO SWDIO</span></div><div><span><br></span></div><div><span>Where, there are to SWDIO pin defined. And I tried both of these two pins connected to target MCU, same error happens.</span></div><div><span><br></span></div><div><span>Then I realized that SWDIO is a bi-direction pin. So I tried to uncomment there 2 lines in swd.cfg file</span></div><div><span>#ftdi layout_signal TDO -data 0x0002 -oe 0x0002 </span></div><div><span>#ftdi layout_signal TDI -data 0x0004</span></div><div><span><br></span></div><div><span>However, it came out same error again.</span></div><div><span><br></span></div><div><span>So I am guessing:</span></div><div><span><br></span></div><div><span>Do I need to short FT232H AD1 and AD2 together?</span></div><div>Or is there any extra short circuit like using TDO as the output enable signal to TDI?</div><div><br></div><div>Thx,</div><div><br></div><div><br></div> <div> <span> <br> </span> </div> <div id="ntes-pcmac-signature" style="font-family:'微软雅黑'"> <div style="font-size:14px; padding: 0; margin:0;"> </div> </div> </div><!--😀--> </div> </body> </html> |