pyOCD | Open source Python library | Code Inspection library

 by   mbedmicro Python Version: v0.27.3 License: Apache-2.0

kandi X-RAY | pyOCD Summary

kandi X-RAY | pyOCD Summary

pyOCD is a Python library typically used in Code Quality, Code Inspection applications. pyOCD has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.

pyOCD is an open source Python package for programming and debugging Arm Cortex-M microcontrollers using multiple supported types of USB debug probes. It is fully cross-platform, with support for Linux, macOS, and Windows. A command line tool is provided that covers most use cases, or you can make use of the Python API to enable low-level target control. A common use for the Python API is to run and control CI tests. Upwards of 70 popular MCUs are supported built-in. In addition, through the use of CMSIS-Packs, nearly every Cortex-M device on the market is supported.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              pyOCD has a low active ecosystem.
              It has 447 star(s) with 274 fork(s). There are 66 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 112 open issues and 238 have been closed. On average issues are closed in 49 days. There are 9 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of pyOCD is v0.27.3

            kandi-Quality Quality

              pyOCD has 0 bugs and 0 code smells.

            kandi-Security Security

              pyOCD has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              pyOCD code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              pyOCD is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              pyOCD releases are available to install and integrate.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.
              pyOCD saves you 3794822 person hours of effort in developing the same functionality from scratch.
              It has 1405444 lines of code, 2726 functions and 297 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pyOCD
            Get all kandi verified functions for this library.

            pyOCD Key Features

            No Key Features are available at this moment for pyOCD.

            pyOCD Examples and Code Snippets

            No Code Snippets are available at this moment for pyOCD.

            Community Discussions

            QUESTION

            Ada on the microbit: scrolling text example not working, no libusb library found
            Asked 2021-Jan-28 at 23:39

            I followed the adacore tutorial on displaying scrolling text (https://blog.adacore.com/ada-for-microbit-part-1-getting-started) but can't get it working on my microbit.

            Maybe my microbit is a more recent version that is not yet supported? The reason I suspect this is that my board id (9904) was not supported the first time I tried to flash to the board. I used the fix described here: Unable to get the Ada scrolling text demo working on the microbit on GNAT 2019 community edition and added the following line in board_ids.py:

            ...

            ANSWER

            Answered 2021-Jan-23 at 14:12

            libusb is missing or not found on your computer. It is used to communicate with the Microbit board to upload/debug.

            Source https://stackoverflow.com/questions/65859253

            QUESTION

            pyocd library cannot find libusb python library
            Asked 2020-Sep-03 at 05:57

            I've successfully installed pyocd and libusb using powershell core and python 3.8 on windows 10, but when I use python -m pyocd list command, it throws this error:

            ...

            ANSWER

            Answered 2020-Sep-03 at 05:57

            You should copy the libusb.dll (libusb dynamic link library) to the path of python instalation. Note: if you've downloaded python from windows store, you should copy libusb.dll in C:/windows/system32 directory.

            Source https://stackoverflow.com/questions/63704476

            QUESTION

            PyOCD doesn't find Nu-Link2-Me probe on my NuMaker board
            Asked 2019-Dec-02 at 20:02

            Note: Why this question is not off-topic
            Some people seem to think this question is off-topic, and it would be better suited for Super User. Please give me a chance to explain why that's not the case.

            The question is not about "general computing hardware" but about "embedded software". In the topic of "embedded software", there are tons of questions on StackOverflow related to OpenOCD, a popular open-source tool to connect your computer to embedded software development boards. All these questions are considered totally okay for StackOverflow. My question on this page is about PyOCD - an emerging OpenOCD alternative. So if you vote to close this question, then please also vote to close the 565 (!) other questions about OpenOCD too ;-)

            I've got a NuMaker-M032SE V1.3 board from Nuvoton that I'm trying to flash/debug with PyOCD. It's my first time I'm experimenting with PyOCD and with Nuvoton chips. Unfortunately, PyOCD cannot find the device. I'll go step-by-step through the whole procedure. Please tell me what I did wrong.

            1. My system

            I'm running 64-bit Windows 10 on my desktop computer. I've got Python 3.8 and recently installed the latest PyOCD development version from a cloned GitHub repository (see https://github.com/mbedmicro/pyOCD).

            2 Install Microcontroller board

            Note: this paragraph is simply to show you the background situation, before I move on to explain the actual problem I got with PyOCD

            I've got a Nuvoton NuMaker-M032SE V1.3 microcontroller board:

            This board has a Nu-Link2-Me V1.0 probe on the right side. The first time I connect my board to my computer nothing really happened. So I figured out I had to install the Nuvoton ICP tool that comes with the Nu-Link USB Driver 1.6:

            You can download the Nuvoton ICP tool here: https://www.nuvoton.com/hq/support/tool-and-software/development-tool-hardware/programmer/ When I first start the sofware, I see this:

            And I get a request to update the firmware on the Nu-Link2-Me V1.0 probe:

            I click OK and wait for the firmware update to complete. I plug out and back in the board. Windows clearly notices the device:

            I can also see the device in my Control Panel > Device Manager. It's listed under Universal Serial Bus Controllers as Nuvoton Nu-Link2 USB:

            3 Prepare PyOCD

            PyOCD has a few built-in targets. But not the Nuvoton chip I got. So I consulted the documentation at https://github.com/mbedmicro/pyOCD/blob/master/docs/target_support.md and learn that I need to download a pack from http://www.keil.com/dd2/pack/ . That's where I download the Nuvoton ARM Cortex-M NuMicro Family Device Support pack:

            Because I downloaded the pack manually, I know that I'll have to add the parameter --pack="C:/path/to/pack/Nuvoton.NuMicro_DFP.1.3.5.pack" to every PyOCD command, to ensure that PyOCD can access this pack whenever it needs to.

            4. Connect PyOCD with Nuvoton board

            I believe my microcontroller board is properly installed to go on to the final step: connect PyOCD to the Nuvoton microcontroller board.

            First I want PyOCD to find the board. I issue the following command in a Windows console:

            ...

            ANSWER

            Answered 2019-Dec-02 at 08:44

            I got a reply from Nuvoton. Apparently the NuMaker-M032SE V1.3 board is not yet supported in PyOCD at the time of writing (02 Dec 2019). At the moment, only NuMaker M252/M263 boards are supported.

            Nuvoton will make efforts to support these boards in PyOCD too, in the future.

            Source https://stackoverflow.com/questions/59118658

            QUESTION

            Unable to get the Ada scrolling text demo working on the microbit on GNAT 2019 community edition
            Asked 2019-Sep-26 at 22:04

            I'm trying to run the demo described here: https://blog.adacore.com/ada-on-the-microbit

            I followed the tutorial's directions carefully. I did install the 2019 versions of the software instead of the 2018 versions. GPS seems to be installed and working on my windows 7 machine. The project builds but pyocd-flashtool can't seem to recognize my microbit. It reports it as a "generic cortex_m" and throws an exception.

            Here's the output:

            ...

            ANSWER

            Answered 2019-Sep-26 at 22:04

            In C:\GNAT\2019\lib\site-packages\pyOCD\board\mbed_board.py (or the equivalent location on your platform), add this line and it will work.

            "9901": BoardInfo( "Microbit", "nrf51", "l1_microbit.bin", ),

            Source https://stackoverflow.com/questions/58045255

            QUESTION

            pip install yotta --user unable to find pyocd/_version.py
            Asked 2018-Nov-13 at 00:10

            I have encountered an error when installing yotta:

            ...

            ANSWER

            Answered 2018-Nov-13 at 00:10

            QUESTION

            What happens on the background when mbed CLI flashes the chip?
            Asked 2018-Feb-09 at 22:29

            Even though not every detail is relevant for this question, I will list my setup nonetheless:

            To compile my code and flash the binary to the chip, I issue the following command in my cmd terminal:

            ...

            ANSWER

            Answered 2018-Feb-09 at 19:07

            I have not tried all of them but the first and certainly the mbed supported nucleo boards show up as a virtual thumb drive, and you simply copy the .bin file over, no real magic to it from the host side no other software required other than what the operating system already has with respect to mounting usb flash drives. There is a debug header on these boards, and even if not that there is for the ones I know an mcu that manages the debug part I call that the debug mcu, then there is the mcu under test or the demonstration one that you bought the board to play with. The mbed ones have generally been arm and there is an swd (jtag-ish) interface, the debug mcu very likely uses that interface.

            openocd is just one tool that knows the swd protocol, that doesnt mean that they have to run openocd on the mcu. you can write your own software to bit bang or talk to an ftdi chip to use mpsse or other solution to generate the swd protocol transitions on that bus.

            Simplest case the firmware for the specific nucleo board only has to know that one stm32 it is programming, doesnt have to know more than that, but one swd is somewhat generic and may make sense to have a more generic debug mcu firmware.

            Now these NUCLEO and other STM32 debug mcus also speak stlink which is separate from the firmware looks like a thumb drive deal. Stlink a protocol that a host can use to ask the debug mcu to do stuff, just like mpsse is a protocol/instruction set that you use to ask some ftdi parts to do stuff for you (a bit different but in concept speak one protocol to a proxy agent that does something for you).

            This mbed cli could possibly just be copying the file over for you which you could have just done yourself. Or maybe it is speaking some other protocol The first mbeds were based on NXP parts not ST and thus dont have the stlink protocol on the front end. They had/have the just copy the binary which I remember seeing someones blog have so maybe they hired that person or borrowed that open source project.

            While the mbed sandbox may be great I recommend you try out the other options, first mbed to build the binary, then copy it over, mbed to build it and maybe openocd through stlink to write it to flash. ST and NXP parts have traditionally had a bootloader that would support a uart protocol you can try that, as that is something you would very likely use, or swd, to get into a chip on a board if you were working on some product built around or that used chips like these but was not some hobby/eval board like the nucleos. I also recommend trying baremetal without the libraries, just read the manual, I find that easier than the libraries, YMMV, also ST has at least one set of its own libraries I think they are in a transition between to software solutions, perhaps try both or try the new one as the other will lose support.

            You can also get the SWD spec and there are github and other open projects that can help, take your nucleo board and develop a program on one mcu to talk to another (mcus have gpio making it an easy way to bit bang, you can bit bang an ftdi part or do other things dont have to use an mcu) and try to learn/understand that protocol itself. It is used by all the cortex-ms thus far.

            There is also a usb protocol like stlink that is being pushed by arm, the newer MSP432 launchpads use it or support it. The stlink protocol itself for that matter.

            Anyway I digress the nucleo through the (debug) usb has the stlink protocol and has the I am a thumb drive thing, so mbed tools are likely using one of those probably the latter since stlink is likely not found on non-st products. Very likely that the debug mcu is using swd to program the development/demonstration mcu, dont know how else it would be doing it.

            Source https://stackoverflow.com/questions/48711331

            QUESTION

            Odd Python Syntax?
            Asked 2017-Jan-11 at 09:46

            When on GitHub, I stumbled upon this page (https://github.com/mbedmicro/pyOCD) which is there to help with using mbed boards. However, when i looked at their Hello World Example (below), i was real baffled. It uses an extremly odd python syntax (which is not valid as the complier threw an error).

            Here it is :

            ...

            ANSWER

            Answered 2017-Jan-11 at 09:46

            It's an example, and they included the expected output in the text.

            So the line

            Source https://stackoverflow.com/questions/41587382

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install pyOCD

            [pyusb](https://github.com/pyusb/pyusb) and its backend library [libusb](https://libusb.info/) are dependencies on all supported operating systems. pyusb is a regular Python package and will be installed along with pyOCD. However, libusb is a binary shared library that does not get installed automatically via pip dependency management.
            macOS: use Homebrew: brew install libusb
            Linux: should already be installed.
            Windows: download libusb from [libusb.info](https://libusb.info/) and place the DLL in your Python installation folder next to python.exe. Make sure to use the same 32- or 64-bit architecture as your Python installation. Note: due to a [known issue](https://github.com/mbedmicro/pyOCD/issues/684), the current recommendation is to use [libusb version 1.0.21](https://github.com/libusb/libusb/releases/tag/v1.0.21) on Windows instead of the most recent version.
            Please see the [Developers' Guide](docs/developers_guide.md) for instructions on how to set up a development environment for pyOCD.

            Support

            The pyOCD documentation is located in [the docs directory](docs/). In addition to user guides, you can generate reference documentation using Doxygen with the supplied [config file](docs/Doxyfile).
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/mbedmicro/pyOCD.git

          • CLI

            gh repo clone mbedmicro/pyOCD

          • sshUrl

            git@github.com:mbedmicro/pyOCD.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Code Inspection Libraries

            Try Top Libraries by mbedmicro

            Evothings_BLE_unitTests

            by mbedmicroJavaScript