element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Internet of Things
  • Technologies
  • More
Internet of Things
Blog Reverse Engineer NFC Card Reader Protocol of Digital Logic µFR - part 0: intent
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Internet of Things to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 27 Mar 2020 11:26 AM Date Created
  • Views 916 views
  • Likes 3 likes
  • Comments 2 comments
  • rt
  • nfc
  • java
Related
Recommended

Reverse Engineer NFC Card Reader Protocol of Digital Logic µFR - part 0: intent

Jan Cumps
Jan Cumps
27 Mar 2020

Digital Logic have a very nice set of Smart Card readers. I have purchased one of those.

They work well with the Infineon Securyty 2Go smart cards I received for the Infineon Blockchain Starter Kit road test.

Its a well buit reader from a interesting company. But there's a but image.

 

The readers don't support PC/SC, and to program them, you depend on libraries and executables that are available in binary format.

edit 15-dec-2020: there's a Windows PcSc driver available now for the µFR.

Many, but not all, utilities come with source code. They have dependencies on D-Logic libs that are released in binary only though.

Others utilities are available as executables, but the Linux binaries are for Intel platforms. No Arm, so not runnable on a Raspberry Pi or BeagleBone. And that's where I need them.

 

I'd like to avoid libs with unknown license in a public blog. And I'd like to find an open way to talk to the NFC device.

There may be a solution. D-Logic published an Android Java example that's not dependent on their proprietary libraries.

This example / user tutorial is not depending on D-Logic libraries.

It is depending on FTDI's serial lib - but that's in essence a serial communication wrapper. By just reading how the lib is called in the example you can defer what's requested on the serial side.

All other dependencies are open source or standard (android, java.io, java.util and xmlpull.org).

 

import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.hardware.usb.UsbAccessory;
import android.hardware.usb.UsbManager;
import android.os.BatteryManager;
import android.os.Build;
import android.os.ParcelFileDescriptor;

import com.ftdi.j2xx.D2xxManager;
import com.ftdi.j2xx.FT_Device;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;

 

This should be doable. My next steps will be to try and find the flow in the example.

Then find where the essentials for APDU communication.

Then abstract away dependencies on android and FTDI. Hang on ...

 

Related Blog
Blockchain - Talk Directly to the Infineon 2Go Smart Cards API
NFC Card Reader Protocol of Digital Logic µFR - part 0: intent
µFR NFC Card Reader - part 1: first C program for Linux (RPi, BB, ...)
µFR NFC Card Reader - part 2: first C++ program
µFR NFC Card Reader - part 3: C++ Class to handle ISO14443 / APDU cards
µFR NFC Card Reader - part 4: first meaningful ISO14443 / APDU conversation
µFR NFC Card Reader - part 5: refactor, look back at initial design
  • Sign in to reply

Top Comments

  • Jan Cumps
    Jan Cumps over 4 years ago in reply to Jan Cumps +2
    First successful C program talking to a smartcard:
  • Jan Cumps
    Jan Cumps over 4 years ago +1
    For my own investigations: Here's what I get when plugging it in a Linux USB port (Debian Stretch) dmesg output: [ 1095.171507] usb 1-1.3: new full-speed USB device number 6 using dwc_otg [ 1095.328978…
  • Jan Cumps
    Jan Cumps over 4 years ago in reply to Jan Cumps

    First successful C program talking to a smartcard:

    image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 4 years ago

    For my own investigations:

     

    Here's what I get when plugging it in a Linux USB port (Debian Stretch)

    dmesg output:

     

    [ 1095.171507] usb 1-1.3: new full-speed USB device number 6 using dwc_otg
    [ 1095.328978] usb 1-1.3: New USB device found, idVendor=0403, idProduct=6001
    [ 1095.328992] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 1095.329001] usb 1-1.3: Product: uFR Nano Plus
    [ 1095.329010] usb 1-1.3: Manufacturer: D-Logic
    [ 1095.329017] usb 1-1.3: SerialNumber: A659Z65G
    [ 1095.374106] usbcore: registered new interface driver usbserial
    [ 1095.374175] usbcore: registered new interface driver usbserial_generic
    [ 1095.374230] usbserial: USB Serial support registered for generic
    [ 1095.386858] usbcore: registered new interface driver ftdi_sio
    [ 1095.386938] usbserial: USB Serial support registered for FTDI USB Serial Device
    [ 1095.387356] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected
    [ 1095.387493] usb 1-1.3: Detected FT232RL
    [ 1095.388435] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB0

     

    lsusb output:

     

    Bus 001 Device 006: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC

     

    A few health checks Digital Logic lists, that can influence the operation:

     

    I may have to deal with FTDI auto-loading modules. :

    lsmod | grep ftd

     

    ftdi_sio               40960  0
    usbserial              40960  1 ftdi_sio

     

    I'll first check if I have issues. If yes, I have to blacklist the drivers.

     

    There's also a PC/SC driver in development. That would be great news. It would make the reader plug-compatible with several BitChain libraries.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube