I've run into something curious with v10.x J-Links. I have a project using the STM32F103ZG microcontroller and I'm currently using IAR EWARM 9.1.
Flashing and debugging with older J-Links (v8, v9.1 and Ultra v4.3) work just fine in either JTAG or SWD mode - JTAG has been the default since the beginning. However, when some people started using v10.0 or v10.1 J-Link, flash and debug would only work in SWD mode.
As an example, here's the Debug log from when I try to "Debug without download" using a v10.1 J-Link with JTAG configured instead of SWD. The J-Link's LED quickly flashes red/yellow (or red/green?) and I get a message "Failed to get CPU status after 4 retries".
Display All
This isn't a problem in the sense that simply changing to SWD works. But it was unexpected and there are some worries that maybe the JTAG isn't correct on the schematic/PCB layout (I'm not an EE so I can't begin to guess what's going on there - if anything). This happens with both a v10.0 and v10.1 J-Link. All older J-Links I've tried work fine in JTAG mode (and SWD mode).
For comparison, I have also attached a debug log of a J-Link Ultra+ v4.3 successfully using JTAG mode.
I'm wondering if this is something we should be concerned about, and if so do you have any suggestions for where we should look?
Flashing and debugging with older J-Links (v8, v9.1 and Ultra v4.3) work just fine in either JTAG or SWD mode - JTAG has been the default since the beginning. However, when some people started using v10.0 or v10.1 J-Link, flash and debug would only work in SWD mode.
As an example, here's the Debug log from when I try to "Debug without download" using a v10.1 J-Link with JTAG configured instead of SWD. The J-Link's LED quickly flashes red/yellow (or red/green?) and I get a message "Failed to get CPU status after 4 retries".
Source Code
- Tue May 04, 2021 07:58:28: IAR Embedded Workbench 9.10.1 (C:\Program Files\IAR Systems\Embedded Workbench 9.0\arm\bin\armPROC.dll)
- Tue May 04, 2021 07:58:28: Loaded macro file: C:\Program Files\IAR Systems\Embedded Workbench 9.0\arm\config\debugger\ST\STM32F1xx.dmac
- Tue May 04, 2021 07:58:28: JLINK command: ProjectFile = C:\devtrees\obfuscated\settings\obfuscated_Debug.jlink, return = 0
- Tue May 04, 2021 07:58:28: Device "STM32F103ZG" selected.
- Tue May 04, 2021 07:58:28: DLL version: V6.94d, compiled Feb 12 2021 15:56:38
- Tue May 04, 2021 07:58:28: Firmware: J-Link V10 compiled Apr 27 2021 16:35:48
- Tue May 04, 2021 07:58:28: JTAG speed is initially set to: 32 kHz
- Tue May 04, 2021 07:58:28: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:28: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:28: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:28: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:28: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:28: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:28: Warning: STM32: Connecting to CPU via connect under reset failed.
- Tue May 04, 2021 07:58:28: Hardware reset with strategy 0 was performed
- Tue May 04, 2021 07:58:28: Initial reset was performed
- Tue May 04, 2021 07:58:28: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:28: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:28: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:28: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:28: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:28: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:29: Warning: STM32: Connecting to CPU via connect under reset failed.
- Tue May 04, 2021 07:58:29: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:29: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:29: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:29: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:29: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:29: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:29: Warning: STM32: Connecting to CPU via connect under reset failed.
- Tue May 04, 2021 07:58:29: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:29: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:29: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:29: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:29: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:29: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:29: Warning: STM32: Connecting to CPU via connect under reset failed.
- Tue May 04, 2021 07:58:29: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:29: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:29: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:30: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:30: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:30: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:30: Warning: STM32: Connecting to CPU via connect under reset failed.
- Tue May 04, 2021 07:58:30: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:30: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:30: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:30: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:30: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:30: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:30: Warning: STM32: Connecting to CPU via connect under reset failed.
- Tue May 04, 2021 07:58:30: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:30: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:30: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:30: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:30: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:30: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:30: Warning: STM32: Connecting to CPU via connect under reset failed.
- Tue May 04, 2021 07:58:30: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:30: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:31: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:31: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:31: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:31: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:31: Warning: STM32: Connecting to CPU via connect under reset failed.
- Tue May 04, 2021 07:58:31: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:31: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:31: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:31: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:31: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:31: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:31: Warning: STM32: Connecting to CPU via connect under reset failed.
- Tue May 04, 2021 07:58:31: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:31: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:31: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:31: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:31: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:32: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:32: Warning: STM32: Connecting to CPU via connect under reset failed.
- Tue May 04, 2021 07:58:32: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:32: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:32: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:32: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:32: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:32: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:32: Warning: STM32: Connecting to CPU via connect under reset failed.
- Tue May 04, 2021 07:58:32: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:32: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:32: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:32: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:32: STM32 (connect): Can not attach to CPU. Trying connect under reset.
- Tue May 04, 2021 07:58:32: TotalIRLen = 9, IRPrint = 0x0011
- Tue May 04, 2021 07:58:32: Warning: STM32: Connecting to CPU via connect under reset failed.
- Tue May 04, 2021 08:00:47: Unloaded macro file: C:\Program Files\IAR Systems\Embedded Workbench 9.0\arm\config\debugger\ST\STM32F1xx.dmac
- Tue May 04, 2021 08:00:47: IAR Embedded Workbench 9.10.1 (C:\Program Files\IAR Systems\Embedded Workbench 9.0\arm\bin\armPROC.dll)
- Tue May 04, 2021 08:00:47: Loading the jlink driver
For comparison, I have also attached a debug log of a J-Link Ultra+ v4.3 successfully using JTAG mode.
I'm wondering if this is something we should be concerned about, and if so do you have any suggestions for where we should look?