{ "info": { "author": "https://github.com/kendryte/kflash.py/graphs/contributors", "author_email": "auto@canaan-creative.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation", "Topic :: Software Development :: Embedded Systems" ], "description": "kflash, A Python-based Kendryte K210 UART ISP Utility\n=====================================================\n\nUsage\n-----\n\n.. code:: bash\n\n # kflash --help\n usage: kflash [-h] [-p PORT] [-f FLASH] [-b BAUDRATE] [-l BOOTLOADER]\n [-k KEY] [-v] [-t] [-n] [-s] [-B BOARD] [-S SLOW]\n firmware\n\n positional arguments:\n firmware firmware bin path\n\n optional arguments:\n -h, --help show this help message and exit\n -p PORT, --port PORT COM Port\n -f FLASH, --flash FLASH\n SPI Flash type, 0 for SPI3, 1 for SPI0\n -b BAUDRATE, --baudrate BAUDRATE\n UART baudrate for uploading firmware\n -l BOOTLOADER, --bootloader BOOTLOADER\n bootloader bin path\n -k KEY, --key KEY AES key in hex, if you need encrypt your firmware.\n -v, --verbose increase output verbosity\n -t, --terminal Start a terminal after finish (Python miniterm)\n -n, --noansi Do not use ANSI colors, recommended in Windows CMD\n -s, --sram Download firmware to SRAM and boot\n -B BOARD, --Board BOARD\n Select dev board, e.g. kd233, dan, bit, goD, goE or\n trainer\n -S SLOW, --Slow SLOW Slow download mode\n\nAttention\n---------\n\nMaixgo with openec firmware, BOARD must choose ``-B goE``, and should choose\nsencond com port.\n\nWith cmsis-dap firmware(before 2019.02.21), BOARD must use ``-B goD``.\n\nYou can update `new cmsis-dap firmware `__, it is same as openec.\n\nFor K210 Trainer V0.01b, BOARD must choose ``-B trainer``.\n\nFor KD233, BOARD must choose ``-B kd233``, and the jumper for kd233 automatic\ndownload circuit must be set.\n\nInstallation\n------------\n\n.. code:: bash\n\n sudo pip3 install kflash\n\nIf you receive an error, please try\n\n.. code:: bash\n\n sudo python -m pip install kflash\n sudo python3 -m pip install kflash\n sudo pip install kflash\n sudo pip2 install kflash\n\nFor linux users, first of all, you must add yourself to dialout group.\nOr you have to use root permission every time.\n\n.. code:: bash\n\n sudo usermod -a -G dialout $(whoami)\n\nSample Usage\n------------\n\n.. code:: bash\n\n # Linux or macOS\n # Using pip\n kflash -B dan firmware.bin\n kflash -B dan -t firmware.bin # Open a Serial Terminal After Finish\n # Using source code\n python3 kflash.py -B dan firmware.bin\n python3 kflash.py -B dan -t firmware.bin # Open a Serial Terminal After Finish\n\n # Windows CMD or PowerShell\n # Using pip\n kflash -B dan firmware.bin\n kflash -B dan -t firmware.bin # Open a Serial Terminal After Finish\n kflash -B dan -n -t firmware.bin # Open a Serial Terminal After Finish, do not use ANSI colors\n # Using source code\n python kflash.py -B dan firmware.bin\n python kflash.py -B dan -t firmware.bin # Open a Serial Terminal After Finish\n python kflash.py -B dan -n -t firmware.bin # Open a Serial Terminal After Finish, do not use ANSI colors\n\n # Windows Subsystem for Linux\n # Using pip\n sudo kflash -B dan -p /dev/ttyS13 firmware.bin # ttyS13 Stands for the COM13 in Device Manager\n sudo kflash -B dan -p /dev/ttyS13 -t firmware.bin # Open a Serial Terminal After Finish\n # Using source code\n sudo python3 kflash.py -B dan -p /dev/ttyS13 firmware.bin # ttyS13 Stands for the COM13 in Device Manager\n sudo python3 kflash.py -B dan -p /dev/ttyS13 -t firmware.bin # Open a Serial Terminal After Finish\n\nFor fast programming,\n\n.. code:: bash\n\n # Using pip\n # This will enable opoenec super-baudrate!\n kflash -b 4500000 -B goE firmware.bin\n # Trainer could use 8000000 baudrate!\n kflash -b 8000000 -B trainer firmware.bin\n # Dan could use 3000000 baudrate!\n kflash -b 3000000 -B dan firmware.bin\n\n # Using source code\n # This will enable opoenec super-baudrate!\n python3 kflash.py -b 4500000 -B goE firmware.bin\n # Trainer could use 8000000 baudrate!\n python3 kflash.py -b 8000000 -B trainer firmware.bin\n # Dan could use 3000000 baudrate!\n python3 kflash.py -b 3000000 -B dan firmware.bin\n\nExecute user code directly in SRAM and view in serial terminal,\n\n.. code:: bash\n\n # Using pip\n # For `.elf` file\n kflash -b 115200 -B goE -s -t hello_world\n # For `.bin` file\n kflash -b 115200 -B goE -s -t hello_world.bin\n\n # Using source code\n # For `.elf` file\n python3 kflash.py -b 115200 -B goE -s -t hello_world\n # For `.bin` file\n python3 kflash.py -b 115200 -B goE -s -t hello_world.bin\n\nRequirements\n------------\n\n- python>=3 or python=2.7\n- pyserial>=3.4\n- pyelftools>=0.25\n\n Python3 is recommended.\n\nIf your python version below python3.4, you need:\n\n- enum34>=1.1.6\n\nWindows Requirements\n~~~~~~~~~~~~~~~~~~~~\n\n- Download and Install `Python3 at python.org `__\n- Download the `get-pip.py at https://bootstrap.pypa.io/get-pip.py `__\n- Start CMD or PowerShell Terminal and run the following command\n\n.. code:: bash\n\n python get-pip.py\n python -m pip install pyserial\n python -m pip install pyelftools\n # When you python version below python3.4\n python -m pip install enum34\n\n--------------\n\nmacOS Requirements\n~~~~~~~~~~~~~~~~~~\n\n.. code:: bash\n\n # Install Homebrew, an awesome package manager for macOS\n /usr/bin/ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\n brew install python\n python3 -m pip3 install pyserial\n python3 -m pip3 install pyelftools\n\n--------------\n\nUbuntu, Debian Requirements\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: bash\n\n sudo apt update\n sudo apt install python3 python3-pip\n sudo pip3 install pyserial\n sudo pip3 install pyelftools \n\n--------------\n\nFedora\n~~~~~~\n\n.. code:: bash\n\n sudo dnf install python3\n sudo python3 -m pip install pyserial\n sudo python3 -m pip install pyelftools\n\n--------------\n\nCentOS\n~~~~~~\n\n.. code:: bash\n\n sudo yum -y install epel-release\n sudo yum -y install python36u python36u-pip\n sudo ln -s /bin/python3.6 /usr/bin/python3\n sudo ln -s /bin/pip3.6 /usr/bin/pip3\n sudo pip3 install pyserial\n sudo pip3 install pyelftools \n\nTrouble Shooting\n----------------\n\nCould not open port /dev/tty*: [Errno 13] Permission denied: '/dev/tty*'\n------------------------------------------------------------------------\n\n For Windows Subsystem for Linux, you may have to use sudo due to its docker\n like feature\n\n- Add your self to a dialout group to use usb-to-uart devices by\n\n.. code:: bash\n\n sudo usermod -a -G dialout $(whoami)\n\n- Logout, and log in.\n\n--------------\n\nUART Auto Detecting is Not Working, or Select the Wrong UART Port\n-----------------------------------------------------------------\n\nWindows\n~~~~~~~\n\n- Check the COM Number for your device at the Device Manager, such as\n **USB-SERIAL CH340(COM13)**.\n\n.. code:: bash\n # Using pip, only need once when you install\n pip install kflash\n kflash -p COM13 firmware.bin\n # Or\n kflash.exe -p COM13 firmware.bin\n # Using source code\n python kflash.py -p COM13 firmware.bin\n\nWindows Subsystem For Linux(WSL)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Check the COM Number for your device at the Device Manager, such as\n **USB-SERIAL CH340(COM13)**.\n\n.. code:: bash\n\n # Using pip, only need once when you install\n sudo pip3 install kflash\n sudo kflash -p /dev/ttyS13 firmware.bin # You have to use *sudo* here\n # Using source code\n sudo python3 kflash.py -p /dev/ttyS13 firmware.bin # You have to use *sudo* here\n\nLinux\n~~~~~\n\n- Check the USB Device Name, Usually presented as ttyUSB\\*\n\n.. code:: bash\n\n ls /dev/ttyUSB*\n\n- It will print :\n\n.. code:: bash\n\n $ ls /dev/ttyUSB*\n /dev/ttyUSB0\n /dev/ttyUSB2\n /dev/ttyUSB13\n\n- Choose the one you think belongs to your device, or you may try multimule\n names.\n\n.. code:: bash\n\n # Using pip\n python3 kflash.py -p /dev/ttyUSB13 firmware.bin\n # Using source code\n kflash -p /dev/ttyUSB13 firmware.bin\n\nmacOS\n~~~~~\n\n- Check the USB Device Name, Usually presented as cu.\\*\n\n.. code:: bash\n\n ls /dev/cu.*\n\n- It will print :\n\n.. code:: bash\n\n $ ls /dev/ttyUSB*\n /dev/cu.wchusbserial1410\n /dev/cu.wchusbserial1437\n /dev/cu.SLAB_USBtoUART2333\n\n- Choose the one you think belongs to your device, or you may try multimule\n names.\n\n.. code:: bash\n\n # Using pip\n kflash -p /dev/cu.wchusbserial1410 firmware.bin\n # Using source code\n python3 kflash.py -p /dev/cu.wchusbserial1410 firmware.bin\n\nYou may unable to find the device even in the /dev, check the link below for\ndrivers\n\n- For K210 and Sipeed Dan -> `WCH CH34x USB2UART Chip `__\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kendryte/kflash.py", "keywords": "", "license": "MIT License", "maintainer": "Huang Rui", "maintainer_email": "vowstar@gmail.com", "name": "kflash", "package_url": "https://pypi.org/project/kflash/", "platform": "all", "project_url": "https://pypi.org/project/kflash/", "project_urls": { "Homepage": "https://github.com/kendryte/kflash.py" }, "release_url": "https://pypi.org/project/kflash/0.8.2/", "requires_dist": [ "pyserial (>=3.4)", "pyelftools (>=0.25)", "enum34 (>=1.1.6)" ], "requires_python": "", "summary": "Kendryte UART ISP Utility - programming code to k210", "version": "0.8.2" }, "last_serial": 5275084, "releases": { "0.8.0": [ { "comment_text": "", "digests": { "md5": "ffa44487d9810a805a4a06e0f4f84638", "sha256": "4b02b361049ce22c1802feafd55b1dd854f43f0b52f5940c49d10ed58166df9d" }, "downloads": -1, "filename": "kflash-0.8.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ffa44487d9810a805a4a06e0f4f84638", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 75719, "upload_time": "2019-04-29T16:00:32", "url": "https://files.pythonhosted.org/packages/4d/35/509cf6fe832f4cb58e8ccf6e8b698f02701f583917e23191ef6acab543bb/kflash-0.8.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6e384d0f2cb577b6768a017ffa9179ea", "sha256": "18ed183fd624dc073db354dc92b5fcea033661fd45c9b0ed996c528824a88dab" }, "downloads": -1, "filename": "kflash-0.8.0.tar.gz", "has_sig": false, "md5_digest": "6e384d0f2cb577b6768a017ffa9179ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 75308, "upload_time": "2019-04-29T16:01:00", "url": "https://files.pythonhosted.org/packages/1e/f6/ea7ee6926af1b1070f3f3787be1bfa298013b11008108afb4fab9ef3e000/kflash-0.8.0.tar.gz" } ], "0.8.1": [ { "comment_text": "", "digests": { "md5": "af0eb3dc369f44ffe727d761656407bd", "sha256": "e342100347e10f3ff8e0fe91d754f8114d10a4b4d795cd3c57292f9c7970bb15" }, "downloads": -1, "filename": "kflash-0.8.1-py3-none-any.whl", "has_sig": false, "md5_digest": "af0eb3dc369f44ffe727d761656407bd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 75902, "upload_time": "2019-05-03T10:51:30", "url": "https://files.pythonhosted.org/packages/12/37/e9707d73d4887f5319ac95af2f836f4c9eb426888dfc8a71325d72ce412d/kflash-0.8.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "73ea21b44b755b4959ddd1a52de7819d", "sha256": "89d1c5cf308e9e891cf181f0cd39539a51840dc4ab1430ea24b60e7da1bba0dc" }, "downloads": -1, "filename": "kflash-0.8.1.tar.gz", "has_sig": false, "md5_digest": "73ea21b44b755b4959ddd1a52de7819d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 75580, "upload_time": "2019-05-03T10:51:32", "url": "https://files.pythonhosted.org/packages/f2/85/701b16fc2c0f653ca52c0de62bc699cfcc900ca87fe0d5e2229d0adad8c7/kflash-0.8.1.tar.gz" } ], "0.8.2": [ { "comment_text": "", "digests": { "md5": "c15f76db692924be1e3d8db7096e4ab2", "sha256": "ab292d12d5e66b9e56251f81170ecec5a3e9feee1f0f60c89a991493588c7e10" }, "downloads": -1, "filename": "kflash-0.8.2-py3-none-any.whl", "has_sig": false, "md5_digest": "c15f76db692924be1e3d8db7096e4ab2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 75907, "upload_time": "2019-05-03T12:52:57", "url": "https://files.pythonhosted.org/packages/a0/42/c79ed7a9bd176be0632e7b767a48c9e337bbe843bf324aefb16dc13733f1/kflash-0.8.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f63b9f3865758ea509e3415a90e6eabe", "sha256": "3b8aa71e3013c45866215b1ec5ef3d5a1460e34584d6677d282060e80efeff61" }, "downloads": -1, "filename": "kflash-0.8.2.tar.gz", "has_sig": false, "md5_digest": "f63b9f3865758ea509e3415a90e6eabe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 75581, "upload_time": "2019-05-03T12:52:59", "url": "https://files.pythonhosted.org/packages/8d/87/872b9e50a17362e43c394f852c596a286e735269938d9aa31b0bae03d144/kflash-0.8.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c15f76db692924be1e3d8db7096e4ab2", "sha256": "ab292d12d5e66b9e56251f81170ecec5a3e9feee1f0f60c89a991493588c7e10" }, "downloads": -1, "filename": "kflash-0.8.2-py3-none-any.whl", "has_sig": false, "md5_digest": "c15f76db692924be1e3d8db7096e4ab2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 75907, "upload_time": "2019-05-03T12:52:57", "url": "https://files.pythonhosted.org/packages/a0/42/c79ed7a9bd176be0632e7b767a48c9e337bbe843bf324aefb16dc13733f1/kflash-0.8.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f63b9f3865758ea509e3415a90e6eabe", "sha256": "3b8aa71e3013c45866215b1ec5ef3d5a1460e34584d6677d282060e80efeff61" }, "downloads": -1, "filename": "kflash-0.8.2.tar.gz", "has_sig": false, "md5_digest": "f63b9f3865758ea509e3415a90e6eabe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 75581, "upload_time": "2019-05-03T12:52:59", "url": "https://files.pythonhosted.org/packages/8d/87/872b9e50a17362e43c394f852c596a286e735269938d9aa31b0bae03d144/kflash-0.8.2.tar.gz" } ] }