LPCPROG(1)
π LPCPROG(1) β User development Tools π
okay bestie, gather round, because today we're talking about lpcprog β NXP's LPC micro-controllers flasher. yes, THE flasher. the one that talks to your little LPC chip over a serial line and makes it do things. she's giving embedded-systems main character energy and honestly? obsessed. π¦
β¨ SYNOPSIS β¨
lpcprog -d serial_device -c command [OPTIONS] ... [FILE]
πΈ DESCRIPTION πΈ
So the whole vibe here is: we use the ISP protocol to flash LPC micro-controllers over a serial line. that's it, that's the job. π
For all commands, the target micro-controller must be in ISP mode and waiting for the synchronisation ISP command (which is, like, the default state when it enters ISP mode). if you're confused about any of that, go read the ISP MODE AND CODE READ PROTECTION section below, it's all there, i promise. π«Ά
A FILE argument is mandatory for the dump and flash commands, no cap:
- for
flash, that file is the data (the program) that gets written to the LPC internal Flash memory - for
dump, it's where the actual current content of the LPC internal flash memory gets stored
Also, real talk: mandatory arguments for long options are mandatory for short options too. same energy, no exceptions. π
π OPTIONS π
-p,--parts==PARTSβ usePARTSas the parts description file instead of the default ones. the PARTS DESCRIPTION FILES section has the whole tea on the defaults and the order of precedence. β¨-d,--device=DEVβ useDEVas the host serial line to program the target. you gotta give the full path, bestie. device node files usually live in the/dev/directory. π-c,--command=COMMANDβ the command to execute.COMMANDhas to be one ofid,dump,flash,blankorgo. check the COMMANDS section for what each one does. π-b,--baudrate=BAUDβ useBAUDas the baudrate for talking to the target device. defaults to115200. π₯-t,--traceβ turn on trace output of the serial communication with the target device. peak debugging behaviour, honestly. π-f,--freq=FREQβ useFREQ(in KHz) as the oscillator frequency of the target device. defaults to10000KHz. π-n,--no-user-codeβ do not compute a valid user code for exception vector 7. see the USER CODE section for the lore. π-h,--helpβ display help information and exit. we love a helpful icon. π-v,--versionβ display version information and exit. π
π COMMANDS π
the command must be one of id, dump, flash, blank or go. that's the whole list, periodt. β¨
idβ displays the LPC part identification ID, theuid(unique ID), and the bootloader version of the connected target device. it's giving β¨introductionsβ¨.dumpβ dumps the whole connected target's flash memory content to the given file. this command requires a file argument. no file, no dump, sorry bestie. πflashβ flashes the content of the file given as argument to the beginning of the connected target's flash memory. automatic computation of the User Code happens, and the User Code gets stored in the 7th exception vector. use the-noption if you want to prevent User Code modification. and if you need to write your file to a different flash section? that's a whole other tool β use thelpcisptool. π¦blankβ erases the whole flash. clean slate, fresh start, main character reset. πgoβ Unsupported Yet. to start the program, reset the target using the hardware reset button or power cycle the device. that's the move. π₯
π§ PARTS DESCRIPTION FILES π§
the default parts description files are:
/etc/lpctools_parts.def./lpctools_parts.def
The parts description file is parsed for LPC device description for the dump, blank, and flash commands. so listen: if none of the defaults exist and you didn't supply an existing file with the -p option, those commands cannot execute. and if the part description isn't found in the first found file, the command won't execute either. it's strict like that. π
If no -p option is provided, the program looks for lpctools_parts.def in the current directory first, and then in the /etc/ directory. order matters, bestie. πΈ
The content of parts description files is a list of LPC parts descriptions. each line holds one part description. lines starting with # are comments. for more info on the line format, go look at the default file found in the /etc/ directory. π«Ά
π USER CODE π
A valid User Code is required by the LPC bootloader to start the internal user program. the tea is: User Code counts as valid if the reserved exception vector location 7 β that's offset 0x 0000 001C in the vector table β contains the 2's complement of the check-sum of table entries 0 through 6. the result of all that is that the checksum of the first 8 table entries comes out to 0. math slay. β¨
If the signature is not valid, the LPC enters ISP mode. that's just how she is. π
The default behavior of lpcprog is to compute a valid code for the 7th exception vector and modify the programmed binary data to include this valid code. you can prevent this by using the -n option. π
π₯ ISP MODE AND CODE READ PROTECTION π₯
Code Read Protection is a mechanism that lets "the user" enable different levels of "security" in the system, so that access to the on-chip flash and use of the ISP can be restricted. (yes, those scare quotes are doing a lot of work, and yes, they're on purpose. π) When needed, CRP is invoked by programming a specific pattern in flash location at 0x0000 02FC. IAP commands are not affected by the code read protection.
If your device does not enter ISP state, or if some commands don't succeed, it may be because the CRP mechanism is in use on your device. that's your vibe check result right there. π
Code Read Protection will not be implemented, as it goes against the license of this tool and against the free software philosophy. and that's a firm no from us. π«Ά
π AUTHOR π
Written by Nathael Pajani. π
π REPORTING BUGS π
Report bugs to bug@techno-innov.fr
- Techno-Innov home page:
http://www.techno-innov.fr/ - Software Git Repository:
http://git.techno-innov.fr/
found a bug? don't be shy, tell them. it's giving community. π«Ά
β COPYRIGHT β
Copyright Β© 2013 Techno-Innov License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
no warranty bestie, we said what we said. π
π¦ SEE ALSO π¦
lpcisp(1)
and that's the whole page, gorgeous. π β¨ LPC Tools 1.07, dated July 2014 β yeah she's vintage, she's iconic, she still works. mwah, go flash something. πππ¦
π¦ where this page comes from
- debian bookworm: lpctools 1.07-1 Β· GPL-3.0-or-later
- debian trixie: lpctools 1.07-2 Β· GPL-3.0-or-later
- ubuntu jammy: lpctools 1.07-1 Β· GPL-3.0-or-later
- ubuntu noble: lpctools 1.07-2 Β· GPL-3.0-or-later
- ubuntu questing: lpctools 1.07-2
- ubuntu resolute: lpctools 1.07-3 Β· GPL-3.0-or-later
- ubuntu stonking: lpctools 1.07-3 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms