### Example Configuration File (TOML) Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/README.md An example TOML configuration file for pymdfu. It demonstrates how to set common and tool-specific parameters like verbosity, serial port, and network host. ```toml [common] verbose = "debug" [serial] port = "COM11" baudrate = 115200 [network] host = "192.168.1.100" port = 8080 ``` -------------------------------- ### Get Help on Tool-Specific Parameters Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/README.md Retrieve help documentation for parameters specific to different MDFU tools. ```sh pymdfu tools-help ``` -------------------------------- ### Example MDFU Client Configuration File Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/README.md A TOML file demonstrating how to configure client information and response delays for the MDFU client. ```toml [client_info] version = "1.2.0" # Inter transaction delay in seconds inter_transaction_delay = 0 buffer_count = 1 # Client buffer size in bytes buffer_size = 512 # Default timeout in seconds that is used for all unspecified timeouts default_timeout = 10 # Client reported timeouts for commands in seconds [client_info.timeouts] GET_CLIENT_INFO = 0.1 START_TRANSFER = 1 WRITE_CHUNK = 0.5 GET_IMAGE_STATE = 4 END_TRANSFER = 1 # Response delays must not exceed corresponding client info timeouts # All delays are specified in seconds [response_delays] GET_CLIENT_INFO = 0 START_TRANSFER = 0 WRITE_CHUNK = 0.2 GET_IMAGE_STATE = 2 END_TRANSFER = 0 ``` -------------------------------- ### Start MDFU Client with Network Transport Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/README.md Initiates the MDFU client using the network transport layer on localhost. ```sh pymdfuclient --tool network --host localhost --port 5558 --transport serial ``` -------------------------------- ### Firmware Update with Combined Configuration Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/CAN_SETUP.md Command-line example for updating firmware with pymdfu when CAN and ISO-TP configurations are in a single file. This simplifies the command by referencing one configuration file. ```sh pymdfu update --tool python-can-tp --image update_image.img --can-config config.toml --can-tp-config config.toml --client-id 11 --host-id 12 ``` -------------------------------- ### Show Help for a Specific Action Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/README.md Get help specific to a particular action within the pymdfu tool. Replace `` with the desired action name. ```sh pymdfu --help ``` -------------------------------- ### Install pymdfu Package Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/README.md Install the pymdfu package using pip. This command is used to add the tool to your system's Python environment. ```sh pip install pymdfu ``` -------------------------------- ### Firmware Update via CAN ISO-TP Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/CAN_SETUP.md Command-line example for performing a firmware update using pymdfu with separate CAN and ISO-TP configuration files. Specify client and host IDs for the communication. ```sh pymdfu update --tool python-can-tp --image update_image.img --can-config can-config.toml --can-tp-config can-tp-config.toml --client-id 11 --host-id 12 ``` -------------------------------- ### Start MDFU Client with Serial Transport Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/README.md Initiates the MDFU client using a serial port with a specified baudrate. ```sh pymdfuclient --tool serial --port COM11 --baudrate 115200 ``` -------------------------------- ### ISO-TP Configuration File Example Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/CAN_SETUP.md This TOML file configures ISO-TP parameters for CAN communication, including timing, block size, data lengths, and timeouts. Ensure these values match your CAN network requirements. ```toml [isotp] # ISO CAN TP configuration # The single-byte Separation Time stmin = 0 # The single-byte Block Size (number of consecutive frames before flow control) blocksize = 0 # Maximum number of bytes in a single CAN message tx_data_length = 8 # Minimum length of CAN messages. # tx_data_min_length = 1 # Milliseconds to wait for a flow control frame before timeout rx_flowcontrol_timeout = 1000 # Milliseconds to wait for a consecutive frame before timeout rx_consecutive_frame_timeout = 1000 # Byte used for padding messages sent. If not configured no padding is done. # tx_padding = 0x00 # Single-byte Wait Frame Max (0 = wait frames not supported) wftmax = 3 # Maximum frame length accepted max_frame_size = 4095 # Use CAN FD (true/false) can_fd = false # Use bitrate switch for CAN FD (true/false) bitrate_switch = false ``` -------------------------------- ### Print pymdfu Version Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/README.md Display the installed version of the pymdfu command-line tool and the supported MDFU protocol version. ```sh pymdfu --version ``` -------------------------------- ### Get MDFU Client Information via Serial Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/README.md Retrieve MDFU client information using the 'client-info' action over a serial connection. Requires specifying the tool, port, and baudrate. ```sh pymdfu client-info --tool serial --port COM11 --baudrate 115200 ``` -------------------------------- ### Show General Help Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/README.md Display general help information for the pymdfu command-line interface. ```sh pymdfu --help ``` -------------------------------- ### pymdfuclient Usage Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/README.md Displays the available command-line arguments for the pymdfuclient. ```sh pymdfuclient [-h | --help] [-v | --verbose ] [-V | --version] [-R | --release-info] [--config ] --tool [...] ``` -------------------------------- ### pymdfu Command Line Interface Usage Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/pypi.md Basic structure for using the pymdfu command-line tool, including global options and actions. ```sh pymdfu [-h | --help] [-v | --verbose ] [-V | --version] [-R | --release-info] [] ``` -------------------------------- ### Run All PyMDFU Tests Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/pymdfu/tests/readme.md Execute all tests within the PyMDFU project. Ensure you are in the root directory of the repository. ```bash pytest ``` -------------------------------- ### Print pymdfu Release Details Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/README.md Show detailed release information for the pymdfu tool. ```sh pymdfu --release-info ``` -------------------------------- ### Run PyMDFU Tests with Logging Output Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/pymdfu/tests/readme.md Enable logging output during test execution by specifying the log level with --log-cli-level and ensuring print statements are captured with the -s option. ```bash pytest --log-cli-level INFO -s ``` -------------------------------- ### Configure Vector VN16xx CAN FD Interface (TOML) Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/CAN_SETUP.md Use this TOML configuration for a Vector VN16xx tool with CAN FD. Specify nominal and data bitrates, along with timing parameters. ```toml [can] # Example for Vector tool with CAN FD, and nominal bitrate of 500kbit/s and data bitrate of 2Mbit/s: interface = "vector" app_name = "CANalyzer" receive_own_messages = false channel = 0 fd = true bitrate = 500000 data_bitrate = 2000000 tseg1_abr = 63 tseg2_abr = 16 sjw_abr = 16 tseg1_dbr = 15 tseg2_dbr = 4 sjw_dbr = 4 ``` -------------------------------- ### Run Specific PyMDFU Tests by Substring Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/pymdfu/tests/readme.md Filter and run tests using a substring expression with pytest's -k option. This is useful for targeting tests in a specific file or with a particular name. ```bash pytest -k test_mac_layers ``` ```bash pytest -k test_socket_mac ``` -------------------------------- ### Configure PEAK PCAN-USB-FD CAN FD Interface (INI) Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/CAN_SETUP.md Use this INI configuration for a PEAK PCAN-USB-FD device with CAN FD. Set nominal and data bitrates, and associated timing parameters. ```ini [can] # Example for PEAK PCAN-USB-FD with CAN FD, nominal bitrate of 1Mbit/s and data bitrate of 1Mbit/s: interface = pcan channel = PCAN_USBBUS1 fd = true f_clock_mhz = 20 nom_brp = 5 nom_tseg1 = 2 nom_tseg2 = 1 nom_sjw = 1 data_brp = 2 data_tseg1 = 3 data_tseg2 = 1 data_sjw = 1 ``` -------------------------------- ### Update Firmware via Serial Port Source: https://github.com/microchip-pic-avr-tools/pymdfu/blob/main/README.md Perform a firmware update using the 'update' action via a serial port. Specify the image file, port, and baudrate. ```sh pymdfu update --tool serial --image update_image.img --port COM11 --baudrate 115200 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.