Coder Social home page Coder Social logo

mbed-os-example-nfc's Introduction

Mbed OS NFC examples

This repo contains NFC example applications based on mbed OS and built with Mbed CLI 1 or Mbed CLI 2.

Each example directory prefixed with NFC_ contains an Mbed os project.

The NFC documentation describes the NFC APIs on mbed OS.

Using the examples

Targets for NFC

Supported targets vary for each example. Check README.md in the example's directory for details.

Mbed OS build tools

Mbed CLI 2

Starting with version 6.5, Mbed OS uses Mbed CLI 2. It uses Ninja as a build system, and CMake to generate the build environment and manage the build process in a compiler-independent manner. If you are working with Mbed OS version prior to 6.5 then use Mbed CLI 1. Install Mbed CLI 2.

Mbed CLI 1

Install Mbed CLI 1.

Building the examples

  1. Clone the repository containing the collection of examples:

    $ git clone https://github.com/ARMmbed/mbed-os-example-nfc.git
  2. Using a command-line tool, navigate to any of the example directories, like NFC_EEPROM:

    $ cd mbed-os-example-nfc
    $ cd NFC_EEPROM
  3. Update the source tree:

    • Mbed CLI 2
    $ mbed-tools deploy
    • Mbed CLI 1
    $ mbed deploy
  4. Connect a USB cable between the USB port on the board and the host computer.

  5. Run the following command: this will build the example project, program the microcontroller flash memory, and then open a serial terminal to the device.

    • Mbed CLI 2
    $ mbed-tools compile -m <TARGET> -t <TOOLCHAIN> --flash --sterm --baudrate 9600
    • Mbed CLI 1
    $ mbed compile -m <TARGET> -t <TOOLCHAIN> --flash --sterm --baudrate 9600

Your PC may take a few minutes to compile your code.

The binary will be located in the following directory:

  • Mbed CLI 2 - ./cmake_build/<TARGET>/<PROFILE>/<TOOLCHAIN>/
  • Mbed CLI 1 - ./BUILD/<TARGET>/<TOOLCHAIN>/

You can manually copy the binary to the target, which gets mounted on the host computer through USB, rather than using the --flash option.

You can also open a serial terminal separately, as explained below, rather than using the --sterm and --baudrate options.

Running the examples

When the example application is running, information about activity is printed over the serial connection. The default serial baudrate has been set to 9600 for these examples.

If not using the --sterm and --baudrate options when flashing, have a client open and connected to the board. You may use:

  • Mbed CLI 2

     $ mbed-tools sterm -b 9600
  • Mbed CLI 1

     $ mbed sterm -b 9600
  • Tera Term for Windows

  • screen or minicom for Linux

    $ screen /dev/serial/<your board> 9600

Verification of the sample application can be seen on any a smartphone with an NFC reader. After running you will be able to read the tag with an NFC tag reader application.

Known issues

The repository is not meant to be imported directly inside the Mbed online compiler. To import one example inside the online compiler, go to https://os.mbed.com/teams/mbed-os-examples/ and import from here the NFC example of your choice.

License and contributions

The software is provided under Apache-2.0 license. Contributions to this project are accepted under the same license. Please see contributing.md for more info.

This project contains code from other projects. The original license text is included in those source files. They must comply with our license guide.

mbed-os-example-nfc's People

Contributors

0xc0170 avatar adbridge avatar apalmierigh avatar gpsimenos avatar hugueskamba avatar mbedmain avatar pan- avatar patater avatar paul-szczepanek-arm avatar rajkan01 avatar rwalton-arm avatar saheerb avatar urutva avatar wernerlewis 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.