# CP210x Programmer

ATTENTION: THIS VERSION OF cp210x-program IS NOT FULLY TESTED. IT MAY RENDER YOUR CP210x USELESS OR DESTROY IT.

- Project Page
- Bug Database
- Download
- Code Repository (Mercurial)

Be aware that the current version is only tested on CP2102.

The goal of this library is to provide access to the EEPROM of an Silabs CP210x under Linux.

The CP210x is an USB-to-serial chip used in a lot of USB devices (similar to FTDIs and PL2303). The CP210x has a EEPROM on the chip which can be programmed via USB. Silabs provides already a library and gui programm to program this EEPROM, but only for windows.

This project uses results from monitoring the USB bus when the windows library programms an CP210x. The windows library was not disassembled for this protocol analysis.

When the programm is finished, a later goal would be to provide a library which can be used to access further functions of the CP210x like the general IO pins of the CP2103. The goal is not to provide an tty driver, such driver exists already for linux and BSD.

Version:
  0.3
Author:
  Johannes Hölzl <johannes.hoelzl@gmx.de>

## Dependencies

- Python >= 2.4
- ctypes >= 0.9 (only when Python 2.4 is used)
- libusb 0.1

Since libusb is available on most Linux, Mac OS X and FreeBSD cp210x-program should run flawlessly on these platforms. Currently it is only tested on Linux 2.6 (Ubuntu).

If cp210x-program should run as non-root user, add the udev rule found in doc/45-cp210x-programming.rules to /etc/udev/rules.d. When devices with already programmed IDs are reprogrammed at this IDs to 45-cp210x-programming.rules.

## Usage

### Read EEPROM content into hexfile:

    $ cp210x-program --read-cp210x -f eeprom-content.hex

### Show EEPROM content from device 002 on bus 001:

    $ cp210x-program --read-cp210x -m 001/002

### Write some data to device with vendor id 0x10C4 and product id 0xEA62:

    $ cp210x-program --write-cp210x -m 10C4:EA62 \
                     --set-product-string="Product String" \
                     --set-max-power=100 \
                     --set-bus-powered=no

## TODO

- Test on other than CP2102
- Implement CP2103 GIOP settings
- Implement GUI

## Development

- Clone repository: `hg clone http://cp210x-program.hg.sourceforge.net/hgweb/cp210x-program/cp210x-program/`
- Run, Change, Debug, Commit, Repeat
- Ask me to get commit rights
- Profit!

## Links

- CP210x Product page on Silicon Labs
- AN114 Customization Guide (Software)
- AN205 CP210x Baudrate Guide (Software)
- AN223 Port Configuration and GPIO for CP210x (Software)

## License

The python package 'cp210x' and the python script 'cp210x-program' are provided under the terms of the GNU LGPL. See LICENSE.