pyOCD | Open source Python library | Code Inspection library
kandi X-RAY | pyOCD Summary
kandi X-RAY | pyOCD Summary
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
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pyOCD
pyOCD Key Features
pyOCD Examples and Code Snippets
Community Discussions
Trending Discussions on pyOCD
QUESTION
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:12libusb is missing or not found on your computer. It is used to communicate with the Microbit board to upload/debug.
QUESTION
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:57You 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.
QUESTION
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 systemI'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 boardNote: 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 PyOCDPyOCD 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.
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:44I 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.
QUESTION
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:04In 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", ),
QUESTION
I have encountered an error when installing yotta:
...ANSWER
Answered 2018-Nov-13 at 00:10Seems like a bug in the package: https://github.com/mbedmicro/pyOCD/issues/442
QUESTION
Even though not every detail is relevant for this question, I will list my setup nonetheless:
- NUCLEO_F746ZG microcontroller board (https://os.mbed.com/platforms/ST-Nucleo-F746ZG/).
- I run mbed CLI (https://os.mbed.com/docs/v5.7/tools/arm-mbed-cli.html) to program the chip.
- My OS is Windows 10, 64-bit
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:07I 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.
QUESTION
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:46It's an example, and they included the expected output in the text.
So the line
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pyOCD
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
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page