Coder Social home page Coder Social logo

cmsis-pack-manager's Introduction

pyOCD

[pyocd.io] [Docs] [Slack] [Mailing list] [CI results]

News

See the wiki news page for all recent news.

pyOCD is an open source Python based tool and package for programming and debugging Arm Cortex-M microcontrollers with a wide range of debug probes. It is fully cross-platform, with support for Linux, macOS, Windows, and FreeBSD.

A command line tool is provided that covers most use cases, or you can make use of the Python API to facilitate custom target control. A common use for the Python API is to run and control CI tests.

Support for more than 70 popular MCUs is built-in. In addition, through the use of CMSIS Device Family Packs, nearly every Cortex-M device on the market is supported.

The pyocd command line tool gives you total control over your device with these subcommands:

  • gdbserver: GDB remote server allows you to debug using gdb via either the console or several GUI debugger options.
  • load: Program files of various formats into flash or RAM.
  • erase: Erase part or all of an MCU's flash memory.
  • pack: Manage CMSIS Device Family Packs that provide additional target device support.
  • commander: Interactive REPL control and inspection of the MCU.
  • server: Share a debug probe with a TCP/IP server.
  • reset: Hardware or software reset of a device.
  • rtt: Stream Segger RTT IO with any debug probe.
  • list: Show connected devices.

The API and tools provide these features:

  • halt, step, resume control
  • read/write memory
  • read/write core registers
  • set/remove hardware and software breakpoints
  • set/remove watchpoints
  • write to flash memory
  • load binary, hex, or ELF files into flash
  • reset control
  • access CoreSight DP and APs
  • SWO and SWV
  • and more!

Configuration and customization is supported through config files, user scripts, and the Python API.

Requirements

  • Python 3.7.0 or later.†
  • macOS, Linux, Windows 7 or newer, or FreeBSD
  • A recent version of libusb. See libusb installation for details.
  • Microcontroller with an Arm Cortex-M CPU
  • Supported debug probe
    • CMSIS-DAP v1 (HID) or v2 (WinUSB), including:
      • Atmel EDBG/nEDBG
      • Atmel-ICE
      • Cypress KitProg3 or MiniProg4
      • DAPLink based debug probe, either on-board or standalone
      • Keil ULINKplus
      • NXP LPC-LinkII
      • NXP MCU-Link
      • WCH-Link (1a86:8011, 2a86:8011 and others)
    • PE Micro Cyclone and Multilink
    • Raspberry Pi Picoprobe
    • SEGGER J-Link
    • STLinkV2 or STLinkV3, either on-board or the standalone versions

† Version 0.29 is the last version to support Python 2.

Status

PyOCD is beta quality.

The Python API is considered stable for version 0.x, but will be changed in version 1.0.

Documentation

The pyOCD documentation is available on the pyocd.io website.

In addition to user guides, you can generate reference documentation using Doxygen with the supplied config file.

Installing

The full installation guide is available in the documentation.

For notes about installing and using on non-x86 systems such as Raspberry Pi, see the relevant documentation.

The latest stable version of pyOCD may be installed via pip as follows:

$ python3 -mpip install -U pyocd

Note: depending on your system, you may need to use python instead of python3.

The latest pyOCD package is available on PyPI as well as on GitHub.

To install the latest prerelease version from the HEAD of the develop branch, you can do the following:

$ python3 -mpip install --pre -U git+https://github.com/pyocd/pyOCD.git@develop

You can also install directly from the source by cloning the git repository and running:

$ python3 pip install .

Note that, depending on your operating system, you may run into permissions issues running these commands. You have a few options here:

  1. Under Linux, run with sudo -H to install pyOCD and dependencies globally. On macOS, installing with sudo should never be required, although sometimes permissions can become modified such that installing without using sudo fails.
  2. Specify the --user option to install local to your user account.
  3. Run the command in a virtualenv local to a specific project working set.

udev rules on Linux

On Linux, particularly Ubuntu 16.04+, you must configure udev rules to allow pyOCD to access debug probes from user space. Otherwise you will need to run pyOCD as root, using sudo, which is very highly discouraged. (You should never run pyOCD as root on any OS.)

To help with this, example udev rules files are included with pyOCD in the udev folder. The readme in this folder has detailed instructions.

Target support

See the target support documentation for information on how to check if the MCU(s) you are using have built-in support, and how to install support for additional MCUs via CMSIS-Packs.

Using GDB

See the GDB setup documentation for a guide for setting up and using pyocd with gdb and IDEs.

Community resources

Join the pyOCD community!

pyocd.io website
Documentation
Issues
Discussions
Wiki
Mailing list for announcements

In order to foster a healthy and safe environment, we expect contributors and all members of the community to follow our Code of Conduct.

Contributions

We welcome contributions in any area, even if you just create an issue. If you would like to get involved but aren't sure what to start with, just ask on Slack or GitHub discussions and we'll be happy to help you. Or you can look for an open issue. Any work on major changes should be discussed with the maintainers to make everyone is aligned.

Please see the contribution guidelines for detailed requirements. The developers' Guide has instructions on how to set up a development environment for pyOCD.

New pull requests should be created against the develop branch. (You have to change the "base" to develop.)

License

PyOCD is licensed with the permissive Apache 2.0 license. See the LICENSE file for the full text of the license. All documentation and the website are licensed with CC BY 4.0.

Copyright © 2006-2022 PyOCD Authors

cmsis-pack-manager's People

Contributors

andelf avatar c1728p9 avatar claymation avatar david-sawatzke avatar dependabot[bot] avatar dvzrv avatar flit avatar imi415 avatar ithinuel avatar jelly avatar mathias-arm avatar mbrossard avatar noahp avatar noppej avatar sarahmarshy avatar theotherjimmy avatar tiwalun avatar yatekii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cmsis-pack-manager's Issues

Install with pip >=20 always triggers build

Downgrading to < 20 uses wheel.

$ pip --version
pip 20.0.1 from /home/juho/py3/lib/python3.5/site-packages/pip (python 3.5)
(py3) juho@ub:~$ pip install cmsis-pack-manager
Collecting cmsis-pack-manager
  Using cached cmsis-pack-manager-0.2.9.tar.gz (42 kB)
Collecting appdirs>=1.4
  Using cached appdirs-1.4.3-py2.py3-none-any.whl (12 kB)
Collecting milksnake>=0.1.2
  Using cached milksnake-0.1.5-py2.py3-none-any.whl (9.6 kB)
