WARNING: The author is NOT your friendly neighbour. He has harsh opinions and these opinions may be expressed here or in the program's output.
Go directly to latest release (of version 2.x)
There is a yahoo group lpc21isp, but since a few weeks I can't do any posts there any more. I don't know why - maybe I should do a browser update, or get a yahoo email acount or I don't know. Yahoo does not understand, that people don't want to be force to do tedious work all the time simple to KEEP things running. At least I do not. Good bye yahoo groups! That's why I replaced the lpc21isp-link in this page by the sourceforge page. You can find me on the LPCware.com forum
When looking at mxli's help, you will notice not only an enormous number of options, but also a very sophisticated style of passing information to the program. I dare to say, that you've never before worked with a program that allows such powerful, yet intuitive command-line options. For example you can specify the number 1024 as 1024, as 0x400 or as 1ki. And why should a program force you to write 12000000 instead of 12M for a crystal frequency, when we all know how easily we type a 0 in excess or forget one? Some options of mxli accept lists of tuples and you can write them down easily like for example "10@0x00,0x20@1024" for some byte ranges defined by length and starting addresses. In some cases, numbers can be replaced by symbolic names to avoid repeating the same number on the command-line or to rely on something that has to be extracted from the device. This reduces the probability of errors.
mxli tries to serve you. You tell it, what to do. Like most command line tools, mxli is the same every time you start it. There's no (hidden) state somewhere. If you use the same command line, mxli will do the same. This is very different from many a GUI application that remembers some things but not others or sets defaults that you have to change every time you start it and you can't do it in an easy and reliable way. With a command-line application, you can store as much settings as you want in a script file. You can build different wrapper scripts with different default settings around mxli, easily. mxli is a versatile component in your environment. You can't do that with GUI application. In that context, I want to cite an advice, given by Professor James Leslie Keedy in one of his lectures about operating systems:
"Provide functionality, not policy."
Command-line options are orthogonal. That means: when it comes to interpretation of command-line options, mxli's does not change the context of an option, depending on another. As an extreme example: if you decide to read the FLASH contents of a controller AND you also specify to output its serial number you will get both output to stdout with no error. There's no built in logic, that says: if you read a FLASH image, then reading serial number will corrupt the image output, so I ignore reading serial number. No. mxli does not constantly doubt the user knows, what he's doing. In general, any option A does not alter the meaning of any option B. The order of command-line options does not matter as long a you don't repeat them. Repeating an option (even with a different value) is NOT considered an error but a mechanim for overriding. Options causing actions on your LPC device are always executed in a predefined, immutable order: probe - identify device and/or boot code - read - erase FLASH - write FLASH - verify - execute program.
"What is an illegal copy?" He went on answering: "It's the original with the advertizing and the piracy warning removed. Only those who already paid for the original are forced to watch the advertizing and the piracy warning!"
In my opinion software needs only to be licensed, if it's not up-to-date and the vendor still wants to make money out of that b***sh*t. Write once, sell anywhere. No! So for short, mxli can be seen as an alternative to so-called 'professional' tools but without the license hassle.
mxli provides interesting features for code read protection (CRP) to protect your intellectual property, see below.
Sometimes, really new features emerge. Multiple flash banks appeared in the LPC1800 family, maybe earlier. LPC800 uses a new binary (opposed to a uuencoded) data transmission protocol not seen in any of the other families before. Such new features do require a modification of mxli's code. The good new is: that doesn't happen very often.
For the same reason, mxli supports debugging output by command-line switch to find out what's going wrong if something goes wrong.
The following device families should be supported, if the user provides the memory description.
device | max baud rate | crystal | other options | remarks |
---|---|---|---|---|
LPC812M101 | 230400 | IRC | ||
LPC1110 | 38400 | IRC | -R 0x200,0x100 | baud may be higher (untested) |
LPC1114FN28/102 | 115200 | IRC | ||
LPC1764/1766/1769 | 230400 | IRC | ||
LPC2106 | 230400 | 14.7456MHz | ||
LPC2124 | 14.7456MHz | |||
LPC2132 | 38400 | 12MHz | -E | |
LPC2136/01 | 38400 | 12MHz | -E | |
LPC2148 | 12MHz | |||
LPC2378 | IRC |
$ mxliThis command tries to connect to your controller and outputs its type. If mxli times out, only then try auto-bauding. Make sure the crystal frequency is correct for devices without IRC (LPC21xx for example).
$ mxli -pTo perform flash programming, provide an image on the command line, either binary data or Intel-hex format:
$ mxli yourBinaryImageor
$ mxli yourImage.hex
If you don't know, how to create such a .hex or .bin file, or you don't know how to build one you can rely on, please visit Frank's "LPC17xx ARM Cortex M3 Assembly Language Example".
If your controller is a LPC21 family member running on a 12MHz crystal and your serial device is connected to /dev/ttyS0 then your command line should look like this:
$ mxli -d/dev/ttyS0 -b38400 -c12M -E yourBinaryImageThe -E option turns on echo in ISP communication protocol. This makes mxli wait for LPC's anwers before proceeding, especially while transferring image data.
$ tar xfj mxli-2.1.tar.bz2 $ cd c-linux-mxli-2.1/lib $ make $ cd ../programs/mxli $ makeThis puts the executable mxli into that final directory. Simply move it to the location you want.
mxli 2.1 ($Rev: 79+ $) (C) Marc Prager 2011-2013.. GPLv3 license. Marc's exquisite LPC ISP command-line programmer for NXP ARM devices. Usage: mxli <options> [<inputFile>] Options: (values in [] show the defaults, *=not yet implemented) -? or --help : display this help screen. -0 <q-command-list> : use sector 0 even for questionable operations specified -1 : blank check device (= filled with all ones). -2 <bank>|Y : select flash bank <bank> or from parameter -Y -a <destinationAddress> : image destination address (LMA) (sector boundary!!) [0x0] -b <baud rate> : communication baud rate [230400] -c <f crystal/Hz> : crystal frequency [14748000] -d <device> : serial device [/dev/ttyUSB0] -e {<sect>[..<sect>]|all} : erase FLASH sectors from..to, or all -f <flashSize> : FLASH size override -g : debugging output (in honor of gcc's option -g) -h <topic> : display manual <topic>, start with "contents" -i : print member info -j {addr|LMA|LMA+1} : jump to address [unset] -k : read boot code version (ISP 'K' command) -l <CRP level> : lock code. Set code read protection (CRP) level [-1] -m <RAM size> : RAM 0 size override -n : do not output controller as default action -o <imageFile> : set image output file (instead of stdout) -p : probe baud rates and print to stdout. -q => only highest -q : quick mode: prefer speed to security/kindness -r <imageSize> : read <imageSize> bytes from RAM/FLASH -s {960@64>|file|flash} : calculate CRC checksum from addr 64 to <1024 | whole file | whole FLASH -t <time/ms> : time mxli waits after RESET deassertion [200] -u : output UID -v : verify FLASH contents after programming -w : write to uC (default, if <inputFile> provided -x : execute by issuing RESET without BSL -y <sub-block size> : binary transfer sub-block size [64] -z : zero output in case of success -A : starting address of truly readable FLASH [64] -B 256,512,1024,4096 : define copy-ram-to-flash block sizes to be 256,512... -C <CRP address> : address of the 4-byte CRP code [0x2FC] -E : use echo on [normally off] -F 4kix16,32kix14 : define FLASH sector layout to be 16x4kiB, then 14x32kiB -H * set error output handle [2][stderr] -I <uC ID> : set user-defined id -L <CRP level> : enable CRP level (dangerous especially for level 3) [0] -M 8ki@0x40000000,8ki@... : define uC RAM to be 8kiB at address 0x40000000 and ... -N <uC number> : set user-defined number -P {UUENCODE|BINARY} : data encoding protocol override -R <bottom>,<top> : set RAM0 spaces reserved for ISP [0x270,0x120] -S : show all compiled-in devices. -T <time/ms> : timeout of serial communication, step: 100ms [1000] -U {<uC-number>|user} : force uC like 2101, do not use part ID. -V {CRC|READ} * use verification method CRC or read & compare -W <waveform> : RESET/BSL control, see -h waveforms -X <flow-control> : execution flow control, see -h flow-control -Y <flashBank> : FLASH multiplexing: use flashbank parameter for commands -Z : zero output, even in case of failure. (return code only) <inputFile> can be in Intel hex-format (if named *.hex) or binary. If your controller does not work correctly with mxli, read mxli -h troubleshooting Try -h contents for online manual Please report bugs to marc @ windscooting.com