ISP protocol again changed?

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

ISP protocol again changed?

1,955 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by capiman on Wed Dec 05 14:38:18 MST 2012
Hello,

just started to adapt lpc21isp for new LPC812 (got it today on a LPCxpresso).

It looks like ISP protocol has changed compared to previous LPCxxxx.

But description in user manual seems to be not sufficient and wrong. Here are only some points:

1) According to User Manual UM10601 (Rev. 1 — 9 November 2012)
"21.5.1 UART Communication protocol
All UART ISP commands should be sent as single ASCII strings. Strings should be
terminated with Carriage Return (CR) and/or Line Feed (LF) control characters. Extra
<CR> and <LF> characters are ignored. All ISP responses are sent as <CR><LF>
terminated ASCII strings. Data is sent and received in plain binary format."

1A) Is it correct, that strings can be terminated with CR "and/or" (!!!) LF?
E.g. when sending 'U 23130(0A)', i get no answer (but only with LPC8xx, used the same string with other LPCxxxx and there it is working...)
But when sending 'U 23130(0D)(0A)', i get an answer -> 'U 23130(0D)(0A)0(0D)(0A)'

Same for 'K(0A)' compared to 'K(0D)(0A)', 'J(0A)' compared to 'J(0D)(0A)' and so on.
Bootloader version of my LPC812 seems to be 13.1

What is the recommend way to send these command strings, also for other LPCxxxx? Always send (0D)(0A)? Always send (0A)?
Or must it even be different for different LPCxxxx, or even different versions of same LPCxxxx?

1B) Is it correct that we are now sending plain binary data? No more UUENCODE? No more checksum?

2) Crystal frequency seems now to be hard coded by bootloader to 12 MHz. What happens when i use a faster crystal, e.g. 30 MHz?
Does programming to flash still work (regardless of allowed temperature, crystal speed...)?

Best regards,

Martin
Labels (1)
0 Kudos
11 Replies

1,332 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MarcVonWindscooting on Fri Oct 18 09:41:07 MST 2013

Quote: Nathael

