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.
In the J-Link 'Cortex-M Target Driver Setup' dialog:
http://www.keil.com/support/man/docs/jlink/jLink_cortexDebug.htm
The following steps are based off of www.keil.com/.../ulink2_trblshooting.htm
*On the top left of the dialog, can you see the J-Link serial number?
*On the top right of the dialog, next to SWD, can you see the ARM CoreSight device ID? - If not, the device may be locked up.
If the device is locked up, -in the middle of the dialog, in the 'Debug' box, for 'Connect:' change the drop down from 'Normal' to 'Under Reset'
http://www.keil.com/support/man/docs/jlink/jlink_conf_debug.htm
Now, regardless of what is running on the device, the J-Link will try to connect. Press the OK buttons to close the dialogs.
Try Flash->erase and see if it works.
This is similar to the procedure in
http://www.keil.com/support/docs/3566.htm
Then, Instead of running your code, try running a known working exmaple