I have built a code for AT91R4008 in keil and now I want to debug it by J-Link 14 pin on pcb. But when I connect the J-Link to the USB port of my pc and the 14 pin Jtag IDE connector on pcb, keil does not recognize anything. Even windows find j-link and install the driver, but there is no change in keil and when I click on start debug session an error comes saying:
Target DLL has been cancelled. Debugger aborted!
Without connecting the j-link to the pc, if you click on start debug session, this error will be announced too.
I have searched a lot about debugging with j-link but I couldn't find any solution.
I retried with J-Link commander, it finds the chip but when I use <unlock kinetis> command, the below error messages appear: could not reset error in ctrl/statc register. unblocking device... error: read from dp/ap register failed!
And when I use <erase> command, the below error message appears: ERROR: erase returned with error code -1
In brief, the j-link connected successfully to the pcb but I couldn't program arm7.
<unlock kinetis>? It's an ATMEL part, not a KINETIS/FREESCALE part.
It's a very antiquated part, are you sure you can flash it via JTAG? Probably need an applet to support whatever external flash you have on the device. Looked at J-Flash?
In Keil, you'd probably want to target the internal SRAM (Target RAM + SAM-ICE), and create a debugger script (.ini) to download the code into RAM and execute it from there.
C:\Keil421\ARM\Boards\Atmel\EB40A\Hello\Hello.c