Processing ./.cache/pip/wheels/e4/76/4d/a95b8dd7b452b69e8ed4f68b69e1b55e12c9c9624dd962b191/PyYAML-5.3-cp35-cp35m-linux_x86_64.whl
Collecting cffi>=1.6.0
  Using cached cffi-1.13.2-cp35-cp35m-manylinux1_x86_64.whl (397 kB)
Processing ./.cache/pip/wheels/f2/9a/90/de94f8556265ddc9d9c8b271b0f63e57b26fb1d67a45564511/pycparser-2.19-py2.py3-none-any.whl
Building wheels for collected packages: cmsis-pack-manager
  Building wheel for cmsis-pack-manager (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/juho/py3/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"'; __file__='"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-tar7vy6_
       cwd: /tmp/pip-install-aa67zdj0/cmsis-pack-manager/
  Complete output (9 lines):
  running bdist_wheel
  running build
  running build_py
  creating build/lib
  creating build/lib/cmsis_pack_manager
  copying cmsis_pack_manager/__init__.py -> build/lib/cmsis_pack_manager
  copying cmsis_pack_manager/_version.py -> build/lib/cmsis_pack_manager
  copying cmsis_pack_manager/pack_manager.py -> build/lib/cmsis_pack_manager
  error: [Errno 2] No such file or directory: 'cargo'
  ----------------------------------------
  ERROR: Failed building wheel for cmsis-pack-manager
  Running setup.py clean for cmsis-pack-manager
Failed to build cmsis-pack-manager
Installing collected packages: appdirs, pycparser, cffi, milksnake, pyyaml, cmsis-pack-manager
    Running setup.py install for cmsis-pack-manager ... error
    ERROR: Command errored out with exit status 1:
     command: /home/juho/py3/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"'; __file__='"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-jt_ysbz4/install-record.txt --single-version-externally-managed --compile --install-headers /home/juho/py3/include/site/python3.5/cmsis-pack-manager
         cwd: /tmp/pip-install-aa67zdj0/cmsis-pack-manager/
    Complete output (9 lines):
    running install
    running build
    running build_py
    creating build/lib
    creating build/lib/cmsis_pack_manager
    copying cmsis_pack_manager/__init__.py -> build/lib/cmsis_pack_manager
    copying cmsis_pack_manager/_version.py -> build/lib/cmsis_pack_manager
    copying cmsis_pack_manager/pack_manager.py -> build/lib/cmsis_pack_manager
    error: [Errno 2] No such file or directory: 'cargo'
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/juho/py3/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"'; __file__='"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-jt_ysbz4/install-record.txt --single-version-externally-managed --compile --install-headers /home/juho/py3/include/site/python3.5/cmsis-pack-manager Check the logs for full command output.
(py3) juho@ub:~$ pip install pip==19.3.1
Collecting pip==19.3.1
  Using cached pip-19.3.1-py2.py3-none-any.whl (1.4 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.0.1
    Uninstalling pip-20.0.1:
      Successfully uninstalled pip-20.0.1
Successfully installed pip-19.3.1
(py3) juho@ub:~$ pip install cmsis-pack-manager
Collecting cmsis-pack-manager
  Using cached https://files.pythonhosted.org/packages/fd/6b/b1f8f4117b3a4efafbdb04eaa7e7685a395cda565b3b221860d04f2a827c/cmsis_pack_manager-0.2.9-py2.py3-none-manylinux1_x86_64.whl
Requirement already satisfied: pyyaml>=3.12 in ./py3/lib/python3.5/site-packages (from cmsis-pack-manager) (5.3)
Requirement already satisfied: milksnake>=0.1.2 in ./py3/lib/python3.5/site-packages (from cmsis-pack-manager) (0.1.5)
Requirement already satisfied: appdirs>=1.4 in ./py3/lib/python3.5/site-packages (from cmsis-pack-manager) (1.4.3)
Requirement already satisfied: cffi>=1.6.0 in ./py3/lib/python3.5/site-packages (from milksnake>=0.1.2->cmsis-pack-manager) (1.13.2)
Requirement already satisfied: pycparser in ./py3/lib/python3.5/site-packages (from cffi>=1.6.0->milksnake>=0.1.2->cmsis-pack-manager) (2.19)
Installing collected packages: cmsis-pack-manager
Successfully installed cmsis-pack-manager-0.2.9
WARNING: You are using pip version 19.3.1; however, version 20.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

STM32F207ZG sectors not written out (sectors : null)

See originating PR; ARMmbed/mbed-os#11707

The Keil CMSIS-pack file has this for the

        <!-- *************************  Device 'STM32F207ZG'  ***************************** -->
        <device Dname="STM32F207ZG">
          <memory id="IROM1"                               start="0x08000000" size="0x00100000" startup="1" default="1"/>
          <memory id="IRAM1"                               start="0x20000000" size="0x00020000" init   ="0" default="1"/>
          <algorithm name="CMSIS/Flash/STM32F2xx_1024.FLM" start="0x08000000" size="0x00100000"             default="1"/>
          <algorithm name="CMSIS/Flash/STM32F2xx_OPT.FLM"  start="0x1FFFC000" size="0x00000010"             default="0"/>
          <algorithm name="CMSIS/Flash/STM32F2xx_OTP.FLM"  start="0x1FFF7800" size="0x00000210"             default="0"/>
          <feature type="ADC"           n="24"      m="12"/>
          <feature type="IOs"           n="114"/>
          <variant Dvariant="STM32F207ZGTx"> <feature type="QFP" n="144"/> </variant>
        </device>

The current index.json under tools/arm_pack_manager has this information:

        "name": "STM32F207ZGTx", 
        "processor": {
            "Symmetric": {
                "core": "CortexM3", 
                "fpu": "None", 
                "mpu": "Present", 
                "units": 1
            }
        }, 
        "sectors": [
            [
                134217728, 
                16384
            ], 
            [
                134283264, 
                65536
            ], 
            [
                134348800, 
                131072
            ], 
            [
                536836096, 
                528
            ], 
            [
                536854528, 
                16
            ]
        ], 

So, the information seems to be essentially there, but it is not parsed out somehow / generated to the output.

Output is:

    "name": "STM32F207ZGTx", 
    "processor": {
        "Symmetric": {
            "core": "CortexM3", 
            "fpu": "None", 
            "mpu": "Present", 
            "units": 1
        }
    }, 
    "sectors": null, 

Using pack manager on arm-based system

I've tried to install newest pyocd version on armbian, but when trying to install it even with pip, every time installed version of pack manager is 0.1. Is it possible to install newest version of pack manager on arm-based system? sorry for newbie question, but i've tried to google it, without any results.

After Win10 clean mbed CLI install (Mbed_installer_v0.4.10.exe), CMSIS errors

D:\Dev\mbed-os-example-ble\BLE_HeartRate>mbed compile -t ARM -m NRF52840_DK
[mbed] Working path "D:\Dev\mbed-os-example-ble\BLE_HeartRate" (library)
[mbed] Program path "D:\Dev\mbed-os-example-ble\BLE_HeartRate"
[mbed] Auto-installing missing Python modules (cmsis_pack_manager)...
Traceback (most recent call last):
  File "D:\Dev\mbed-os-example-ble\BLE_HeartRate\mbed-os\tools\make.py", line 41, in <module>
    from tools.options import get_default_options_parser
  File "D:\Dev\mbed-os-example-ble\BLE_HeartRate\mbed-os\tools\options.py", line 24, in <module>
    from .toolchains import TOOLCHAINS, EXTRA_TOOLCHAIN_NAMES
  File "D:\Dev\mbed-os-example-ble\BLE_HeartRate\mbed-os\tools\toolchains\__init__.py", line 19, in <module>
    from . import mbed_toolchain, arm, gcc, iar
  File "D:\Dev\mbed-os-example-ble\BLE_HeartRate\mbed-os\tools\toolchains\mbed_toolchain.py", line 48, in <module>
    from ..config import (ConfigException, RAM_ALL_MEMORIES, ROM_ALL_MEMORIES)
  File "D:\Dev\mbed-os-example-ble\BLE_HeartRate\mbed-os\tools\config\__init__.py", line 33, in <module>
    from ..arm_pack_manager import Cache
  File "D:\Dev\mbed-os-example-ble\BLE_HeartRate\mbed-os\tools\arm_pack_manager\__init__.py", line 24, in <module>
    from cmsis_pack_manager import Cache as _Cache
  File "C:\Python27\lib\site-packages\cmsis_pack_manager\__init__.py", line 21, in <module>
    from ._native import ffi, lib
  File "C:\Python27\lib\site-packages\cmsis_pack_manager\_native.py", line 7, in <module>
    lib = ffi.dlopen(os.path.join(os.path.dirname(__file__), '_native__lib.cp37-win32.pyd'), 0)
OSError: cannot load library 'C:\Python27\lib\site-packages\cmsis_pack_manager\_native__lib.cp37-win32.pyd': error 0x7e
[mbed] ERROR: "C:\Python27\python.exe" returned error.
       Code: 1
       Path: "D:\Dev\mbed-os-example-ble\BLE_HeartRate"
       Command: "C:\Python27\python.exe -u D:\Dev\mbed-os-example-ble\BLE_HeartRate\mbed-os\tools\make.py -t ARM -m NRF52840_DK --source . --build .\BUILD\NRF52840_DK\ARM"
       Tip: You could retry the last command with "-v" flag for verbose output

build problem on FreeBSD

Hello world, I have problem building on FreeBSD.. any hints welcome :-)

(venv37bsd) python setup.py -v install
fatal: not a git repository (or any parent up to mount point /ztuff)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
running install
running bdist_egg
running egg_info
writing cmsis_pack_manager.egg-info/PKG-INFO
writing dependency_links to cmsis_pack_manager.egg-info/dependency_links.txt
writing entry points to cmsis_pack_manager.egg-info/entry_points.txt
writing requirements to cmsis_pack_manager.egg-info/requires.txt
writing top-level names to cmsis_pack_manager.egg-info/top_level.txt
'license_file' option was not specified
reading manifest file 'cmsis_pack_manager.egg-info/SOURCES.txt'
writing manifest file 'cmsis_pack_manager.egg-info/SOURCES.txt'
installing library code to build/bdist.freebsd-12.0-RELEASE-p3-amd64/egg
running install_lib
running build_py
not copying cmsis_pack_manager/__init__.py (output up-to-date)
not copying cmsis_pack_manager/pack_manager.py (output up-to-date)
error: [Errno 2] No such file or directory: 'cargo': 'cargo'

(venv37bsd) pip show cargo
Name: cargo
Version: 0.1.1
Summary: Transform dictionaries into Python objects
Home-page: github.com/eugene-eeo/cargo
Author: Eugene Eeo
Author-email: [email protected]
License: UNKNOWN
Location: /ztuff/cederom/(..)/venv37bsd/lib/python3.7/site-packages
Requires:
Required-by:

(venv37bsd) python --version
Python 3.7.3

(venv37bsd) uname -a
FreeBSD 0xCFC2 12.0-RELEASE-p3 FreeBSD 12.0-RELEASE-p3 GENERIC  amd64

(venv37bsd) ls
LICENSE                         appveyor.yml                    cmsis_pack_manager.egg-info     setup.py
README.md                       build                           requirements.txt                setup_requirements.txt
apache-2.0.txt                  build-wheels.sh                 rust                            test_requirements.txt
appveyor.bat                    cmsis_pack_manager              setup.cfg                       tests
(venv37bsd)

Would be really nice if cmsis-pack-manager was also provided in PyPI as sources so it can be automtically compiled by pip on platforms that have no binaries provided :-)

