{"id":17268012,"url":"https://github.com/lauszus/pyblhost","last_synced_at":"2026-03-14T14:49:47.682Z","repository":{"id":44999388,"uuid":"401257830","full_name":"Lauszus/pyblhost","owner":"Lauszus","description":"Python implemented of blhost used to communicate with the NXP MCUBOOT/KBOOT bootloader","archived":false,"fork":false,"pushed_at":"2024-11-25T08:19:16.000Z","size":73,"stargazers_count":7,"open_issues_count":2,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T22:01:31.984Z","etag":null,"topics":["blhost","bootloader","freescale","kboot","mcu","mcuboot","nxp"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lauszus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-30T07:42:06.000Z","updated_at":"2024-11-25T08:19:18.000Z","dependencies_parsed_at":"2024-05-06T16:00:06.598Z","dependency_job_id":"782dd55f-35c1-456c-86f9-c0007e066a4a","html_url":"https://github.com/Lauszus/pyblhost","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lauszus%2Fpyblhost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lauszus%2Fpyblhost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lauszus%2Fpyblhost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lauszus%2Fpyblhost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lauszus","download_url":"https://codeload.github.com/Lauszus/pyblhost/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248844091,"owners_count":21170512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blhost","bootloader","freescale","kboot","mcu","mcuboot","nxp"],"created_at":"2024-10-15T08:12:14.481Z","updated_at":"2026-03-14T14:49:47.676Z","avatar_url":"https://github.com/Lauszus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyblhost\n\n#### Developed by Kristian Sloth Lauszus, 2020-2025\n\nThe code is released under the GNU General Public License v3.0.\n_________\n[![PyPI](https://img.shields.io/pypi/v/pyblhost.svg)](https://pypi.org/project/pyblhost)\n[![pyblhost CI](https://github.com/Lauszus/pyblhost/actions/workflows/build.yml/badge.svg)](https://github.com/Lauszus/pyblhost/actions/workflows/build.yml)\n[![Coverage badge](https://raw.githubusercontent.com/Lauszus/pyblhost/python-coverage-comment-action-data/badge.svg)](https://htmlpreview.github.io/?https://github.com/Lauszus/pyblhost/blob/python-coverage-comment-action-data/htmlcov/index.html)\n\nThis is a Python implementation of [blhost](https://github.com/Lauszus/blhost) used to communicate with the [NXP MCUBOOT/KBOOT bootloader](https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuboot-mcu-bootloader-for-nxp-microcontrollers:MCUBOOT).\n\nFor now it only implements a subset of the blhost commands.\n\nCurrently serial and CAN-Bus interfaces are supported.\n\n## Installation\n\n```bash\npip install pyblhost\n```\n\n## Usage\n\n### Python\n\nSee the [examples](examples) directory for Python examples.\n\n### CLI\n\nA handy CLI tool is included.\n\nI recommend using [uvx](https://github.com/astral-sh/uv) to run the CLI tool:\n\n```bash\nuvx pyblhost --help\n```\n\nOr you can install it in your path:\n\n```bash\nuv tool install pyblhost\npyblhost --help\n```\n\n__Usage__\n\n```\nusage: pyblhost [-tx TX_ID] [-rx RX_ID] [-e EXTENDED_ID] [-i INTERFACE]\n                [-l CHANNEL] [-p PORT] [-h] [--version] [-B BINARY]\n                [-s START_ADDRESS] [-c BYTE_COUNT] [-t TIMEOUT]\n                [-r CMD_REPEAT] [-b BAUDRATE] [--prop PROP] [--no-reset] [-v]\n                [--assume-success]\n                {can,serial} {upload,read,ping,reset,get_property}\n\npositional arguments:\n  {can,serial}          Communicate with the target via either CAN or serial\n  {upload,read,ping,reset,get_property}\n                        upload: write BINARY to START_ADDRESS. Before writing it will erase the memory from START_ADDRESS to START_ADDRESS + BYTE_COUNT\n                        read: read memory from START_ADDRESS to START_ADDRESS + BYTE_COUNT. the read data will be stored in BINARY\n                        ping: send a ping command to the target and check for a response\n                        reset: send a reset command to the target and check for a response\n                        get_property: get a property from the target\n\nrequired CAN arguments:\n  -tx TX_ID, --tx-id TX_ID\n                        The TX ID to use for CAN\n  -rx RX_ID, --rx-id RX_ID\n                        The RX ID to use for CAN\n\noptional CAN arguments:\n  -e EXTENDED_ID, --extended-id EXTENDED_ID\n                        CAN ID is an extended ID\n  -i INTERFACE, --interface INTERFACE\n                        The CAN-Bus interface to use (default \"socketcan\")\n  -l CHANNEL, --channel CHANNEL\n                        The CAN-Bus channel to use (default \"can0\")\n\nrequired serial arguments:\n  -p PORT, --port PORT  The port to use for serial\n\noptional arguments:\n  -h, --help            Show this help message and exit\n  --version             Show program's version number and exit\n  -B BINARY, --binary BINARY\n                        The binary to upload or write memory into\n  -s START_ADDRESS, --start-address START_ADDRESS\n                        The address to upload the binary at or read memory from\n  -c BYTE_COUNT, --byte-count BYTE_COUNT\n                        The number of bytes to erase/read\n  -t TIMEOUT, --timeout TIMEOUT\n                        The time to wait in seconds for a response (default 1.0)\n  -r CMD_REPEAT, --cmd-repeat CMD_REPEAT\n                        The number of times to try to establish a connection (default 3)\n  -b BAUDRATE, --baudrate BAUDRATE, --bitrate BAUDRATE\n                        The baudrate/bitrate to use for serial/can (default 500000)\n  --prop PROP, --property PROP\n                        The property tag to get\n  --no-reset            Do not reset the target after upload\n  -v, --verbose         Increase output verbosity\n  --assume-success      Assume success if uploading fails\n```\n\n__Upload__\n\n```bash\nuvx pyblhost can upload -tx 0x123 -rx 0x321 -B blink.bin -s 0x4C000 -c 0x34000\n```\n\n```bash\nuvx pyblhost serial upload -p /dev/ttyUSB0 -b 500000 -B blink.bin -s 0x4C000 -c 0x34000\n```\n\n__Read__\n\n```bash\nuvx pyblhost can read -tx 0x123 -rx 0x321 -B memory.bin -s 0xC000 -c 0x34000\n```\n\n```bash\nuvx pyblhost serial read -p /dev/ttyUSB0 -b 500000 -B memory.bin -s 0xC000 -c 0x34000\n```\n\n__Ping__\n\n```bash\nuvx pyblhost can ping -tx 0x123 -rx 0x321\n```\n\n```bash\nuvx pyblhost serial ping -p /dev/ttyUSB0 -b 500000\n```\n\n__Reset__\n\n```bash\nuvx pyblhost can reset -tx 0x123 -rx 0x321\n```\n\n```bash\nuvx pyblhost serial reset -p /dev/ttyUSB0 -b 500000\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flauszus%2Fpyblhost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flauszus%2Fpyblhost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flauszus%2Fpyblhost/lists"}