Programmer for NXP Microcontrollers using the NXP ISP protocol
Project description
Programmer for NXP arm processors using ISP protocol.
Python version must be 3.9 and above.
Installing using pip
pip install nxpprog
Installing Requirements
python3 -m pip install -r requirements.txt
Running nxpprog.py
For help run the command with no arguments:
python nxpprog.py
Help menu
nxpprog.py <serial device> <image_file> : program image file to processor.
nxpprog.py --udp <ip address> <image_file> : program processor using Ethernet.
nxpprog.py --start=<addr> <serial device> : start the device at <addr>.
nxpprog.py --read=<file> --addr=<address> --len=<length> <serial device>:
read length bytes from address and dump them to a file.
nxpprog.py --serialnumber <serial device> : get the device serial number
nxpprog.py --list : list supported processors.
Options:
--binary TEXT Path to the firmware.bin file you want to program the
board with. [required]
--device TEXT Path to serial device file. In linux the name should be
something similar to "/dev/ttyUSB0", WSL "/dev/ttyS0", and
Max OSX "/dev/tty-usbserial-AJ20A5". [required]
--udp Program processor using Ethernet.
--cpu TEXT Set the cpu type.
--osfreq INTEGER Set the oscillator frequency.
--baud INTEGER Set the baud rate.
--xonxoff Enable xonxoff flow control.
--control Use RTS and DTR to control reset and int0.
--start Start the device at a set address.
-v, --verbose Enable version debug message output.
--read TEXT Read from a file.
--len INTEGER Number of bytes to be read.
--serialnumber Get the device serial number.
--list List supported processors.
--addr TEXT Set the base address for the image.
--verify Read the device after programming.
--verifyonly Don't program, just verify.
--eraseonly Don't program, just erase. Implies --eraseall.
--eraseall Erase all flash not just the area written to.
--blankcheck Don't program, just check that the flash is blank.
--filetype TEXT Set filetype to intel hex format or raw binary.
--bank INTEGER Set filetype to intel hex format or raw binary.
--port INTEGER UDP port number to use (default 41825).
--mac TEXT MAC address to associate IP address with.
--help Show this message and exit.
How to Flash an NXP LPC Microcontroller
Using a USB to UART adaptor with both DTR & RTS
NOTE: Development boards with USB to UART adaptors on them can skip these steps.
Otherwise connect a USB to serial converter to UART port 0 on your device. The USB to serial converter MUST have DTR and RTS support. An example of an adaptor with all of the necessary pins is USB to UART adaptor.
Connect DTR to the chips RESET pin and RTS to the chips NMI pin.
USB to UART adaptor without DTR or RTS
If you don't have a a USB to UART adaptor with both RTS and DTR but have some way to control the RESET and NMI pin directly. Lets use a set of push buttons as an example. Here are the steps:
- Hold down both RESET & NMI (pressing the button should short these signals to ground)
- Release NMI
- Release Reset
- Device should be in bootloader mode now.
To test this over a serial monitor, connect to the device using any baud rate,
recommended 115200, and send a single ?
character. The device should
respond with a Synchronized
message back.
Flashing with NXPPROG
The general command for flashing a device with a binary looks like this:
nxpprog --control --binary="main.bin" --device="/dev/tty.usbserial-140"
--control
: This will control the DTR and RTS pins in order to put the device into bootloader mode, remove this if the device has been put into bootloader mode in some other way.--binary="main.bin"
: path to the.bin
file--device="/dev/tty.usbserial-140"
: path to the serial port file on your system.- Windows: COM1, COM2, etc..
- Linux: /dev/ttyUSB0, /dev/ttyACM0, /dev/ttyUSB1 ...
- MacOS: /dev/tty.usbserial-140, /dev/cu.usbserial-AC140J, ...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nxpprog-1.0.3.tar.gz
.
File metadata
- Download URL: nxpprog-1.0.3.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81d18470de4d516d78e3f3b554aa949e8acbc4adf6713f602cd7e10fead8fb16 |
|
MD5 | c6b11fb9e2ceaf20a51c68ecbd50e9ea |
|
BLAKE2b-256 | 9a44b1d5ddf4ac7bb07337d63bb01a4cbaa1c81ab9cc9e0223889a50e4e2ed18 |
File details
Details for the file nxpprog-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: nxpprog-1.0.3-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb6602eea79a6fb34f1d2a2b7a873fbc2b475a91273e0be63a7e5fd8a87fcf00 |
|
MD5 | 2f45a7d61c2e6d9109c3c6451b247cf9 |
|
BLAKE2b-256 | f322b7d0a01cecd60c0915e742fb03fa8fd3bd0eac090be3babd72a906ba7fc8 |