add sources to pypi

Hi!

Can you please upload the source ti pypi server in addition to the wheel files? It can be useful for some use cases. Thanks in advance!

Btw, if I am trying to install the source from the releases the tab I am getting en error when building the package. I am using win10.

Installation error on linux

Hi,

I am trying to install this package in my raspberry pi on linux (raspbian):

Getting a stable version of rust:

(venv) pi@raspberrypi:~ $ rustup update stable
info: syncing channel updates for 'stable-armv7-unknown-linux-gnueabihf'

  stable-armv7-unknown-linux-gnueabihf unchanged - rustc 1.42.0 (b8cedc004 2020-03-09)

info: checking for self-updates

Installing from master:

(venv) pi@raspberrypi:~ $ pip install git+https://github.com/ARMmbed/cmsis-pack-manager.git
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting git+https://github.com/ARMmbed/cmsis-pack-manager.git
  Cloning https://github.com/ARMmbed/cmsis-pack-manager.git to /tmp/pip-req-build-90tutd2x
Requirement already satisfied: appdirs>=1.4 in ./race-automated-testing/venv/lib/python3.7/site-packages (from cmsis-pack-manager==0.2.10.dev4) (1.4.3)
Requirement already satisfied: milksnake>=0.1.2 in ./race-automated-testing/venv/lib/python3.7/site-packages (from cmsis-pack-manager==0.2.10.dev4) (0.1.5)
Requirement already satisfied: pyyaml>=3.12 in ./race-automated-testing/venv/lib/python3.7/site-packages (from cmsis-pack-manager==0.2.10.dev4) (5.3)
Requirement already satisfied: cffi>=1.6.0 in ./race-automated-testing/venv/lib/python3.7/site-packages (from milksnake>=0.1.2->cmsis-pack-manager==0.2.10.dev4) (1.14.0)
Requirement already satisfied: pycparser in ./race-automated-testing/venv/lib/python3.7/site-packages (from cffi>=1.6.0->milksnake>=0.1.2->cmsis-pack-manager==0.2.10.dev4) (2.20)
Building wheels for collected packages: cmsis-pack-manager
  Running setup.py bdist_wheel for cmsis-pack-manager ... error
  Complete output from command /home/pi/race-automated-testing/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-90tutd2x/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-yrzxacot --python-tag cp37:
  running bdist_wheel
  running build
  running build_py
  creating build/lib
  creating build/lib/cmsis_pack_manager
  copying cmsis_pack_manager/__init__.py -> build/lib/cmsis_pack_manager
  copying cmsis_pack_manager/pack_manager.py -> build/lib/cmsis_pack_manager
  copying cmsis_pack_manager/_version.py -> build/lib/cmsis_pack_manager
      Updating crates.io index
     Compiling libc v0.2.67
     Compiling cfg-if v0.1.10
     Compiling autocfg v1.0.0
     Compiling lazy_static v1.4.0
     Compiling semver-parser v0.7.0
     Compiling byteorder v1.3.4
     Compiling futures v0.1.29
     Compiling cc v1.0.50
     Compiling log v0.4.8
     Compiling either v1.5.3
     Compiling maybe-uninit v2.0.0
     Compiling slab v0.4.2
     Compiling scopeguard v1.1.0
     Compiling proc-macro2 v1.0.9
     Compiling unicode-xid v0.2.0
     Compiling syn v1.0.16
     Compiling fnv v1.0.6
     Compiling version_check v0.9.1
     Compiling rand_core v0.4.2
     Compiling autocfg v0.1.7
     Compiling matches v0.1.8
     Compiling smallvec v1.2.0
     Compiling itoa v0.4.5
     Compiling rustc-demangle v0.1.13
     Compiling spin v0.5.2
     Compiling untrusted v0.7.0
     Compiling failure_derive v0.1.7
     Compiling slog v2.5.2
     Compiling serde v1.0.104
     Compiling ryu v1.0.3
     Compiling percent-encoding v1.0.1
     Compiling httparse v1.3.4
     Compiling try-lock v0.2.2
     Compiling regex-syntax v0.6.17
     Compiling percent-encoding v2.1.0
     Compiling crc32fast v1.2.0
     Compiling adler32 v1.0.4
     Compiling encoding_rs v0.8.22
     Compiling mime v0.3.16
     Compiling dtoa v0.4.5
     Compiling take_mut v0.2.2
     Compiling scoped-tls v0.1.2
     Compiling encoding_rs v0.6.11
     Compiling try_from v0.3.2
  error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
    --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/encoding_rs-0.6.11/src/utf_16.rs:33:44
     |
  33 |     pub fn additional_from_state(&self) -> usize() {
     |                                            ^^^^^^^ only `Fn` traits may use parentheses
  
     Compiling thread_local v1.0.1
  error: aborting due to previous error
  
  For more information about this error, try `rustc --explain E0214`.
  error: could not compile `encoding_rs`.
  warning: build failed, waiting for other jobs to finish...
  error: build failed
  
  ----------------------------------------
  Failed building wheel for cmsis-pack-manager
  Running setup.py clean for cmsis-pack-manager
Failed to build cmsis-pack-manager
Installing collected packages: cmsis-pack-manager
  Running setup.py install for cmsis-pack-manager ... error
    Complete output from command /home/pi/race-automated-testing/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-90tutd2x/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-8gzoqi08/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/race-automated-testing/venv/include/site/python3.7/cmsis-pack-manager:
    running install
    running build
    running build_py
    creating build/lib
    creating build/lib/cmsis_pack_manager
    copying cmsis_pack_manager/__init__.py -> build/lib/cmsis_pack_manager
    copying cmsis_pack_manager/pack_manager.py -> build/lib/cmsis_pack_manager
    copying cmsis_pack_manager/_version.py -> build/lib/cmsis_pack_manager
       Compiling libc v0.2.67
       Compiling semver v0.9.0
       Compiling crossbeam-utils v0.7.2
       Compiling crossbeam-epoch v0.8.2
       Compiling indexmap v1.3.2
       Compiling num-traits v0.2.11
       Compiling encoding_rs v0.6.11
       Compiling num-integer v0.1.42
    error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
      --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/encoding_rs-0.6.11/src/utf_16.rs:33:44
       |
    33 |     pub fn additional_from_state(&self) -> usize() {
       |                                            ^^^^^^^ only `Fn` traits may use parentheses
    
       Compiling crossbeam-utils v0.6.6
       Compiling byteorder v1.3.4
       Compiling log v0.4.8
       Compiling backtrace-sys v0.1.34
    error: aborting due to previous error
    
    For more information about this error, try `rustc --explain E0214`.
    error: could not compile `encoding_rs`.
    warning: build failed, waiting for other jobs to finish...
    error: build failed
    
    ----------------------------------------
Command "/home/pi/race-automated-testing/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-90tutd2x/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-8gzoqi08/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/race-automated-testing/venv/include/site/python3.7/cmsis-pack-manager" failed with error code 101 in /tmp/pip-req-build-90tutd2x/

This (probe-rs/target-gen#9) suggests that it should compile with rustc version 1.40.0 but when I try installing it I get:

(venv) pi@raspberrypi:~ $ rustup install 1.40.0
info: syncing channel updates for '1.40.0-armv7-unknown-linux-gnueabihf'
info: latest update on 2019-12-19, rust version 1.40.0 (73528e339 2019-12-16)
error: component 'clippy' for target 'armv7-unknown-linux-gnueabihf' is unavailable for download for channel 1.40.0

I would appreciate any help. I am quite a noob with rust and this package, it is a dependency of another package I use in my tests.

Thanks!

Exception running pack-manager with no arguments

Running pack-manager with no command line arguments produces this exception:

Traceback (most recent call last):
  File "/Users/creed/projects/pyOCD-flit/venv/mac37/bin/pack-manager", line 11, in <module>
    sys.exit(main())
  File "/Users/creed/projects/pyOCD-flit/venv/mac37/lib/python3.7/site-packages/cmsis_pack_manager/pack_manager.py", line 204, in main
    args.command(args)
AttributeError: 'Namespace' object has no attribute 'command'

It should probably print usage.

Add families list to index

Having the family, and subfamily if present, available in the device info dict would be useful for presenting information to users, as well as for filtering. I'd prefer a single families key that is a list.

Include Dname in index

The pack index does not appear to include Dname part numbers, only Dvariant.

For instance, the NXP MIMXRT1052_DFP pack has a Dname of "MIMXRT1052xxxxB" with several Dvariants, including "MIMXRT1052CVJ5B". Only the Dvariant names are present in the index.

Exception if the cache is empty

Cache.index raises an exception if the index.json file is not present. It should instead return an empty dict.

Traceback:

Traceback (most recent call last):
  File "/Users/creed/projects/pyOCD-flit/pyocd/__main__.py", line 320, in run
    self._commands[self._args.cmd]()
  File "/Users/creed/projects/pyOCD-flit/pyocd/__main__.py", line 352, in do_list
    obj = ListGenerator.list_targets(self._args.pack)
  File "/Users/creed/projects/pyOCD-flit/pyocd/tools/lists.py", line 124, in list_targets
    for dev in pack_target.get_supported_targets():
  File "/Users/creed/projects/pyOCD-flit/pyocd/target/pack/pack_target.py", line 33, in get_supported_targets
    return sorted([dev for name, dev in cache.index.items() if name != "version"],
  File "/Users/creed/projects/pyOCD-flit/venv/mac37/lib/python3.7/site-packages/cmsis_pack_manager/__init__.py", line 119, in index
    with open(self.index_path) as i:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/creed/Library/Application Support/cmsis-pack-manager/index.json'

Implement log level controls

The Cache constructor nominally takes a silent parameter, but this is not actually implemented. Finer log level control would also be useful.

Use combined index.pidx

An index.pidx file is available on the Keil pack index site that is a flat listing of all packs from all vendors. CPM should use this single index file instead of downloading keil.vidx/keil.pidx and then each vendor index, as it should be faster.

`raw_input` not defined when attempting to download pack via tool

Running pack-manager cache devs STM32F401RETx results in this exception:

Traceback (most recent call last):
  File "/Users/creed/projects/pyOCD-flit/venv/mac37/bin/pack-manager", line 10, in <module>
    sys.exit(main())
  File "/Users/creed/projects/pyOCD-flit/venv/mac37/lib/python3.7/site-packages/cmsis_pack_manager/pack_manager.py", line 235, in main
    args.command(args)
  File "/Users/creed/projects/pyOCD-flit/venv/mac37/lib/python3.7/site-packages/cmsis_pack_manager/pack_manager.py", line 94, in thunk
    return command(cache, **argv)
  File "/Users/creed/projects/pyOCD-flit/venv/mac37/lib/python3.7/site-packages/cmsis_pack_manager/pack_manager.py", line 148, in command_cache
    raw_input("Press Control-C to quit; Press Enter to continue")
NameError: name 'raw_input' is not defined

cmsis-pack-manager fails to download some CMSIS-packs

If you try to update the cmsis packs in Mbed OS with python project.py -m STM32F7xx --update-packs it will start downloading the pack files.

For a few ST packs, you will get the following error note:

Oct 02 18:34:25.840 ERRO download of "https://www.keil.com/pack/Keil.STM32F7xx_DFP.pdsc" failed: unexpected end of file
Oct 02 18:34:25.840 ERRO download of "https://www.keil.com/pack/Keil.STM32H7xx_DFP.pdsc" failed: unexpected end of file
Oct 02 18:34:25.840 ERRO download of "https://www.keil.com/pack/Keil.STM32G0xx_DFP.pdsc" failed: unexpected end of file

(Edit: removed the faulty analysis of any redirects, title updated, too).

JSON index files are always rebuilt

It seems that CPM always rebuilds the JSON index files from the .pdsc files, even if only downloading a pack already referenced in the index. This takes a considerable amount of time, on the order of 15 seconds on a very fast MacBook Pro. Actually downloading the pack is usually much faster than that.

The index should only be rebuilt when the PDSC files are downloaded.

Need API to download a single pack

A Python API is needed to enable downloading the pack containing support for a given full device name. If the pack is already installed and a newer version is available, then it should update that pack.

`cache` subcommand positional args need help

The usage for the cache subcommand lists the positional arguments that control the cache operation, but there is no description of what the different positional argument values mean.

Need version option

pack-manager needs a way to print the version, the typical --version or -V option.

cmsis-pack-manager 0.1.1

on a raspberry pi running ubuntu 18.04.2 "pip3 install pyocd" complains about "cmsis-pack-manager 0.1.1":

ERROR: pyocd 0.21.0 has requirement cmsis-pack-manager>=0.2.7, but you'll have cmsis-pack-manager 0.1.1 which is incompatible.
Installing collected packages: cmsis-pack-manager
  Found existing installation: cmsis-pack-manager 0.1.1
    Uninstalling cmsis-pack-manager-0.1.1:
      Successfully uninstalled cmsis-pack-manager-0.1.1
Successfully installed cmsis-pack-manager-0.1.1

upon investigation, this
https://github.com/ARMmbed/cmsis-pack-manager/blob/e26f87d797715aa2f5111b6333e0908dea8ece80/setup.py#L55

seems to be the cause.

after downloading 0.2.8 source tarball from pypi, changing "0.1.1" to "0.2.8", building cmsis-pack-manager and installation in a new virtualenv, installation of pyocd finally succeeds.

Failure to download STM32F4xx DFP

If the Python API is used to download the Keil::STM32F4xx_DFP::2.13.0 pack, you get this file instead:

<?xml version="1.0" encoding="utf-8"?><Error><Code>BlobNotFound</Code><Message>The specified blob does not exist.
RequestId:00ffc5ad-601e-00b2-3a34-f61678000000
Time:2019-04-18T22:14:45.2212973Z</Message></Error>

Downloading manually from http://www.keil.com/dd2/pack works fine.

API to get index of installed packs

Need an API, and optionally a command line subcommand, to get the index of installed (downloaded) packs.

The existing Cache.index property should remain the same, returning all available packs.

cmsis_update::update()

Hi!

Is there a reason that cmsis_update::install() for example requires some type with a trait implemented to be passed into it just to configure it and get some progress update?
Why can't this be fixed? Is it because of the python interface? Even then I think this can be implemented with a less complicated interface which I'd highly prefer.

Also, is there a reason you force users to use slog or did you just not care enough? Because I don't want to use slog but I now have to include the dependency anyways. And exactly for this scenario there is https://docs.rs/log/0.4.8/log/ which provides a nice and unified frontend for maaaany different backends (slogbeing one of them).

I know this crate was maybe not written with intent to be reused as a lib, so don't take my criticism too harsh, I just wanted to ask and would make those improvements in a PR if that's ok =)

Best,
Yatekii

CPM crashing on Windows

Running version 0.2.6 in Python 2.7.13 on Windows 10.

The python instance crashes for me (Windows has a pop up showing that python.exe has stopped working).

The log for me looks like this:

Apr 15 15:41:20.997 WARN No Core found!, Package: CMSIS, Vendor: ARM
Apr 15 15:41:21.232 ERRO when trying to parse component: child element "description" not found in "component" element, Package: RS14100_DFP, Vendor: Redpine
Apr 15 15:41:21.260 WARN invalid digit found in string, Package: TLE984x_DFP, Vendor: Infineon
memory allocation of 80359 bytes failed

Cache command does not have help in main tool usage

Here's the result of running pack-manager --help:

usage: pack-manager [-h] {cache,find-part,dump-parts,add-packs} ...

A utility that keeps your cache of pack files up to date.

optional arguments:
  -h, --help            show this help message and exit

Commands:
  {cache,find-part,dump-parts,add-packs}
    find-part           Find a part and its description within the cache
    dump-parts          Create a directory with an `index.json` describing the
                        part and all of the associated flashing algorithms.
    add-packs           add contents of pdsc files into the index

As you can see, the cache subcommand is listed in braces but does not have a description.

It might also be nice to have descriptive help text that directs users to cache for the common operations of just updating the index.

Unifying the crates

Hi!

I just had a closer look at this lib. Is there a specific you made 8 small crates instead of a big one?
I think it's highly preferrable to have one single crate since all of this functionality is tightly coupled.

What do you think about this?

Best,
Yatekii

Release on crates.io

Hi!

Any chance this is making it to crates.io with proper docs soon?

Best,
Yatekii

Relax PDSC parsing rules

The NordicSemiconductor.nRF_DeviceFamilyPack.8.26.0 PDSC causes CPM to spew 12 of these errors:

Oct 05 11:32:49.098 ERRO when trying to parse component: child element "description" not found in "component" element, Package: nRF_DeviceFamilyPack, Vendor: NordicSemiconductor

It seems like description elements should not cause an error if missing, even though they are technically required by the schema. At least this should be changed to a warning, or better, to a debug message. (I know it doesn't stop the PDSC from being parsed, but it might unduly worry users.)

"failed to lookup address information" exception on index download

I'm seeing this exception when I either run pack-manager cache pdsc or directly call Cache.cache_descriptors(). I've tried running pack-magager cache rm prior to attempting again, to no avail.

Io(Custom { kind: Other, error: StringError("failed to lookup address information: nodename nor servname provided, or not known") })
Traceback (most recent call last):
  File "/Users/creed/projects/pyOCD-flit/venv/mac37/bin/pack-manager", line 10, in <module>
    sys.exit(main())
  File "/Users/creed/projects/pyOCD-flit/venv/mac37/lib/python3.7/site-packages/cmsis_pack_manager/pack_manager.py", line 235, in main
    args.command(args)
  File "/Users/creed/projects/pyOCD-flit/venv/mac37/lib/python3.7/site-packages/cmsis_pack_manager/pack_manager.py", line 94, in thunk
    return command(cache, **argv)
  File "/Users/creed/projects/pyOCD-flit/venv/mac37/lib/python3.7/site-packages/cmsis_pack_manager/pack_manager.py", line 134, in command_cache
    cache.cache_descriptors()
  File "/Users/creed/projects/pyOCD-flit/venv/mac37/lib/python3.7/site-packages/cmsis_pack_manager/__init__.py", line 287, in cache_descriptors
    pdsc_index = self._call_rust_update(progress_fn)
  File "/Users/creed/projects/pyOCD-flit/venv/mac37/lib/python3.7/site-packages/cmsis_pack_manager/__init__.py", line 259, in _call_rust_update
    pdsc_index = lib.update_pdsc_result(poll_obj)
  File "/Users/creed/projects/pyOCD-flit/venv/mac37/lib/python3.7/site-packages/cmsis_pack_manager/__init__.py", line 35, in __exit__
    raise Exception(ffi.string(maybe_err))
Exception: b'\nfailed to lookup address information: nodename nor servname provided, or not known'

Download fails when behind firewall

Downloading the index fails immediately because cpm cannot access http://www.keil.com/pack/keil.pidx or http://www.keil.com/pack/keil.vidx.

The user is behind a proxy and firewall, and is running on a VM.

User @rgf97 reported this issue in the context of pyOCD. See pyocd/pyOCD#638 for the original issue.

Log from pyocd follows. This is the equivalent of running pack-manager cache pdsc.

(venv) osboxes@osboxes:~/Desktop/pyOCD$ pyocd --version
0.20.0
(venv) osboxes@osboxes:~/Desktop/pyOCD$ which pyocd
/home/osboxes/Desktop/pyOCD/venv/bin/pyocd
(venv) osboxes@osboxes:~/Desktop/pyOCD$ pyocd pack --install stm32l476rg
0000181:INFO:__main__:No pack index present, downloading now...
Apr 29 11:10:07.321 ERRO failed to lookup address information: Name or service not known, uri: http://www.keil.com/pack/keil.pidx
Apr 29 11:10:07.322 ERRO failed to lookup address information: Name or service not known, uri: http://www.keil.com/pack/keil.vidx
0000687:WARNING:__main__:No matching devices. Please make sure the pack index is up to date.
(venv) osboxes@osboxes:~/Desktop/pyOCD$ pyocd pack --install STM32L4xx_DFP
0000194:INFO:__main__:No pack index present, downloading now...
Apr 29 11:15:16.777 ERRO failed to lookup address information: Name or service not known, uri: http://www.keil.com/pack/keil.pidx
Apr 29 11:15:16.781 ERRO failed to lookup address information: Name or service not known, uri: http://www.keil.com/pack/keil.vidx
0000702:WARNING:__main__:No matching devices. Please make sure the pack index is up to date.
(venv) osboxes@osboxes:~/Desktop/pyOCD$ pyocd pack --install stm32f429zi
0000189:INFO:__main__:No pack index present, downloading now...
Apr 29 11:18:29.034 ERRO failed to lookup address information: Name or service not known, uri: http://www.keil.com/pack/keil.pidx
Apr 29 11:18:29.035 ERRO failed to lookup address information: Name or service not known, uri: http://www.keil.com/pack/keil.vidx
0000696:WARNING:__main__:No matching devices. Please make sure the pack index is up to date.
(venv) osboxes@osboxes:~/Desktop/pyOCD$ pyocd pack --install STM32F4xx_DFP
0000183:INFO:__main__:No pack index present, downloading now...
Apr 29 11:20:31.595 ERRO failed to lookup address information: Name or service not known, uri: http://www.keil.com/pack/keil.pidx
Apr 29 11:20:31.598 ERRO failed to lookup address information: Name or service not known, uri: http://www.keil.com/pack/keil.vidx
0000689:WARNING:__main__:No matching devices. Please make sure the pack index is up to date.

Version mismatch causes pack download to fail

The nRF DFP is all screwed up…

The Keil pack list site shows the latest version as 8.24.1. The pindex section of keil.vidx has a link to the nRF DFP version 8.7.1. (There is no Nordic-hosted pidx.) But the NordicSemiconductor.nRF_DeviceFamilyPack.8.7.1.pdsc file shows the most recent version is 8.26.0.

I think I understand why the keil.vidx and PDSC differ. The link to the PDSC is owned by Keil, whereas the PDSC and pack are on Nordic's site. So instead of communicating with the Keil team, Nordic has just continued to add new versions in the same PDSC without renaming the file and pack. Of course, this breaks the CMSIS-Pack versioning scheme.

When I attempt to download the nRF DFP using CPM via pyOCD, it reports this error:

$ pyocd pack -i nrf91
Downloading packs (press Control-C to cancel):
    NordicSemiconductor::nRF_DeviceFamilyPack::8.26.0
Oct 05 12:01:13.923 WARN No such file or directory (os error 2)

The version mismatch is undoubtedly the culprit here.

I'm not really sure what CPM should do to work around this, mostly because I'm not sure where the error is actually coming from.

cc @jkrech

Non-standard native library names

CPM uses apparently non-standard native library names. On Posix systems the name is _native__lib.so, while on Windows it looks like _native__lib.cp37-win_amd64.pyd.

This is only a problem because PyInstaller expects libraries to match one of the following globs: *.dll, *.dylib, lib*.pyd, and lib*.so. So basically, libs with .so and .pyd extensions are expected to have a "lib" prefix.

I've worked around it in the PyInstaller .spec file for pyOCD, but thought it was worth mentioning.

Compiler warnings on trait objects without explicit `dyn`.

We get some compiler warnings, as below:

warning: trait objects without an explicit `dyn` are deprecated
   --> pdsc/src/component.rs:225:17
    |
225 | ) -> Result<Box<Iterator<Item = ComponentBuilder>>, Error> {
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = ComponentBuilder>`
    |
    = note: `#[warn(bare_trait_objects)]` on by default

   Compiling reqwest v0.9.22
   Compiling cmsis-update v0.1.0 (/home/jankii01/mbed/cmsis-pack-manager/rust/cmsis-update)
warning: trait objects without an explicit `dyn` are deprecated
   --> cmsis-update/src/download.rs:153:14
    |
153 |     ) -> Box<Future<Item = (), Error = Error> + 'a> {
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Future<Item = (), Error = Error> + 'a`
    |
    = note: `#[warn(bare_trait_objects)]` on by default

warning: trait objects without an explicit `dyn` are deprecated
   --> cmsis-update/src/download.rs:188:14
    |
188 |     ) -> Box<Stream<Item = PathBuf, Error = Error> + 'a>
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Stream<Item = PathBuf, Error = Error> + 'a`

macOS - ERROR: Could not find a version that satisfies the requirement cmsis-pack-manager>=0.2.6 (from pyocd) (from versions: 0.1.0)

When installing from venv or otherwise:

ERROR: Could not find a version that satisfies the requirement cmsis-pack-manager>=0.2.6 (from pyocd) (from versions: 0.1.0)
ERROR: No matching distribution found for cmsis-pack-manager>=0.2.6 (from pyocd)

Trying to build cmsis-pack-manager results in

venv] jhg@i7joe:/private/tmp/cmsis-pack-manager                                                                                                       > python setup.py build
warning: no previously-included files found matching 'setup.pyc'
warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
warning: no previously-included files matching 'lextab.*' found under directory 'tests'
warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
warning: no previously-included files matching 'lextab.*' found under directory 'examples'
zip_safe flag not set; analyzing archive contents...
pycparser.ply.lex: module references __file__
pycparser.ply.lex: module MAY be using inspect.getsourcefile
pycparser.ply.yacc: module references __file__
pycparser.ply.yacc: module MAY be using inspect.getsourcefile
pycparser.ply.yacc: module MAY be using inspect.stack
pycparser.ply.ygen: module references __file__

Installed /private/tmp/cmsis-pack-manager/.eggs/pycparser-2.19-py2.7.egg
running build
running build_py
error: [Errno 2] No such file or directory
Exit 1

Cheers,
Joe

Some targets still not having flash algorithms being marked as "default"

This is specific to CPM's use in Mbed OS. This PR solved a lot of these issues: #79

However a few targets still don't have any flash algorithms marked as default.

This target (MK11DN512VMC5) has its algorithm marked as default:

<devices>
    <family Dfamily="MK11D5" Dvendor="NXP:11">
      <description>The Kinetis(r) K11 50 MHz baseline MCUs, built on the ARM(r) Cortex(r)-M4 core, are optimized for cost-sensitive applications requiring low-power, security encryption, tamper detection and processing efficiency. This family shares the comprehensive enablement and scalability of the Kinetis portfolio.</description>
      <device Dname="MK11DN512xxx5">
        <processor Dcore="Cortex-M4" Dfpu="0" Dendian="Little-endian" Dclock="50000000"/>
        <environment name="iar">
          <file category="linkerfile" name="iar/MK11DN512xxx5_flash.icf"/>
        </environment>
        <memory name="FLEX_RAM" access="rw" start="0x14000000" size="0x1000"/>
        <memory name="PROGRAM_FLASH" access="rx" start="0x00000000" size="0x080000" startup="1" default="1"/>
        <memory name="SRAM_LOWER" access="rw" start="0x1fff8000" size="0x8000" default="1"/>
        <memory name="SRAM_UPPER" access="rw" start="0x20000000" size="0x8000"/>
        <algorithm name="arm/MK_P512_50MHZ.FLM" start="0x00000000" size="0x00080000" default="1"/>
        <debug svd="MK11D5.xml"/>
        <variant Dvariant="MK11DN512VLK5">
          <compile header="fsl_device_registers.h" define="CPU_MK11DN512VLK5"/>
          <environment name="uv">
            <CMisc>--C99</CMisc>
            <LMisc>--scatter "./RTE/Device/MK11DN512VLK5/MK11DN512xxx5_flash.scf"</LMisc>
          </environment>
        </variant>
        <variant Dvariant="MK11DN512VMC5">
          <compile header="fsl_device_registers.h" define="CPU_MK11DN512VMC5"/>
          <environment name="uv">
            <CMisc>--C99</CMisc>
            <LMisc>--scatter "./RTE/Device/MK11DN512VMC5/MK11DN512xxx5_flash.scf"</LMisc>
          </environment>
        </variant>
      </device>
    <!-- SNIP -->
    </family>
</devices

But this target does not (KW24D):

<devices>
  <family Dfamily="KWxx Series" Dvendor="NXP:11">
    <description>
      <!-- SNIP -->
    </description>
    <!-- ******************************  KW2xD  ****************************** -->
    <subFamily DsubFamily="KW2xD">
      <processor Dcore="Cortex-M4" DcoreVersion="r0p0"/>
      <book name="Documents/dui0553a_cortex_m4_dgug.pdf" title="Cortex-M4 Generic User Guide"/>
      <description><!-- SNIP --></description>
      <!-- ******************************  MKW24D512xxx5  ****************************** -->
      <device Dname="MKW24D512xxx5">
        <processor Dfpu="0" Dmpu="0" Dendian="Little-endian" Dclock="50000000"/>
        <compile header="Device/Include/MKW24D5.h" define="MKW24D512xxx5"/>
        <debug svd="SVD/MKW24D5.svd"/>
        <memory id="IROM1"                        start="0x00000000" size="0x00080000" default="1" startup="1"/>
        <memory id="IRAM1"                        start="0x1FFF8000" size="0x00010000" default="1" init   ="0"/>
        <algorithm name="Flash/MK_P512_50MHZ.FLM" start="0x00000000" size="0x00080000" default="1" RAMstart="0x20000000" RAMsize="0x1000"/>

        <book name="Documents/MKW2xDxxx.pdf"   title="MKW24D512xxx5 Data Sheet"/>
        <book name="Documents/MKW2xDxxxRM.pdf" title="MKW24D512xxx5 Reference Manual"/>
      </device>
    </subFamily>
  </family>
</devices>

Any idea why the algo for the KW24D isn't being picked up?

0.2.8 pip pypi source package

Hello @theotherjimmy so much THANK YOU for your work on build fixes and 0.2.8 release. The release sources build fine from the release source files! :-) Could you please provide source package to the pypi so we can download and install CPM with pip? :-)

(venv36bsd) 0xCFC2% pip install cmsis-pack-manager
Collecting cmsis-pack-manager
  Using cached https://files.pythonhosted.org/packages/5e/1f/9368d142276d6305f92236d64ddc8cc7f41fd0781e9a6380d65ab36d898e/cmsis-pack-manager-0.1.0.tar.gz
Requirement already satisfied: appdirs>=1.4 in /ztuff/cederom/usr/local/venv36bsd/lib/python3.6/site-packages (from cmsis-pack-manager) (1.4.3)
Requirement already satisfied: beautifulsoup4>=4.4.1 in /ztuff/cederom/usr/local/venv36bsd/lib/python3.6/site-packages (from cmsis-pack-manager) (4.6.3)
Collecting fuzzywuzzy>=0.10.0 (from cmsis-pack-manager)
  Using cached https://files.pythonhosted.org/packages/d8/f1/5a267addb30ab7eaa1beab2b9323073815da4551076554ecc890a3595ec9/fuzzywuzzy-0.17.0-py2.py3-none-any.whl
ERROR: pyocd 0.21.0 has requirement cmsis-pack-manager>=0.2.7, but you'll have cmsis-pack-manager 0.1.0 which is incompatible.
Installing collected packages: fuzzywuzzy, cmsis-pack-manager
  Running setup.py install for cmsis-pack-manager ... done
