Error: Flash Download failed - Target DLL has been cancelled

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error: Flash Download failed - Target DLL has been cancelled

16,707 Views
prasanthapplied
Contributor III

   I'm using lpc1768 controller for my application. While edit and download the source code to controller i got an error "unable to enter debug mode","Flash Download failed  -  Target DLL has been cancelled". After getting this error i can't download or erase flash memory. I search about this error to some sites and someone gives the suggestion of modify flash tools->debug settings. I tried that but no use. I attached a screenshot to it. I expect someone gives the solution. Thanks in advance.

lpc1768.PNG

lpc1768.1.PNG

Labels (1)
0 Kudos
8 Replies

12,916 Views
robertboys
Contributor IV

Hello

1) The ULINK2 operates in CMSIS-DAP mode by default - there is also a ULINK mode that needed except for older versions of uVision:  See ULINK2 User's Guide: Boot Mode Utility 

2) This means you can normally select either CMSIS-DAP or ULINK2/ME Cortex Debugger in uVision in the Debug tab.

There is one difference:  selecting CMSIS-DAP instead of ULINK2/ME in the Debug tab, you will not be able to use Serial Wire Viewer  (SWV).  This is an interesting data trace feature.  See www.keil.com/appnotes/docs/apnt_295.asp   Look at pages 17 through 20 for what you can use.  there is a printf utility tat doesn't use a UART.

3)  In this window shown here:  pastedImage_3.pngNormally Use Debug Driver is selected.  When selected it uses the debug adapter specified in the Debug tab instead of being specified as shown above in the Utilities tab.  This change was done because many people asked why they needed to specify their debug adapter in both Debug and Utilities tab.  This solves that question and is backwards compatible to the old way of dual specifying.

4) If you have a ULINK2 or ULINK-ME - use ULKIN2/ME Cortex Debugger instead of CMSIS-DAP mode especially if you want SWV.  If you do not, I don't think it matters which you choose:  CMSIS-DAP works essentially the same.

5)  In Settings in Configure Flash Menu Command - make sure  a valid flash programming algorithm is selected.

6) For LPC1768, try selecting RESET as shown instead of Autodetect as shown in one of the screens above.pastedImage_4.png

 7)  You can also try and select Verify Code Download and unselect Download to Flash: This an 6) are default for the LPC1768 Keil MCB1700 board.

  pastedImage_1.png

I use a LPC1768 board for my demos and I have never had any flash programming errors unless there were errors in the compilation process and no .axf executable is created.

Bob

ARM/Keil

0 Kudos

12,916 Views
prasanthapplied
Contributor III

Dear Robert,

                  Thanks a lot for sharing this information with me. They really helped me to know a lot about keil IDE and gives a hope to move further projects with lpc1768 controller.

0 Kudos

12,916 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello prasanth R,

   From your picture, we can find that your MDK project is using the ULINK debugger in default.

   Please check your debugger, what the debug you are using?

   Now, take my LPCXpresso LPC1769 board as an example, my on board debugger is:CMSIS DAP.

   So, I need to modify the options debug to CMSIS-DAP debugger.

6.jpg

pastedImage_2.png

So, just modify the options debugger, and utilities debugger to your real debugger interface.

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

12,916 Views
prasanthapplied
Contributor III

Dear Kerry Zhou,

                   Thank you very much for your response. I'm using ULINK2 debugger for my project. It gets recovered by computer hardware tools. I attached a screenshot to it.

1..PNG

   Debug and Utilities settings has a right debugger selection

2..PNG

3..PNG

   I thought debugger selection is not a problem. Because i can read SW device IDCODE. 4..PNG

         I tried lots of times to download a program. I getting an error of "cannot access memory" or "cannot enter debug mode". I don't have an idea to solve it. Please suggest some other solutions to solve this problem.

0 Kudos

12,916 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello prasanth R,

   Please try to modify the debugger to CMSIS-DAP

pastedImage_1.png

Then try again.

 If you still have problem, please download the according lpcopen code, and try again, or you can send me your project if you are not mind, I will help you to check on my side.


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

12,916 Views
prasanthapplied
Contributor III

Dear Kerry Zhou,

             Thanks again for your reply. I'm sure debugger selection is not a problem. I tried lpc open examples "easyweb"  Ethernet application to my board. 

             Now my board getting work itself. While problem occurred i tried to erase my controller flash frequently using "keil IDE","mcu expressoIDE" and "flash magic" but there is no use. After some 3 days surprisingly it get erased by "MCU Expresso IDE". After that erase my board gets works fine. It gets programmed by keil IDE.

0 Kudos

12,916 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello prasanth R,

   Thank you for your updated information, next time, please also check this configuration:

pastedImage_1.png


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

12,916 Views
prasanthapplied
Contributor III

Dear Kerry,

             Sure i will check it before download a program. Thanks.

Have a great day,

Prasanth.

0 Kudos