Java ISP Programmer

I've been working on everything but a PC lately and programming my prototype, means I have to go back to the PC to flash the binary. As the only JTAG adapter I have is the LPC-Link(it only works on windows), so I've hacked together this Java ISP Programmer. This means I can program my prototype board using the web base mbed tools. On a Mac or a Linux based workstation and using a simple command. Or you could embed it into your java application, if you have any improvements please share them.

 

Project hosted on GITHUB

https://github.com/tecnosys/NXP-LPC17xx-Java-ISP-Programmer

I use the gnu.io RXTX serial package as there are drivers for 32bit/64bit Windows & 32bit/64bit Mac + 32bit/64bit Linux

 

Compiled jar for examples below

LPC17xxISP.jar

 

Find the serial port to use

localhost:admin$ java -jar LPC17xxISP.jar --listports

Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7

/dev/tty.SLAB_USBtoUART - Serial

 

Flashing the device

localhost:admin$ java -jar LPC17xxISP.jar --dtr --go --port=/dev/tty.SLAB_USBtoUART --binary=/Console_LPC1768.bin 

Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
RXTX Warning:  Removing stale lock file. /var/lock/LK.005.010.014
RTS: true DTR:true
RTS: false DTR:false
Flashing:512 / 11
.......................................................
Complete

 

Notes

The current implementation is very very basic.
RXTX Java JNI library is required to be installed (www.rxtx.org)
RTS/DTR if available will pull the device into ISP automatically.

(Version 26/7/2010)

Added GO isp command, saves unplugging device to restart it 
shows checksum before flash (just for debugging purposes atm)

 

(New Version 24/10/2010)

** Checksum fix


7 comments

26 Jul 2010

Does this work through the LPC-Link or through the built in serial bootloader?

27 Jul 2010

through the built in serial bootloader

27 Oct 2011 . Edited: 27 Oct 2011

It looks like the link is broken

28 Oct 2011

fixed

28 Oct 2011 . Edited: 28 Oct 2011

the methods are public so you could wrap it up in a interface

 

import gnu.io.*;      //RXTX libs must be hanging around 

public static void main(String[] args)
{
   try {

            new LPC17xx("/dev/tty.SLAB_USBtoUART", "/test_LPC1768.bin");


        } catch (Exception e) {
            e.printStackTrace();
        }
}

28 Oct 2011 . Edited: 28 Oct 2011

If you wanna improve it, stuff like verification as its flashing would be good.

https://github.com/tecnosys/NXP-LPC17xx-Java-ISP-Programmer

05 Mar 2013

Jason,

I am planning to run ISP through a RS485 tranceiver. I can pull low the enable with a large value transistor if I need to but this does not allow for transmit from the MCU. It looks like you code basically ignores the sent characters from the MCU. Is this true? Have you had good luck doing this?

Thanks for the help

You need to log in to post a comment