Successfully installed cmsis-pack-manager-0.1.0 fuzzywuzzy-0.17.0


(venv36bsd) 0xCFC2% pip install cmsis-pack-manager==0.2.8
Collecting cmsis-pack-manager==0.2.8
  ERROR: Could not find a version that satisfies the requirement cmsis-pack-manager==0.2.8 (from versions: 0.1.0)
ERROR: No matching distribution found for cmsis-pack-manager==0.2.8


(venv36bsd) 0xCFC2% pip install cmsis-pack-manager==
Collecting cmsis-pack-manager==
  ERROR: Could not find a version that satisfies the requirement cmsis-pack-manager== (from versions: 0.1.0)
ERROR: No matching distribution found for cmsis-pack-manager==

Provide progress callback support for downloading index and packs

The Python API needs to support a caller-provided progress callback for the cache_descriptors() and download_pack_list() methods.

Ideally the progress callback would be provided with

  • The name of the file currently being downloaded.
  • URL of current file.
  • Percent complete for current file.
  • Maybe also a total percent complete.

Add HTTP proxy support

This is a request to add support for the http_proxy environment variable so that the index and packs can be downloaded through a proxy server.

See below from @jeromecoutant in pyocd/pyOCD#638. The gist is that curl is able to access the Keil index files from a corporate network behind a proxy, where CPM cannot (it fails with a DNS error).

