LPCxpresso cannot flash LPC1769 in Keil or LPCXpresso IDE

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

LPCxpresso cannot flash LPC1769 in Keil or LPCXpresso IDE

5,530 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tomas Frcek on Fri May 29 04:09:30 MST 2015
Hello,

I have a LPCXpresso LPC-Link 2 board that came with connected  LPCXpresso LPC1769 board. I physicaly severed the boards at J4 and connected the GND, JTAG_RESETX, JTAG_TCLK_SWCLKX, JTAG_TMS_SWDIOX and VIO 3V3X pins of the Link 2 board and target board.

Using the LPC-Link 2 Configuration Tool I programmed the LPC-Link 2 board with the LPC-Link2 CMSIS-DAP debugger with bridges image, following the steps described in the configuration tool exactly. The process completed successfuly. During this process I also had the connections to the target LPCXpresso 1769 board severed.

I downloaded LPCOpen examples projects for Keil, opened the workspace with example projects for peripherals, successfuly built all the projects. However, in the "Options for target" window, all these projects had set the ULINK2 debugger (in the Utilities and Debug cards). I simply tried to change these options to CMSIS-DAP Debugger, but when I tried to flash the example program, I received the following error:

AGDI - Cortex-M Error
No Debug Unit Device found

Than I tried to cehck the option "Use External Tool for Flash Programming", because I figured that is what I'm trying to do :) I set the line Command to:
C:\nxp\LPCXpresso_7.6.2_326\lpcxpresso\bin\crt_emu_cm3_nxp.exe
And Arguments to:
-wire=hid -pLPC1769 -load-base=0x0000 -flash-load=C:\Keil_v5\Projects\can_first_uvision_lpc1768\can_first\buildcan_first_LPC1768.bin

Now I tried to download the program, a black command line like window appeared for a moment, but than disappeard. Keil showed no error, but these lines appeared in the output:

Ni: LPCXpresso Debug Driver v7.6 (Jan 28 2015 22:21:02 - crt_emu_cm3_nxp.exe build 50)
Ed:02: Failed on connect: Ee(05). No matching emulator found - make sure power is on and not in use already.
Et:31: No connection to emulator device

So I decided to try the native IDE, the LPC Xpresso. I didnt change the programming of the LPC-Link 2 propgrammer. Like with Keil, I downloaded LPCOpen example projects, but now for the XPresso IDE. I Imported the projects, successfuly built and tried to debug. But I received the following error:

02: Failed on connect
Target marked as not debuggable.
Emu(0): Conn&Reset. Was: None. DpID: 00000000. CpuID: 00000000. Info: (null)

Is there something obviously wrong or something I'm missing in my approach?

Thank you for your advice!
0 Kudos
Reply
19 Replies

4,858 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Sat Jun 06 05:44:38 MST 2015

Quote: Tomas Frcek
I feel Im doing some very stupid mistake here...



I'm not sure in which condition your target board is in detail  :~

So I would suggest to do the basic tests:

If you want to avoid (PHY) power consumption problems you can desolder FB2...

Flash the target via UART (FlashMagic) with a simple blinky. Then you are sure that the target isn't damaged...

After that delete it, so you are sure that it's booting into ISP now...

Check your debug connection and pull-ups. In your case LPCXpresso1769 target board should work without additional resistors, but I would recommend to pull-up ISP and Reset...




0 Kudos
Reply

4,858 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LessThanZero on Fri Jun 05 07:40:55 MST 2015
Sorry, if all the connections check out, my conclusion is the board got damaged along the way. The MCU itself may be fine, so more likely it's the debug circuit. If you think you need to recheck, here's a couple of links I know about:

Design Considerations for Debug

LPCXpresso1769 board schematic

EDIT: By the way, if the LPC-LInk2 has booted the firmware, you should see LED1 flash once per second. Depending on the firmware, there may be multiple interfaces in your device list related to (LPC-Link2) CMSIS-DAP. This VID:PID is 1FC9:0090.

Next time you post a debug log, it would be helpful if you post the entire log output during the connection attempt.
0 Kudos
Reply

4,858 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tomas Frcek on Fri Jun 05 00:51:24 MST 2015
I removed JP1, kept JP2, disconnected target from LPC-Link 2 and tried to boot into ISP. I connected pin 2.10 of the target to the GND, cycled power supply and removed the connection from P2.10 to the GND. Than I connected LPC-Link 2 back to the target and tried to enter a debug session in LPCXpresso 7.8 into the periph_blinky project from the LPCOpen library. In the debug options of the project, the following is set:

Debug connection: SWD
Emulator selection: CMSIS-DAP
Debug options template: NXP LPC17xx (*)

