Giter VIP home page Giter VIP logo

pc-nrfjprog-js's Introduction

pc-nrfjprog-js

Node.js library that exposes the functionality of the nRF5x Command-Line-Tools, used for development, programming, and debugging of Nordic Semiconductor's nRF5x SoCs (System on Chip).

Installing

The library can be installed from npm, using:

npm install pc-nrfjprog-js

This will pull down precompiled binaries for your platform/runtime environment. If precompiled binaries do not exist, then npm will try to compile them, which requires:

  • Node.js (>=4)
  • npm (>=3.7.0)
  • CMake (>=2.8.12)
  • A C/C++ toolchain

As part of the installation procedure, pc-nrfjprog-js will check if it can access the nrfjprog libraries, and verify that they are up to date. If not, it will try to install/upgrade these libraries.

Building from source

The library can be built from source, using:

npm run build

The library can be build from source while installing, using:

npm install --build-from-source

Building from source requires the tools from Installing to be installed.

Required setup

Before using the library, some platform specific setup is required. If you are seeing errors like Errorcode: CouldNotFindJprogDLL (0x2) or Errorcode: CouldNotLoadDLL (0x3) then please check that the tools described below are properly installed.

Windows

Download nRF-Command-Line-Tools and run the installer (exe). This will install the required nrfjprog libraries and SEGGER J-Link.

Note that the nRF-Command-Line-Tools for Windows is only available in 32-bit at the moment. This means that 32-bit Node.js is required in order to use pc-nrfjprog-js on Windows.

Linux/macOS

SEGGER J-Link must be downloaded and installed. The required nRF-Command-Line-Tools libraries are bundled together with pc-nrfjprog-js on Linux/macOS, so they do not have to be installed.

API documentation

http://nordicsemiconductor.github.io/pc-nrfjprog-js/

Example

const nrfjprogjs = require('pc-nrfjprog-js');

nrfjprogjs.getConnectedDevices(function(err, devices) {
    console.log('There are ' + devices.length + ' nRF devices connected.');
});

Tests

The project has integration tests that run against a devkit/dongle. Note that these tests will erase the contents on the connected devkit/dongle. To run the tests:

npm test

pc-nrfjprog-js's People

Contributors

bencefr avatar bihanssen avatar chunfantasy avatar coderbyheart avatar coqrogue avatar ivansanchez avatar kenr avatar mathiasap avatar mrodem avatar

Watchers

 avatar

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.