连接 DP 时出错:无法读取 IDR-无法建立连接,因为目标机器主动拒绝它

Error connecting DP: cannot read IDR-No connection could be made because target machine actively refused it

我第一次可以编程和调试这个项目。但问题是我无法再次重新编程或调试。芯片上没有引导加载程序。与该芯片通信的唯一方法是 SWD。作为调试器,我使用的是 Atmel ice。微芯片是 SAMD21E16B-U。该项目由 Atmel Start 创建。 Visual Studio 用作导入项目的 IDE。

再次调试后,错误为:

如果你能指导我如何重新编程这个芯片,我真的很感激?或者我应该寻找哪些信息。提前感谢您提供任何有用的建议。

以下步骤解决了我的问题。我认为擦除我的芯片有助于重新编程芯片。我不确定究竟是哪一步导致了错误。但是在这些步骤之后,我没有得到那个错误。

  • 选择正确的芯片:samd21e16b 而不是 samd21e16b-U(第一个选择是基于原理图。我的原理图不正确(查看我们板上的物理芯片或使用 microchip studio。检测到 Microchip studio适合我的芯片)。我在创建项目时选择了错误的设备(例如,我们的设备具有不同的 SRAM、闪存和封装。))。然后,我需要重新设置并选择合适的芯片。
  • 通过 microchip studio 擦除芯片并能够重新编程。所以,我正在使用 microchip studio 擦除芯片并返回 visual studio,然后重新编程或调试它
  • 检查电源连接(通过 SWD 连接器连接 Vcc 3.3 和 调试前确保 Atmel ice 上的绿灯亮起(Atmel ice 上的绿色 LED 显示芯片电源正常) 另外,我应该确保我的芯片通过 USB 连接到电脑。可能你的芯片供电不一样)
  • 我没有将调试器从 Atmel ice 更改为 J-Link,但这是 visualGDB (sysProgs) 支持团队提到的解决方案。我只会简单地添加他们的报价。可能对想通过visual studio解决问题,复位芯片的朋友有所帮助。但我没有更改我的调试器或没有配置 openOCD。我使用 microchip studio 并重置了芯片。

VisualGDB Support team: This looks like a device connectivity issue rather than something VisualGDB-specific. Our best advice would be to try using Segger J-Link. It comes with its own fully supported replacement for OpenOCD, which generally works better in many edge cases. VisualGDB supports both OpenOCD and J-Link software, so all the features you previously used will continue working the same way. VisualGDB does not manage resetting/erasing directly. It simply launches the open-source OpenOCD tool that handles the low-level communication with the target. You might be able to configure OpenOCD to change the reset behavior by editing the OpenOCD script files, however, this is something to do at your own risk and it may require extensive research into OpenOCD internals. If you are looking for an easy out-of-the-box solution, please consider using Segger J-Link instead.