lpclink requires target board running bootloader

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

lpclink requires target board running bootloader

728 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jderimig on Wed Dec 04 16:50:28 MST 2013
Newbie question.  I am using LPC1114 in target board maintaining the JTAG connections from LPC link.  However I cannot program the target with LPCLink unless I put the target board in bootloader mode.  Is this normal or is there an obvious answer to what I did wrong on the target board?

--john
0 Kudos
17 Replies

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jderimig on Thu Dec 05 16:09:25 MST 2013
Thanks R2D2.  I got it and i was right the first time.  Board has a fault in the SCK trace, new board but now I am confident I can get to work.  Again thanks much R2!

--john
0 Kudos

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Dec 05 15:43:50 MST 2013

Quote: jderimig
...to figure out the configuration settings.



Just change SCK_LOC and set this pin to SCK0:

LPC_IOCON->SCK_LOC = 0x01;         //set PIO2_11 SCK0
LPC_IOCON->PIO2_11 = 0x01;
 
0 Kudos

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jderimig on Thu Dec 05 15:28:05 MST 2013

Quote: R2D2
I'm still not sure which hardware / SWD connection you are using and which software you are flashing  :quest:

One of them is killing your SWD...

Anyway, after checking Hardware and Software I usually scope SWD lines at SWDIO / SWDCLK Pins (not Pads!!!). You should see there a clock signal (SWDCLK) and a bidirectional SWD data signal. A working data signal is showing a higher voltage at acknowledge bits (from target) and target data bits (about 0.2V with a 30cm SWD cable).

Another option is a damaged LPC. Did you try another board?



See my above edited post.  I did something wrong in my SPI setup.

Edit: Got the LPC-link communications and debug working like a Swiss watch now,  only now my SPI is not working, back to the user manual to figure out the configuration settings.
0 Kudos

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jderimig on Thu Dec 05 15:06:32 MST 2013
Just checked, I am not using PIO_10 as SPI clock, (am using PIO_6 for SPI clock).  But I need to check initialization code again to make sure I did not redefine PIO_10.

Edit:  Ok I thing I found the problem in my ssp setup.  got it working (debug lpclink connection) except now my spi doesn't work, but I think I am on to the solution now.
0 Kudos

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Dec 05 14:57:59 MST 2013
I'm still not sure which hardware / SWD connection you are using and which software you are flashing  :quest:

One of them is killing your SWD...

Anyway, after checking Hardware and Software I usually scope SWD lines at SWDIO / SWDCLK Pins (not Pads!!!). You should see there a clock signal (SWDCLK) and a bidirectional SWD data signal. A working data signal is showing a higher voltage at acknowledge bits (from target) and target data bits (about 0.2V with a 30cm SWD cable).

Another option is a damaged LPC. Did you try another board?
0 Kudos

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jderimig on Thu Dec 05 11:09:02 MST 2013

Quote: R2D2

Quote: jderimig
If I am using SPI and PIO0_10 as the clk for SPI will that prevent SWD?



Are you kidding?

Use PIO0_6 as SCK0 !!!!



LOL,  Thank you.  New board spin....
0 Kudos

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Dec 05 10:30:58 MST 2013

Quote: jderimig
If I am using SPI and PIO0_10 as the clk for SPI will that prevent SWD?



Are you kidding?

Use PIO0_6 as SCK0 !!!!
0 Kudos

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jderimig on Thu Dec 05 10:25:32 MST 2013
If I am using SPI and PIO0_10 as the clk for SPI will that prevent SWD?
0 Kudos

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Dec 05 10:15:46 MST 2013

Quote: jderimig

MOSI             [s] MOSI0[/s]



MOSI  :quest:

That's a working connection. Nowadays Reset isn't used, so you should get a working SWD with 2 wires (and GND):

J4-03 -SWDIO---- PIO1_3 (PIN39 @LQFP48)
J4-05 -SWDCLK- PIO0_10(PIN29 @LQFP48)
J4-11 -RESET---- PIO0_0 (PIN3  @LQFP48)
J4-15 -GND---


