This package allows you to flash your mbed / DAP-link device from within Atom using pyOCD. It is meant as an extension to the build-med to allow flashing the results from the mbed-cli
build process.
pyocd_settings.json
)..hex
or .bin
fileIn order to use this package, pyOCD needs to be installed on your machine. For details on how to install pyOCD see the instructions. On a typical Linux system the following command should to the trick:
sudo pip install --pre -U pyocd
Please note, that pyOCD needs Python 2.7. Thus if your default Python interpreter is 3.0 you might need to substitute pip
with pip2
.
To access the DAP-link interface as a normal user, it is very likely that you need to add a udev
rule. This rule is board specific, but typically it looks something like this:
# mbed CMSIS-DAP
ATTRS{idVendor}=="0d28", ATTRS{idProduct}=="0204", MODE="664", GROUP="plugdev"
KERNEL=="hidraw*", ATTRS{idVendor}=="0d28", ATTRS{idProduct}=="0204", MODE="664", GROUP="plugdev"
Put the rule into /etc/udev/rules.d/99-daplik.rules
and restart udev
with:
sudo udevadm control --reload-rules
To install this package from the package repository:
apm install pyocd
Or install from git:
cd $HOME/$MY_GIT_REPOS
git clone https://github.com/wendlers/atom-pyocd
Change into the newly cloned directory and link the package into your atom install:
cd atom-pyocd
apm link
Next, install required node packages:
apm install
Now, when you start your atom next time, you might be asked to install the some dependencies.
.hex
or .bin
file (if you use mbed-cli and like to compile directly from Atom, you might want to try the build-med package).shift+alt+p
(or from right click menu and selecting pyocd: toggle
).target
and a file
.flash
or press shift-alt-s
to flash your board.The following could be set in the pyOCD panel:
target
MCUboard ID
which is only needed if you have more than one board connected.file
to flash. Could be a .bin or .hex file.chip erase
switch is turned on, a full chip-erase will be performed when flashing, else only a sector erase will be done (switches -ce
and -se
of pyocd-flashtool
).fast program
switch is enabled, only the CRC of each page to is used to determine if it already has the same data (-fp
switch of pyocd-flashtool
).In the package settings the following could be configured:
pyocd-flashtool binary
: name and optional path for the flashtool which comes with pyOCD.The following functions could be performed (from the pyOCD panel,the menu, the context-menu or by keyboard shortcut):
shift+alt+p
): open the pyOCD panelshift-alt-s
): flash specified fileshift-alt-e
): erase chipGood catch. Let us know what about this package looks wrong to you, and we'll investigate right away.