I have 3 HoverGames drones and I am trying to write the Bootloader and the Firmware using a JLink Mini (included in the kit). The process worked succesfully for the first 2 FMUs but fails at the third. Below you have the the JLink console output of the failing one.
The main problem (as I understand it) seems to be that the JLink cannot recognize the Cortex-M4 although this worked for the other 2 FMUs. Can you advise me what can I do ?
$ JLinkExe -log JLink.log
SEGGER J-Link Commander V7.94g (Compiled Jan 24 2024 15:54:29)
DLL version V7.94g, compiled Jan 24 2024 15:54:06
Connecting to J-Link via USB...O.K.
Firmware: J-Link EDU Mini V1 compiled Jan 24 2024 12:08:08
Hardware version: V1.00
J-Link uptime (since boot): 0d 01h 31m 59s
S/N: 801030387
License(s): FlashBP, GDB
USB speed mode: Full speed (12 MBit/s)
VTref=3.251V
Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: MK66FN2M0XXX18
Type '?' for selection dialog
Device>?
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>
Device "MK66FN2M0XXX18" selected.
Connecting to target via SWD
InitTarget()
SWD selected. Executing JTAG -> SWD switching sequence.
Readout protection is set and mass erase is disabled. J-Link cannot unprotect the device.
Found SW-DP with ID 0x2BA01477
DPIDR: 0x2BA01477
CoreSight SoC-400 or earlier
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x001C0000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Not an AHB-AP
Attach to CPU failed. Executing connect under reset.
DPIDR: 0x2BA01477
CoreSight SoC-400 or earlier
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x001C0000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Not an AHB-AP
Could not find core in Coresight setup
InitTarget()
SWD selected. Executing JTAG -> SWD switching sequence.
Readout protection is set and mass erase is disabled. J-Link cannot unprotect the device.
Found SW-DP with ID 0x2BA01477
DPIDR: 0x2BA01477
CoreSight SoC-400 or earlier
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x001C0000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Not an AHB-AP
Attach to CPU failed. Executing connect under reset.
DPIDR: 0x2BA01477
CoreSight SoC-400 or earlier
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x001C0000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Not an AHB-AP
Could not find core in Coresight setup
Cannot connect to target.
J-Link>exit
In case this helps here is the connection sequence from one of the 2 FMU's that do work as expected:
$ JLinkExe
SEGGER J-Link Commander V7.94g (Compiled Jan 24 2024 15:54:29)
DLL version V7.94g, compiled Jan 24 2024 15:54:06
Connecting to J-Link via USB...O.K.
Firmware: J-Link EDU Mini V1 compiled Jan 24 2024 12:08:08
Hardware version: V1.00
J-Link uptime (since boot): 0d 00h 00m 50s
S/N: 801030387
License(s): FlashBP, GDB
USB speed mode: Full speed (12 MBit/s)
VTref=3.297V
Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: MK66FN2M0XXX18
Type '?' for selection dialog
Device>
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>s
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>
Device "MK66FN2M0XXX18" selected.
Connecting to target via SWD
InitTarget()
SWD selected. Executing JTAG -> SWD switching sequence.
Found SW-DP with ID 0x2BA01477
DPIDR: 0x2BA01477
CoreSight SoC-400 or earlier
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x001C0000)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
[0][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
[0][1]: E0001000 CID B105E00D PID 003BB002 DWT
[0][2]: E0002000 CID B105E00D PID 002BB003 FPB
[0][3]: E0000000 CID B105E00D PID 003BB001 ITM
[0][4]: E0040000 CID B105900D PID 000BB9A1 TPIU
[0][5]: E0041000 CID B105900D PID 000BB925 ETM
[0][6]: E0042000 CID B105900D PID 003BB907 ETB
[0][7]: E0043000 CID B105900D PID 001BB908 CSTF
Memory zones:
Zone: "Default" Description: Default access mode
Cortex-M4 identified.
J-Link>