0 Kudos

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jderimig on Thu Dec 05 09:39:48 MST 2013

Quote: R2D2

Quote: jderimig
I soldered a header on the LPC-link board where I carefully cut it and run wires to a header I placed on the target board


That's all a little bit general. Which wires did you connect to which PIN?

Which error message is LPC-link showing?



Connections
LPCLink        Target
VIO                NC to target but has 10K to ResetX
TMS               PIO1-3/SWDIO
SCK               PIO0-10/SCK0  (maybe I should check if I redefined that pin)
MOSI              MOSI0
RESETX        PIO0-0/RESET
GND              GND

Error message on debug: 02: Failed on connect: Ee(07). Bad ACK returned from status - wire error
0 Kudos

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Dec 05 07:00:33 MST 2013

Quote: jderimig
I soldered a header on the LPC-link board where I carefully cut it and run wires to a header I placed on the target board


That's all a little bit general. Which wires did you connect to which PIN?

Which error message is LPC-link showing?
0 Kudos

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jderimig on Thu Dec 05 05:22:58 MST 2013

Quote: R2D2

IRC instead crystal shouldn't be a problem if you change your setup (in system_LPC11xx.c) to IRC.

How did you connect SWD (LPC-link J4 to target board)?



I soldered a header on the LPC-link board where I carefully cut it and run wires to a header I placed on the target board.  I have a logic analyzer I can put on those pins.  That might help if I knew what to look for.
0 Kudos

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Wed Dec 04 19:49:17 MST 2013

Quote: jderimig
Yes 10K pullups on those pins.



Good choice.


Quote: jderimig
I will try a simple sample flash (Blinky) and see what happens.
Edit: One difference between the target and the prototype is the target is using the internal oscillator instead of the crystal on the xpresso board.



IRC instead crystal shouldn't be a problem if you change your setup (in system_LPC11xx.c) to IRC.

How did you connect SWD (LPC-link J4 to target board)?
0 Kudos

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jderimig on Wed Dec 04 19:37:49 MST 2013

Quote: R2D2

Quote: jderimig
When I first built the target board I could not communicate with it at all with LPClink so I tried Flashmagic and was successful with that.  Ever since I am able to download a program from debug with LPCLink but only after putting it in ISP mode. After that LPC will not communicate with it anymore.



Sounds like a hardware problem with your board. Did you use pullups for Reset and ISP?

If you flash a LPCXpresso sample program (instead your own) you can avoid an occasional wrong SWD PIN setup.



Yes 10K pullups on those pins.  Well thanks for the suggestions, I will try a simple sample flash (Blinky) and see what happens.

Edit: One difference between the target and the prototype is the target is using the internal oscillator instead of the crystal on the xpresso board.
0 Kudos

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Wed Dec 04 19:04:34 MST 2013

Quote: jderimig
When I first built the target board I could not communicate with it at all with LPClink so I tried Flashmagic and was successful with that.  Ever since I am able to download a program from debug with LPCLink but only after putting it in ISP mode. After that LPC will not communicate with it anymore.



Sounds like a hardware problem with your board. Did you use pullups for Reset and ISP?

If you flash a LPCXpresso sample program (instead your own) you can avoid an occasional wrong SWD PIN setup.

0 Kudos

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jderimig on Wed Dec 04 18:50:34 MST 2013
I am not sure what you mean by the the first question.  When I first built the target board I could not communicate with it at all with LPClink so I tried Flashmagic and was successful with that.  Ever since I am able to download a program from debug with LPCLink but only after putting it in ISP mode. After that LPC will not communicate with it anymore.

The SWD pin is not otherwise used in the target so I did not change its function.  I more or less had the had the same pinouts on the LPC1114 expresso board when I ported design to the target board.
0 Kudos

720 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Wed Dec 04 17:48:59 MST 2013

Quote: jderimig
Is this normal or is there an obvious answer to what I did wrong on the target board?



No, that's not normal. There are several options for this behavior.

Did you flash a sample before? Did you change PIN functions of SWD?
0 Kudos