Hi Back to this issue... I agree that I have some network/PC restrictions due to company policy...
$ pyocd pack --install stm32f303
0000348:INFO:__main__:No pack index present, downloading now...
May 03 11:43:05.522 ERRO No such host is known. (os error 11001), uri: http://www.keil.com/pack/keil.vidx
May 03 11:43:05.523 ERRO No such host is known. (os error 11001), uri: http://www.keil.com/pack/keil.pidx

OK

$ curl -L http://www.keil.com/pack/keil.vidx -O
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5668  100  5668    0     0  21308      0 --:--:-- --:--:-- --:--:-- 21308
100  9622  100  9622    0     0  17590      0 --:--:-- --:--:-- --:--:-- 17590

$ curl -L http://www.keil.com/pack/keil.pidx -O
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5672  100  5672    0     0  60340      0 --:--:-- --:--:-- --:--:-- 60340
100 14216  100 14216    0     0  19771      0 --:--:-- --:--:-- --:--:-- 19771

Seems that curl is calling directly GET HTTP function, whereas pack manager use first DNS call without any proxy setting.

All commands using http_proxy environment variable are working (git clone, curl, …)

So it seems that restrictions I have could be avoid ?

API and command to remove individual packs

It's not uncommon that users would want to remove a selected pack.

The command line interface could first show the user which devices will be removed given the device name they passed in, then ask if they really want to delete the pack. Make sure there is a --y option to force delete.

The API should just delete the pack immediately.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.