PS: your electronics page is empty :(


Yes, I know. This is in contradiction to my activities (I estimate 80% electronics, 20% software for this year), However, it always takes quite some time to publish things.

At the moment I don't modify mxli, because I do not know in what direction to move. I started the programmer for reasons similar to yours for a LPC1768 and it supported the LPC2100 family, too. That was a great tool and not too complicated in programming.
New LPC families LPC1800, LPC4300 and LPC800 introduced new features, that I find hard to implement in an easy to understand program. Some things are even ill-formed, like 64bit part IDs. mxli has one timeout and if that happens, the program terminates with an error message. That means, mxli never actually uses timing (delay) for the protocol. That's an implication of the design goal 'speed'. I don't sacrifice that for a few devices that might send another 32bit ID information. Not even for auto-detection. I made a list of the differences of the LPC families and it an impressive (hand-written though) DIN-A4 paper.
Way too much dissimilarities for one single program in my opinion. And I ran out of option characters because of those dissimilarities. Most probably I will split the program in two or even more. One that handles multiple flash banks and the typically more complex and bigger controllers. And another that handles the 'small' micros. Something like that.

Don't drop your program. This world needs alternatives!

-- EDIT--

I tried to program an LPC1110 FD20 today, but failed with mxli and lpcprog although both of them work fine with a LPC1114.
The interesting point is: both fail because of a checksum failure.
What I read from the manual is: RAM area 0x1000 0000 to 0x1000 017C -1 can be used for transfer. And this is the only region big enough to hold a block of 256 (minimum copy RAM to FLASH size). I believe, the BASE-ADDR + 0x300, size=0x100 is NOT allowed, see 'ISP RAM usage' and ISP stack requirements.
I tried lpc21isp 1.94 but it fails, too, because it tries to transfer 720 bytes (my program's size) to 0x1000 0000 + 768. LPC1110's memory RAM ends at 0x1000 0000 + 1023, however, so ISP reports correctly a (14) MEMORY_NOT_MAPPED.

Although it's a new PCB I hardly believe that this can be a PCB / serial transmission problem because there have been sent hundreds of bytes before successfully.

My USB-to-Serial converter is a PL2303, just for information.

[color=#f00]-- EDIT again:[/color]
See thread UART-ISP not working on LPC1110? in the lpc1100 forum for solution of this problem (a problem of documentation).
0 Kudos

1,332 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Nathael on Tue Oct 15 12:31:49 MST 2013
Hi !
I did not change the crystal frequency for a long time, and ISP access and flash programming was OK for the values I tested on LPC1114 (the one I wrote it for in the first place).
Then when I tried the other ones it has been allright, so I did not change the value, or tried to understand what it was used for.

The actual version will be OK for LPC812 (I programmed about 50 of them 10 days ago for the Open World Forum).

But if you say that some parts need a 12MHz clock, i'll test those I have with it and make it the default :)

As for mxli, I did not find it in the first place (about one year and a half ago) so I started my own. I have your mxli page open on one desktop, but did not have time to do more than notice that you have a lot more options than I do, and have tested your tool on more devices than me.

You also have CRP support, which I plan to check to prevent unwanted CRP activation but not to support. I'm making a GPL software, it's not for other people to hide their code .. if they want to, they should go buy another software ...

Maybe we should merge them into one ... but I have to admit I have not much time for this.

Dropping mine may also be an option ... as yours seems more complete, though I like the "part definition file" feature I implemented.

Anyway, have fun :)
+++

PS: your electronics page is empty :(
0 Kudos

1,332 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MarcVonWindscooting on Tue Oct 15 11:26:05 MST 2013
Hi Nathael,

welcome to the small club of ISP programmer programmers!
Thanks for providing a Linux program with no porting intention towards 'other' platforms.

I just downloaded a snapshot of lpctools. It compiled out of the box. I'm going to try it on a LPC812, soon.
Nice, that our command-line options converged in some points (-d <device> -b <baud>).

However, I you choose a crystal frequency (that doesn't matter on your target uCs) why don't choose one, that at least CAN match another processor.
A LPC21xx will never work with 1MHz, but it may work if you choose 12MHz or the infamous 14.7456MHz. I have a few boards like that.

Have you tried my program mxli (www.windscooting.com)?

Marc
0 Kudos

1,332 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Nathael on Tue Oct 08 13:08:21 MST 2013
Hi Bingo600,

Thanks for the feedback. I fixed the problem. The info/refs in the git repository was messed up (pointing to an old version for head ...).
I think you managed to get the snapshot, which contained the right files.

You can now clone and get the latest version :)

+++
0 Kudos

1,332 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Bingo600 on Mon Oct 07 23:09:57 MST 2013
@Nathael

It seems like a : git clone http://gitclone.techno-innov.fr/lpctools

Doesn't fetch the last vesion commited.

Ie. no part lpctools_parts.def

/Bingo
0 Kudos

1,332 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Nathael on Thu Oct 03 07:10:17 MST 2013
Hi guys !

As part of my project I wrote an LPC ISP software for Linux : http://git.techno-innov.fr/?p=lpctools

It has been tested on LPC1764, LPC1114, LPC1224, LPC810 and LPC812.

It includes a "part definition" text file which should make support of other LPC parts very easy.
(lpctools_parts.def)

There's a man page written for the lpcprog tool, which is the easy one to use

lpcisp gives an access to all supported ISP commands individually, allowing much more complicated commands than the "id", "flash", "erase", and "dump" commands supported by lpcprog.

The program is under GPLv3, and should be packaged for Debian in a near future .... when I find time for it.
Feel free to comment, send me updates, patches, or to package it for other distros.

+++
0 Kudos

1,332 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sebseb7 on Wed Mar 20 05:56:16 MST 2013
>2) Crystal frequency seems now to be hard coded by bootloader to 12 MHz. What happens when i use a faster crystal, e.g. 30 MHz? Does programming to flash still work (regardless of allowed temperature, crystal speed...)?

the bootloader ignores external crystals, it just runs from an intern 12Mhz Oscillator, which is not very precise (1%) , but precise enough for the bootloader.

sebastian
0 Kudos

1,332 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sebseb7 on Wed Mar 20 05:54:30 MST 2013
has anyone hacked lpc21isp to support the lpc800 ?

Can you share the patch ?


Regards
Sebastian
0 Kudos

1,332 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheShed on Tue Dec 18 19:09:31 MST 2012
Martin,

I've managed to ISP program the lpc812 on the Xpresso board, here are my notes:

Separate the lpc812 target from the LPC-link: wipe over the solder shorts between the pins of J4 with a bit of solder wick.

Solder an 8-pin header to J7.

Connect J7-1 to GND, J7-3 to 3v3, board should run. Takes about 8mA running the Blinky demo app.

Connect J7-4 to TXD and J7-5 to RXD of a 3V3 serial port.
NOTE: TXD/RXD are from the point of view of the external serial device, not the lpc812.

Connect a button or jumper between J7-7 and J7-8, this is the ISP enable switch.

I used an FTDI FT2232H mini-module to connect to TXD/RXD and provide the 3V3 power, mainly because I had one lying around.....

It would have been better if Reset had been connected to J7 as well....

ISP protocol has definitely changed and it looks like (CR)(LF) is required to terminate commands.
Data is sent plain binary, Not UUENCODED, and there is no checksum.

Clock frequency is always 12MHz, the bootloader uses the internal RC oscillator.

I've attached the very hacky python script I used to program the device, it may be of some use...

--
mike

0 Kudos

1,332 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheShed on Tue Dec 18 11:08:25 MST 2012
yep, that has to be wrong.

4k should have sectors 0-3,
8k sectors 0-7 and
16k sectors 0-15.

0 Kudos

1,332 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by capiman on Wed Dec 05 15:13:27 MST 2012
Table 213 on page 239/240 seems to be wrong. 4 KB chip has too much sectors, 8 KB chip has equal sectors to 16 KB chip.
0 Kudos