Skip to content

A tool for flashing embedded devices using XCP over CAN

License

Notifications You must be signed in to change notification settings

intellisec/xcp-flash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XCP-flash

This is a tool for flashing embedded devices such as electronic control units (ECUs) via the "Universal Measurement and Calibration Protocol" (XCP) over CAN. Support for certain devices, for instance with an address granularity > 1, might be limited, though. Please let us know if you experience any problems.

XCP-flash has been tested with USB2CAN by 8devices, but can be easily customized to work with other adapters as long as they are supported by python-can and can-utils.

Install

For installing XCP-flash one merely needs to clone the git repository and execute the bin/env.sh script from the root directory.

$ git clone [repo] xcp-flash
$ cd xcp-flash
$ bin/env.sh

Dependencies

Next to python3 the tool requires the following two libraries, which however are automatically installed when executing the above commands.

  • python-can
  • bincopy

Usage

The tool can be run either using the bin/xcp-flash script or by executing python3 src/flash.py and expects a binary file in .s32 or .hex format as input. Similar file formats can be used if they are transmitted byte-by-byte and are supported by bincopy.

usage: flash.py [-h] --txid TRANSMISSION_ID --rxid RESPONSE_ID
                [--mode CONN_MODE] [--channel CHANNEL]
                firmware

Example

For flashing a firmware file firmware.s32 execute

bin/xcp-flash --txid 7C7 --rxid 7C8 firmware.s32

On Windows USB2CAN adapters need an additional channel/serialnumber:

bin/xcp-flash --txid 7C7 --rxid 7C8 --channel ED000200 firmware.s32

About

A tool for flashing embedded devices using XCP over CAN

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published