SWD programmer

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

SWD programmer

4,002 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JohnR on Wed Jul 13 17:25:50 MST 2011
Hi,

We have developed a data acqusition board using a LPC1343 (based originally on the LPCXpresso board) that we currently program using the LPC Link half of the LPCXpresso board and the LPCXpresso IDE.

Now we want to develop a programmer for in-field use that would use the SWD + Reset lines - this would be simply a programmer -no debug or IDE needed .

Ideally it would be a simple Windows USB application that reads in and then downloads a .axf or a .bin to the target.

I have looked at the FDI [FONT=Times New Roman]USB-ICP-LPC2K programmer but I can't get any confirmation that it will use the 2-line SWD port. I have also looked at the DangerousPrototypes card but again I am not sure how much SWD work has been done.[/FONT]

Any ideas would be welome. I would rather not have to reinvent the wheel if something already exists.

John.
[FONT=Times New Roman][/FONT]
[FONT=Times New Roman]
[/FONT]
0 Kudos
Reply
14 Replies

3,312 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Sun Jul 17 06:23:28 MST 2011
Unfortunately NXP decided not to include the USB ISP in any other device than the lpc134x - too bad for us ...
Next to the App. Note pointed out by Zero, Code Red provided a similar USB bootloader using the LPCUSB stack.
That ready to run LPCXpresso project can be found in the examples folder that is part of the LPCXpresso installations: examples/nxp/lpc1000/lpc17xx/RDB1768cmsis.zip, see the RDB1768cmsis_usb_bootloader project.

There is no CRP support and Code Red only uses the 32 kB Flash blocks (leaving the lower 64 kB empty) but it works great.

Rob
0 Kudos
Reply

3,312 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sun Jul 17 05:12:19 MST 2011
No :(

See:
http://ics.nxp.com/support/documents/microcontrollers/?scope=LPC1788&sort=date

with
http://www.nxp.com/documents/application_note/AN10866.pdf
0 Kudos
Reply

3,312 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JohnR on Sun Jul 17 05:01:06 MST 2011
Thanks for the reference.

Can the LPC1768 be reprogrammed the same way?

John.
0 Kudos
Reply

3,312 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_USA on Fri Jul 15 15:50:45 MST 2011
Check out the app note AN10986 USB In-System Programming with the LPC1300. It has more information about USB ISP and example code for Windows, Linux, and MacOS.

http://ics.nxp.com/support/documents/microcontrollers/zip/an10986.zip
0 Kudos
Reply

3,312 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kendwyer on Fri Jul 15 15:16:59 MST 2011
This is related to the BootROM USB drivers CH19

"If the USB ISP mode is entered on power-up (see Section 19.3), the memory is not
initialized, and no user code is executed which could write to this memory location.
Therefore the device times out when first connected to the Windows operating
system, and the MSD disk only appears after a time-out and retry, which takes 45 sec
or longer. A work-around for the time-out issue is not available."
0 Kudos
Reply

3,312 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JohnR on Fri Jul 15 07:42:02 MST 2011
Thanks for the reply.

My copy of the user manual UM10375 has the USB stuff in Chapter 11. Is this what you were referring to?
[B][FONT=Arial][SIZE=7][COLOR=#005042][FONT=Arial][SIZE=7][COLOR=#005042][FONT=Arial][SIZE=7][COLOR=#005042]
[/B][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
Quote:

[FONT=Arial][SIZE=2][FONT=Arial][SIZE=2][LEFT]On-chip RAM from address 0x1000 0050 to 0x1000 0180 is used by the USB driver. This
address range should not be used by the application. For applications using the on-chip
USB driver, the linker control file should be modified appropriately to prevent usage of this[/LEFT]
area for the application’s variable storage
[/SIZE][/FONT][/SIZE][/FONT]




JOhn.
0 Kudos
Reply

3,312 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kendwyer on Fri Jul 15 07:08:59 MST 2011
The driver is the standard Windows Mass Storage Class driver, so no need to go looking for them.
There is one caveat to this approach, refer to UM Chapter 19 -Section 19.2.1
0 Kudos
Reply

3,312 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JohnR on Fri Jul 15 05:53:25 MST 2011

Quote: Rob65

After installation of the drivers you'll see a virtual disk



What are the drivers you refer to?

Thanks again for the help.

John.
0 Kudos
Reply

3,312 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Thu Jul 14 07:25:55 MST 2011

Quote: JohnR
I really should read spec sheets properly


:D

I had some problems finding it again ...
Pull P0.3 high and the BL-EN pin (P0.1) low during reset.
After installation of the drivers you'll see a virtual disk with an firmware.bin file. Remove the file from that disc to erase the flash, then copy the new file to the drive.

Works much faster than downloading via SWD or uart SPI.

Regards,

Rob
0 Kudos
Reply

3,312 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JohnR on Thu Jul 14 05:32:20 MST 2011
I really should read spec sheets properly - I did not even realise that the LPC1343 has a USB mass storage device.

Thanks so much.

John.
0 Kudos
Reply

3,312 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Thu Jul 14 04:30:11 MST 2011
Why not use the USB download that is available in the LPC1343 bootROM ?
This will just present you with a mass storage device. You can then easily drag & drop the new .bin file.

Rob
0 Kudos
Reply

3,312 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JohnR on Thu Jul 14 04:13:37 MST 2011
Thank you both.

I had seen the download utility before but it seems a pity to discard the LPCXpresso side just to get the LPC-Link part?

But maybe that is the most economical way.

JOhn.
0 Kudos
Reply

3,312 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Jul 13 23:45:52 MST 2011

Quote: JohnR
Hi,

We have developed a data acqusition board using a LPC1343 (based originally on the LPCXpresso board) that we currently program using the LPC Link half of the LPCXpresso board and the LPCXpresso IDE.

Now we want to develop a programmer for in-field use that would use the SWD + Reset lines - this would be simply a programmer -no debug or IDE needed .



You are aware that you can invoked the LPC-Link flash programmer from the command line?

http://support.code-red-tech.com/CodeRedWiki/CommandLineFlashProgramming

Regards,
CodeRedSupport
0 Kudos
Reply

3,312 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by domen on Wed Jul 13 23:29:14 MST 2011
Why not ISP?
0 Kudos
Reply