But the IDE cant find ANY compatible emulators or I receive this error, which I guess just says the same in other words:

02: Failed on connect
02: Failed on connect
Could not connect to core.
31: No connection to emulator device

I tried to put back the JP1 and received the following error:

02: Failed on connect
02: Failed on connect
Could not connect to core.
Emu(0): Conn&Reset. Was: None. DpID: 00000000. CpuID: 00000000. Info: (null)

I feel Im doing some very stupid mistake here, thanks for your advice!
0 Kudos
Reply

4,858 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Jun 04 06:42:47 MST 2015
Use LPCXpresso V7.8.0 with open JP1 and closed JP2  :)

LPCXpresso should then soft-boot DAP...

That's working here without problems with a LPCXpresso1769 target board (and external power supply)...

[img=640x267]http://www.lpcware.com/system/files/LPCXpresso1769_Target_0.JPG[/img]

It's also useful to boot into ISP (ground P2.10) and reconnect target board and LPC-link2...
0 Kudos
Reply

4,858 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tomas Frcek on Thu Jun 04 05:59:53 MST 2015
Yes, this is exactly what I have :) So I tried to disconnect GND and VCC pins and connected an external 3.3V power supply. And It seems to have solved something at least. I now receive different errors when trying to enter Debug session. In Keil:

No Cortex-M Device found in JTAG chain.
Please check the JTAG cable and the connected devices.

So I checked the JTAG connections using a multimeter and thay are all connected.

In LPCXpresso I received the following error:

02: Failed on connect
02: Failed on connect
Could not connect to core.
31: No connection to emulator device

This is using older version of LPCXpresso. I'll try to update and again, but I doubt it will solve this problem. I will also try using another target board that just became available to me :)
0 Kudos
Reply

4,858 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Jun 04 04:10:47 MST 2015

Quote: Tomas Frcek
What do you mean I have enough lines for SWD (without trace), but not JTAG? Should I try to connect everything from the J4?



What you are describing is a minimal (4-wire) SWD connection + VCC:

[img=640x360]http://www.lpcware.com/system/files/SWD_VCC.JPG[/img]

That's working with a working target board  :)

BTW: Link2 isn't a good power supply and LPC176xXpresso boards are consuming a lot of power (Ethernet PHY)  :((

So I would recommend to use an external 3.3V power supply or at least add a 100µF capacitor to VCC...
0 Kudos
Reply

4,858 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tomas Frcek on Thu Jun 04 02:33:55 MST 2015
I already programmed the LPC-Link 2 with the LPC-Link2 CMSIS-DAP debugger with bridges using the DFU programmer/LPC-Link 2 Configuration Tool v2.02.

The board is cut pretty clean and straight, I don't think it's damaged, but I guess I can't realy be sure. I dont have another board to try it with right now, so I will have to try latter. But LED2 lights on the target board when I connect everything (PC - LPC-LINK2 - LPCXpresso LPC1769). That at least means that the shared GND isn't the problem.

What do you mean I have enough lines for SWD (without trace), but not JTAG? Should I try to connect everything from the J4?
0 Kudos
Reply

4,858 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LessThanZero on Thu Jun 04 00:04:10 MST 2015
The LPC-Link2 is certainly compatible, but it uses a different debug utility program (crt_emu_cm_redlink) than the one you were trying to use. You have to use the correct utility. The LPC-Link2 can use ether CMSIS-DAP, or Redlink firmware. The Redlink firmware is deprecated in the latest LPCXpresso.

The next place to look is the J4 connections. Most people sever the J4 traces, and solder a dual row header at J4, rather than detach the two sides. That way, they can use the LPC-Link1 standalone, or reconnect the two sides (at J4) to debug the LPC1769. How do you know you didn't damage the LPC1769 side? I've ruined at least one trying to detach the two sides.

Othewise, there's nothing difficult about what you're trying to do. You have enough lines for SWD (without trace), but not JTAG. Definitely check the shared GND.

By the way, I'd recommend you update your installation. LPCXpresso_7.8.0_426 is now available.

LessThanZero
0 Kudos
Reply

4,858 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tomas Frcek on Wed Jun 03 23:15:35 MST 2015

Quote: R2D2

It's really difficult to understand your problem if you don't describe that in detail  :~

How did you connect it? WLAN   :D

Did you separate the target board from LPC-Link1 before  :quest:



Here is precisely the setup I have:

I have NXP LPC-Link 2 board.
I had a LPC-Link board with physicaly connected LPCXpresso LPC1769 target board. These two boards I sawed apart.

Now I'm trying to program the LPCXpresso LPC1769 target board with the LPC-Link 2 board. To that end I connected the LPC-Link 2 and LPCXpresso LPC1769 target board in the following way:

LPC-Link 2 J6 --- LPCXpresso LPC1769 J4
---
GND -- GND
JTAG_RESET -- JTAG_RESETX
JTAG_TCK_SWCLK -- JTAG_TCLK_SWCLKX
JTAG_TMS_SWDIO -- JTAG_TMS_SWDIOX
VIO_3V3ZZ -- VIO_3V3X

Could the problem be that Im trying to program the LPCXpresso LPC1769 target board (that was originaly hard locked to a LPC-Link board) with the LPC-Link 2 board and it isn't compatable?
0 Kudos
Reply

4,858 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LessThanZero on Tue Jun 02 07:57:55 MST 2015
The command-line you used to attempt to program flash is for the LPC-Link1, not the LPC-Link2. Back up a step. In the LPCXpresso IDE, create a debug configuration for your LPC1769 project and specify CMSIS-DAP as the emulator selection. You can use the Flash dialog to erase/program your image provided the debug connections are correct to the isolated LPC1769 side of the LPC-Link1 board. If you check the "Run flash command and copy to clipboard", you can see the dialog created command-line, if you want to run it from an MS-DOS shell.

LessThanZero
0 Kudos
Reply

4,858 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Tue Jun 02 05:58:18 MST 2015

Quote: Tomas Frcek
...from the other side I have connected a LPCXpresso LPC1769 board...



It's really difficult to understand your problem if you don't describe that in detail  :~

How did you connect it? WLAN   :D

Did you separate the target board from LPC-Link1 before  :quest:
0 Kudos
Reply

4,858 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tomas Frcek on Tue Jun 02 05:38:15 MST 2015
From the link you have provided, I have a LPC-Link2 board. This borad I have connected via USB to PC and from the other side I have connected a LPCXpresso LPC1769 board. With the LPCXpresso LPC1769 board disconnected, I used the configuration tool to flash the LPC-Link2 Board with LPC-Link2 CMSIS-DAP program image to be able to debug from Keil.
0 Kudos
Reply

4,857 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Jun 02 04:53:23 MST 2015
Can you confirm exactly what hardware you have? In your original post you said:


Quote:
I have a LPCXpresso LPC-Link 2 board that came with connected LPCXpresso LPC1769 board



But there is no LPCXpresso1769 board with a built in LPC-Link2. The LPCXpresso1769 is fitted with an LPC-Link1, which is not usable with Keil tools (or the LCT tool), and with the LPCXpresso IDE boots with very different firmware to the LPC-Link2.

So please look at this page:

http://www.lpcware.com/LPCXpressoBoards

and tell us what board you actually have?

Then tell us what modifications you have actually made?

Regards,
LPCXpresso Support
0 Kudos
Reply

4,856 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tomas Frcek on Tue Jun 02 00:52:24 MST 2015
Is the original Link2 firmware one of the four I see in the configuration tool (attached image), or can I download it somewhere and flash it using the tool?

Im using Windows 7 64bit and using Keil was not entirely up to me, however I just need to get one of the IDEs working, It doesen't realy matter to me which one :)
0 Kudos
Reply

4,857 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tomas Frcek on Tue Jun 02 00:51:14 MST 2015
Is the original Link2 firmware one of the four I see in the configuration tool (attached image), or can I download it somewhere and flash it using the tool?

Im using Windows 7 64bit and using Keil was not entirely up to me, however I just need to get one of the IDEs working, It doesen't realy matter to me which one

0 Kudos
Reply

4,857 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Fri May 29 11:07:52 MST 2015

Quote: Tomas Frcek

02: Failed on connect
Target marked as not debuggable.
Emu(0): Conn&Reset. Was: None. DpID: 00000000. CpuID: 00000000. Info: (null)



Common reasons for this error can be found at:
http://www.lpcware.com/content/faq/lpcxpresso/target-marked-not-debuggable

Given your hardware modifications, it might be useful to understand exactly how exactly are you connecting the probe to the target MCU?

Regards,
LPCXpresso Support
0 Kudos
Reply

4,857 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Fri May 29 05:36:51 MST 2015
I would recommend to flash the original Link2 firmware again and use LPCXpresso...

If debugging is still failing, boot into ISP:

http://www.lpcware.com/content/faq/lpcxpresso/regaining-debug-access

BTW: Which OS are you using and why are you not using LPCXpresso V7.7.2 ?
0 Kudos
Reply

4,857 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tomas Frcek on Fri May 29 05:22:31 MST 2015
Both J1 and J2 jumpers are in place.
0 Kudos
Reply

4,857 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Fri May 29 04:23:50 MST 2015
Did you close J2?
0 Kudos
Reply