ISP? ICP? IAP?

Started by itibira, December 06, 2006, 12:57:42 PM

Previous topic - Next topic

Andy Ayre

This is my understanding:

The flash programming algorithms are implemented in hardware. The ICP protocol directly accesses those algorithms. The bootloader sits in the top of flash memory and is programmed at the factory by NXP. The bootloader provides two interfaces to the programming algorithms. The first is called ISP which allows the UART to be used for communication. The second is IAP, which allows registers to be used for the communication. Therefore if you are using ICP you can erase the entire flash memory of the device, including the factory bootloader.

I think your first two paragraphs are correct.

Flash Magic only understands the ISP protocol, nothing else. So if you want to use Flash Magic, then you must make the ISP protocol available on a COM port. If you are using ICP then you don't have that protocol, so how is it solved? By taking an LPC935 and programming the ICP to ISP bridge code from NXP into it. Flash Magic talks to the bridge device, which then uses ICP to talk to the target device.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

erikm

OK, so what i am getting is that NoTouch is only for ISP but then there is no need for power cycling the Vdd and playing with the reset, etc., BUT there could be issues if the NoTouch is not programmed correctly the first time and something goes wrong, in which case it's time to solder a new chip in.

On the other hand, the advantages / disadvantages of ICP are that because it is hardware driven, there is no issue with the LPC9xx getting into a curare-like paralysis state BUT there is all that extra hardware to deal with.


yes and no
1) if you add "the backdoor" (IMMEDIATELY at Startup:) the only case where NoTouch will leave a chip dead is if you do not complete a program download.  I always implement NoTouch for convenience and the backdoor for safety.
2) the "fiddle the pins" can be implemented as an external circuit, then you do not need copy it on each and every board you make.

Erik
erik

itibira

Thank you all for the responses. i'm still going over them and looking at documentation but in general it is becoming more clear.

Quote from: erikm on December 21, 2006, 01:30:00 PM

2) the "fiddle the pins" can be implemented as an external circuit, then you do not need copy it on each and every board you make.


Thank you for the idea, and it does make sense for an engineering oriented end-user. However, the firmware upgrade method i would like to implement on my board is one in which the (non-technical) end user doesn't need to buy extra cables or equipment and doesn't need to take the final product apart in order to reprogram the LPC935 microcontroller. It should be done transparently through the USB microcontroller interface (acting as a bridge) along with the proper PC-based software. Thus i would like to find a minimal cost way (in terms of BOM cost) to make the firmware update as easy and transparent as possible, as well as robust and error-immune as possible. This means i should do all the hard work at the beginning in the design phase so that the end user will not really have to work so hard or be technically inclined in order to upgrade or update the firmware. It should be extremely simple and foolproof.

As i see it at this moment in time, although the ISP method is the easiest and the LPC935 chips come already preloaded with the ISP bootloader from the factory, and even though if i implement the NoTouch method, there is still that slightest of possibilities that if there is a power failure at the end-user's location during firmware update, the LPC935 will be dead and the end user will need to ship the product back for rework, which is not a pleasant thought and is expensive. Therefore, it seems that the most robust way of doing things is to use ICP and the extra hardware.

Since i can use the USB micro as an ISP-ICP bridge, all i need to do, theoretically, is to implement the Vdd powerdown of the LPC935, because the Reset pulsing and any other pin toggling on the target LPC935 can be done strictly via firmware in the bridge micro (plus some very minimal external components), instead of using all the external gates and other logic shown typically in something like the MCB900 schematic. Is this correct? All the literature i've seen so far regarding ICP programming always includes external circuitry attached to an RS232 level converter (eg: MAX232) to generate the proper ICP hardware timings via the host's serial port. This implies (i haven't investigated it yet) that Flash Magic creates the basic timings in the COM port signals which are massaged further by the on-board ICP programming logic. Is this also correct? Then my next question would be: would ISP-ICP bridge firmware do all of the signal conversion needed in the brdge micro's firmware only, by toggling some pins, without resorting to any RS232 level converter chip?

Finally, i haven't been able to figure out if Flash Magic can be used with USB. i assume it can, since Flash Magic has an "interface" setting and one of those is FDI USB. Am i correct or is it more complicated than that?

Does it look something like:

Flash Magic -> PC USB (FDI?) -> USB micro bridge firmware and pins -> LPC935 (with external power control component only, no other logic) ?

Is there any bridge micro firmware available for this particular architecture? Is there a Flash Magic DLL that i can get that i can incorporate into my own PC software?

Thank you for your patience. i know i've asked too many questions already...







erikm

OK, so what i am getting is that NoTouch is only for ISP but then there is no need for power cycling the Vdd and playing with the reset, etc., BUT there could be issues if the NoTouch is not programmed correctly the first time and something goes wrong, in which case it's time to solder a new chip in.

On the other hand, the advantages / disadvantages of ICP are that because it is hardware driven, there is no issue with the LPC9xx getting into a curare-like paralysis state BUT there is all that extra hardware to deal with.

i won't even attempt to figure out IAP...

Is this about right?


1) if you add "the backdoor" at the right place the only case you may need to "solder a new chip in" is failure during programming the chip.  Not 'bad code' not any other case except failure in that exact time slot.  In some cases, even that will not make you 'lose' the chip.
2) the kick the uC into ISP circuitry can be added externally in which case you do not need to add it to every board you make.

