{ "info": { "author": "Martin Olejar", "author_email": "martin.olejar@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "License :: OSI Approved :: BSD License", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering", "Topic :: Software Development :: Embedded Systems", "Topic :: Utilities" ], "description": "pyMBoot\n=======\n\n|Build Status| |PyPI Status| |Python Version|\n\npyMBoot is an Open Source python based library for configuring and\nupgrading the firmware in NXP Microcontrolers with embedded\n`MCUBOOT `__\n(MCU Bootloader). Detailed description of ``MCUBOOT / KBOOT`` key\nfeatures and functionality is located\n`here `__.\n\n.. raw:: html\n\n

\n\n.. raw:: html\n\n

\n\n..\n\n The pyMBoot project is still in beta phase. Please, check issues for\n the ongoing tasks or todo tasks.\n\nDependencies\n------------\n\n- `Python 3.x `__ - The interpreter\n- `Click `__ - Python package for creating\n beautiful command line interface.\n- `bincopy `__ - Python package for\n parsing S-Record, Intel HEX and TI-TXT files.\n- `easy_enum `__ - User friendly\n implementation of documented Enum type for Python language.\n- `PyUSB `__ - Python package to access\n USB devices in Linux OS.\n- `PyWinUSB `__ - Python\n package that simplifies USB-HID communications on Windows OS.\n- `pyserial `__ - Python package\n for communication over Serial port in Linux and Windows OS.\n\nInstallation\n------------\n\nTo install the latest version from master branch execute in shell\nfollowing command:\n\n.. code:: bash\n\n $ pip install -U https://github.com/molejar/pyMBoot/archive/master.zip\n\nIn case of development, install it from cloned sources:\n\n.. code:: bash\n\n $ git clone https://github.com/molejar/pyMBoot.git\n $ cd pyMBoot\n $ pip install -U -e .\n\n**NOTE:** You may run into a permissions issues running these commands.\nHere are a few options how to fix it:\n\n1. Run with ``sudo`` to install pyMBoot and dependencies globally\n2. Specify the ``--user`` option to install locally into your home\n directory (export \u201c~/.local/bin\u201d into PATH variable if haven\u2019t).\n3. Run the command in a\n `virtualenv `__ local to a\n specific project working set.\n\nUsage\n-----\n\nThe following example is showing how to use ``mboot`` module in your\ncode.\n\n.. code:: python\n\n\n import mboot\n\n # Create mboot instance\n mb = mboot.McuBoot()\n\n try:\n # Scan for connected MCU's\n devs = mboot.scan_usb()\n\n if devs\n if len(devs) > 1:\n # Print list of connected devices\n for i, dev in enumerate(devs):\n print(\"{}) {}\".format(i, dev.info()))\n \n # Connect to first USB device from all founded\n mb.open_usb(devs[0])\n\n # Read MCU memory: 100 bytes from address 0\n data = mb.read_memory(start_address=0, length=100)\n\n # Other commands\n # ...\n\n # Close USB port if finish\n mb.close()\n \n else:\n print(\"Connect device to PC !\")\n\n # Handle exception\n except Exception as e:\n print(str(e))\n\n[ mboot ] Tool\n--------------\n\npyMBoot is distributed with command-line utility ``mboot``, which\npresents the complete functionality of this library. If you write\n``mboot`` into shell and click enter, then you get the description of\nits usage. For getting the help of individual commands just use\n``mboot -?``.\n\n.. code:: bash\n\n $ mboot --help\n \n Usage: mboot [OPTIONS] COMMAND [ARGS]...\n \n NXP MCU Bootloader Command Line Interface, version: 0.2.0\n \n NOTE: Development version, be carefully with it usage !\n \n Options:\n -t, --target TEXT Select target MKL27, LPC55, ... [optional]\n -d, --debug INTEGER RANGE Debug level: 0-off, 1-info, 2-debug\n -v, --version Show the version and exit.\n -?, --help Show this message and exit.\n \n Commands:\n erase Erase MCU memory\n fill Fill MCU memory with specified patern\n info Get MCU info (mboot properties)\n read Read data from MCU memory\n reset Reset MCU\n unlock Unlock MCU\n write Write data into MCU memory\n\n..\n\n If USB device is not in known devices list, then use\n ``-t or --target`` argument and directly specify the device VID:PID.\n Example: **-t 0x15A2:0x0073**\n\n$ mboot info\n^^^^^^^^^^^^\n\nRead bootloader properties from connected MCU.\n\n.. code:: bash\n\n $ mboot info\n\n DEVICE: Kinetis Bootloader (0x15A2, 0x0073)\n\n CurrentVersion:\n = 1.0.0\n AvailablePeripherals:\n - UART\n - I2C-Slave\n - SPI-Slave\n - USB-HID\n FlashStartAddress:\n = 0x00000000\n FlashSize:\n = 256kB\n FlashSectorSize:\n = 1kB\n FlashBlockCount:\n = 2\n AvailableCommands:\n - FlashEraseAll\n - FlashEraseRegion\n - ReadMemory\n - FillMemory\n - FlashSecurityDisable\n - ReceiveSBFile\n - Call\n - Reset\n - SetProperty\n VerifyWrites:\n = 1\n MaxPacketSize:\n = 32B\n ReservedRegions:\n = 0\n ValidateRegions:\n = 1\n RAMStartAddress:\n = 0x1FFFE000\n RAMSize:\n = 32kB\n SystemDeviceIdent:\n = 0x23161D82\n FlashSecurityState:\n = Unlocked\n\n$ mboot read [OPTIONS] ADDRESS [LENGTH]\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nRead data from MCU memory and store it into file as binary (*.bin),\nintel-hex (*.ihex) or s-record (*.srec or*.s19) format. If output file\nis not specified, the data are dumped into stdout in readable format.\n\n LENGTH argument is optional and as default will be used the size to\n end of memory\n\noptions:\n''''''''\n\n- **-c, \u2013compress** - Compress dump output. (default: False)\n- **-f, \u2013file** - Output file name with extension: *.bin,*.ihex, *.srec\n or*.s19\n- **-?, \u2013help** - Show help message and exit.\n\n.. code:: bash\n\n $ mboot read 0 200\n \n Reading from MCU memory, please wait !\n\n ADDRESS | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF\n -----------------------------------------------------------------------------\n 00000000 | 00 60 00 20 C1 00 00 00 D9 08 00 00 09 01 00 00 | .`. ............\n 00000010 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................\n 00000020 | 00 00 00 00 00 00 00 00 00 00 00 00 09 01 00 00 | ................\n 00000030 | 00 00 00 00 00 00 00 00 09 01 00 00 09 01 00 00 | ................\n 00000040 | 09 01 00 00 09 01 00 00 09 01 00 00 09 01 00 00 | ................\n 00000050 | 09 01 00 00 09 01 00 00 09 01 00 00 09 01 00 00 | ................\n 00000060 | 09 01 00 00 09 01 00 00 09 01 00 00 09 01 00 00 | ................\n 00000070 | 09 01 00 00 09 01 00 00 09 01 00 00 09 01 00 00 | ................\n 00000080 | 09 01 00 00 09 01 00 00 09 01 00 00 09 01 00 00 | ................\n 00000090 | 09 01 00 00 09 01 00 00 09 01 00 00 09 01 00 00 | ................\n 000000A0 | 09 01 00 00 09 01 00 00 09 01 00 00 09 01 00 00 | ................\n 000000B0 | 09 01 00 00 09 01 00 00 09 01 00 00 09 01 00 00 | ................\n 000000C0 | 0A 49 0B 4A 0B 4B 9B 1A | .I.J.K..\n -----------------------------------------------------------------------------\n\n$ mboot write [OPTIONS] FILE\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nWrite data from attached FILE into MCU memory.\n\n.. _options-1:\n\noptions:\n''''''''\n\n- **-a, \u2013address** - Start Address. (default: 0)\n- **-o, \u2013offset** - Offset of input data. (default: 0)\n- **-?, \u2013help** - Show help message and exit.\n\n.. code:: bash\n\n $ mboot write blink.srec\n\n Wrote Successfully.\n\n$ mboot erase [OPTIONS]\n^^^^^^^^^^^^^^^^^^^^^^^\n\nErase MCU memory from specified address and length or complete chip.\n\n.. _options-2:\n\noptions:\n''''''''\n\n- **-m, \u2013mass** - Erase complete MCU memory.\n- **-a, \u2013address** - Start Address.\n- **-l, \u2013length** - Count of bytes aligned to flash block size.\n- **-?, \u2013help** - Show help message and exit.\n\n.. code:: bash\n\n $ mboot erase -m\n\n Chip Erased Successfully.\n\n$ mboot unlock [OPTIONS]\n^^^^^^^^^^^^^^^^^^^^^^^^\n\nUnlock MCU memory.\n\n.. _options-3:\n\noptions:\n''''''''\n\n- **-k, \u2013key** - Use backdoor key as ASCII = S:123\u20268 or HEX =\n X:010203\u202608\n- **-?, \u2013help** - Show help message and exit.\n\n.. code:: bash\n\n $ mboot unlock\n\n Chip Unlocked Successfully.\n\n$ mboot fill [OPTIONS] ADDRESS LENGTH\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nFill MCU memory with specified pattern\n\n.. _options-4:\n\noptions:\n''''''''\n\n- **-p, \u2013pattern** - Pattern format (default: 0xFFFFFFFF).\n- **-?, \u2013help** - Show help message and exit.\n\n.. code:: bash\n\n $ mboot fill -p 0x11111111 0x1FFFE000 10\n\n Filled Successfully.\n\n$ mboot reset\n^^^^^^^^^^^^^\n\nMCU SW reset\n\n.. code:: bash\n\n $ mboot reset\n\nTODO\n----\n\n- Implement support for UART interface\n\n.. |Build Status| image:: https://travis-ci.org/molejar/pyMBoot.svg?branch=master\n :target: https://travis-ci.org/molejar/pyMBoot\n.. |PyPI Status| image:: https://img.shields.io/pypi/v/mboot.svg\n :target: https://pypi.python.org/pypi/mboot\n.. |Python Version| image:: https://img.shields.io/pypi/pyversions/mboot.svg\n :target: https://www.python.org", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/molejar/pyMBoot", "keywords": "NXP MCU Bootloader", "license": "BSD3", "maintainer": "", "maintainer_email": "", "name": "mboot", "package_url": "https://pypi.org/project/mboot/", "platform": "Windows", "project_url": "https://pypi.org/project/mboot/", "project_urls": { "Homepage": "https://github.com/molejar/pyMBoot" }, "release_url": "https://pypi.org/project/mboot/0.2.0/", "requires_dist": null, "requires_python": ">=3.5", "summary": "Python module for communication with NXP MCU Bootloader", "version": "0.2.0" }, "last_serial": 5137605, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "8c7e450685116ac75bd392cdeb890149", "sha256": "763b16380c5000bc551fb4db666532304f8f08cdf3d576e281931ceb7876a0bd" }, "downloads": -1, "filename": "mboot-0.2.0.tar.gz", "has_sig": false, "md5_digest": "8c7e450685116ac75bd392cdeb890149", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 24906, "upload_time": "2019-04-13T08:50:12", "url": "https://files.pythonhosted.org/packages/cf/a5/177dc10d5cbec46a6a7bd0cd478c9decb4632e05681466864d997d9360f9/mboot-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8c7e450685116ac75bd392cdeb890149", "sha256": "763b16380c5000bc551fb4db666532304f8f08cdf3d576e281931ceb7876a0bd" }, "downloads": -1, "filename": "mboot-0.2.0.tar.gz", "has_sig": false, "md5_digest": "8c7e450685116ac75bd392cdeb890149", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 24906, "upload_time": "2019-04-13T08:50:12", "url": "https://files.pythonhosted.org/packages/cf/a5/177dc10d5cbec46a6a7bd0cd478c9decb4632e05681466864d997d9360f9/mboot-0.2.0.tar.gz" } ] }