What I do is install NoTouch for convenience, "the backdoor" for emergency and, should I ever need to I will make the xternal "kick" circuitry, I have, for the sake of "belt, suspenders and a piece of rope" the connector for the "kick circuitry" on my boards with a 'shorting nugget' on the Vcc interrupt pins

Erik

erik

Andy Ayre

It's not possible for Windows applications to generate the timing needed for ICP entry and protocol. Therefore you need something inbetween your PC and your device to generate the ICP signals. This is where the ISP to ICP bridge comes in. The FDI USB-ICP is also an ISP to ICP bridge, but in a more convenient package - i.e. you don't have to build and program the bridge yourself. So it looks like:

Flash Magic <---> FDI USB-ICP <---> Target Device using ICP

The FDI USB-ICP interface uses a driver that makes it look like it is a COM port to Windows applications. This is the only way that Flash Magic can talk to a USB device.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

Andy Ayre

Yes, you can buy the DLL that powers Flash Magic and use it for your own applications. It provides an API that gives you access to every ISP feature that Flash Magic supports. For more information see: http://www.flashmagictool.com/devkit.html.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

erikm

OK, so what i am getting is that NoTouch is only for ISP but then there is no need for power cycling the Vdd and playing with the reset, etc., BUT there could be issues if the NoTouch is not programmed correctly the first time and something goes wrong, in which case it's time to solder a new chip in.

On the other hand, the advantages / disadvantages of ICP are that because it is hardware driven, there is no issue with the LPC9xx getting into a curare-like paralysis state BUT there is all that extra hardware to deal with.

i won't even attempt to figure out IAP...

Is this about right?


1) if you install NoTouch for use and 'the backdoor' for safety, the only case where you will need to "solder a new chip in" is some instances where something goes wring while FlashMagic is programming the chip no other cases
2) for the sake of "belt, suspenders and a piece of rope" my boards have a connector for an external 'wiggle the bits" circuit.  Should I lose some chips I will make that board (have had no reason to so far)
3) even if you decide to go totally for "wiggle the bits" if you make the wiggle circuitry external, you do not have to repeat it for every board you make.  Yes, the connector will need to be laid out so a couple of "shorting plugs" e.g. Vcc can be inserted for normal operation.

Merry Christmas to all

Erik
erik

erikm

OK, so what i am getting is that NoTouch is only for ISP but then there is no need for power cycling the Vdd and playing with the reset, etc., BUT there could be issues if the NoTouch is not programmed correctly the first time and something goes wrong, in which case it's time to solder a new chip in.

On the other hand, the advantages / disadvantages of ICP are that because it is hardware driven, there is no issue with the LPC9xx getting into a curare-like paralysis state BUT there is all that extra hardware to deal with.

i won't even attempt to figure out IAP...

Is this about right?


1) if you install NoTouch for use and 'the backdoor' for safety, the only case where you will need to "solder a new chip in" is some instances where something goes wring while FlashMagic is programming the chip no other cases
2) for the sahe of "belt, suspenders and a piece of rope" my boards have a connector for an external 'wiggle the bits" circuit/  Should I lose some chips I will make that board (have had no reason to)
30 even if you decide to go totally for "wiggle the bits" if you make the wiggle circuitry external, you do not have to repeat it for every board you make.  Yes, the connector will need to be laid out so a couple of "shorting plugs" e.g. Vcc can be inserted for normal operation.

Merry Christmas to all

Erik"
erik