NTAG I²C plus Arduino-compatible Development kit - Review

Table of contents

RoadTest: NTAG I²C plus Arduino-compatible Development kit

Author: cmelement14

Creation date:

Evaluation Type: Development Boards & Tools

Did you receive all parts the manufacturer stated would be included in the package?: True

What other parts do you consider comparable to this product?: ST25DV-I2C

What were the biggest problems encountered?:

Detailed Review:

     

BLE Pairing with the NTAG I2C Plus Kit

 

First of all, I'd like to thank NXP for providing the roadtest kit and element14 for organizing this roadtest. There already exist a couple of great reviews for this roadtest. For example, Gordon Margulieux() wrote a detailed review about unboxing, software installation and Android app demo. Steve Smythe() wrote an interesting review demonstrating multiple NXP's NFC solutions.

 

In my review, I am not going to repeat what they have presented. Instead, I'd like to demo the BLE pairing example that Steve has tried but not able to complete because the instruction document "skips over a few steps and is quite hard to follow". After spending some time in deciphering the procedure, I got it work. I'll present my process in a step-by-step fashion with lots of screen shots. However, I will skip the software/SDK installation part so please first read Gordon's review if you haven't done so.

 

 

1. Prerequisite

 

A couple of software components are required: MCUXpresso IDE and SDK. Please first read Gordon's review - Part IV - Software Installation.

 

Please note that the line numbers shown in the screen shots below are just for reference. They may be different from the SDK version you're using. To locate the line positions where modifications should occur, you can use the context around the highlighted part as search pattern text.

 

 

2. Import hid_device Example Application

 

This application is based on the freeRTOS version of the bluetooth hid_device example. The following screen shots show how to import the hid_device example.

 

 

Browse wireless_examples -> bluetooth -> hid_device, click on freertos item.

 

After the import is complete, you should see the project in the workspace as shown below.

 

 

3. Import NTAG_I2C_plus Middleware

 

The above imported project doesn't include any code for NFC so we need to import the NTAG middleware. Where to get the middleware? Actually the SDK already includes the middleware for NFC. Since the downloaded SDK is a zip file, we need to unzip the SDK first before we can import it to the project. If you don't know how to build and download SDK, please refer to read Gordon's review. In the following screen shots, I unzipped to folder D:\NTAG_I2C_Full. You can unzip to whatever folder and use it when you import the middleware.

 

After the import is done, you should be able to see the highlighted new folder under your project.

 

 

4. Import NDEF Library

 

Although we can hard-code NDEF message into the application source code, I find a NDEF library and attached at the end of this article. You can download the zip file and follow the following screen shots to import it to the project.

 

 

 

5. Add two Files

 

 

Download and unzip two app_ntag zip files attached at the end of this review. Then drag them to the source folder in your project (see the following screen shots). 

 

 

 

It may need to press F5 key to update file list.

 

 

 

 

6.Update File source\app_config.c

 

Do a search and replace all instances of gSecurityMode_1_Level_3_c (total 6 instances in this file) with gSecurityMode_1_Level_1_c. Replace the highlighted gIoDisplayOnly_c with gIoNone_c. Replace the highlighted TRUE with FALSE.

 

 

 

7.Update File source\app_preinclude.h

 

Increase the highlighted stack size 500 to 1024.

 

 

 

8.Update File source\common\ApplMain.c

 

Insert the highlighted statements as shown below.

 

 

 

9.Update File board\board.c

 

Add the highlighted line to initialize NTAG's I2C interface.

 

10.Update File source\hid_device.c

 

Updated the hid_device.c file to the state shown in the screen shots below. The highlighted parts are the code that it should look like.

 

 

 

 

 

 

11.Update File source\hid_device.h

 

Change the highlighted advertise time 10 seconds to 3 seconds.

 

 

12.Update File ntag_i2c_plus_1.0.0\inc\global_types.h

 

Include header file EmbeddedTypes.h and comment out the Bool definition.

 

13.Update File ntag_i2c_plus_1.0.0\HAL_TMR\timer_kinetis.c

 

Replace HAL_Timer_delay_ms function body with the highlighted text and comment out SysTick_Handler() function.

 

 

14.Update Project Properties

 

Right click on the project then click on Properties menu.

 

 

Add a few include paths as shown below.

Also add a few preprocessor symbols as shown below.
All required modification is complete. You should be able to build and run/debug the project.
Anonymous
  • Hi Charles

     

    Sorry it has taken so long to get around to trying this.

     

    It didn't work when I tried it but I figured out that there are some missing instructions from your guide too!

     

    1. I think you missed out an instruction to add the following lines at the very end of the file hid_device.c

    static void NDEFTimerCallback(void * pParam)
        {
        /* Stop Advertising Timer*/
        TMR_StopTimer(mNDEFTimerId);
        /* switch off the LED indication */
        TurnOffLeds();
        }
    
    // NTAG_I2C

     

    2. Also, (Steps 3 and 4 in your guide) after copying the folders ntag_i2c_plus_1.0.0 and Ndef_Library, the properties of each of those folders should be changed in MCUXpresso (right click->Properties and untick) so that they are not excluded from the build (otherwise you'll get Linker errors):

     

    After doing that, it all works. Thanks again. That'll be useful for adding NTAG I2C functionality to other applications.

     

    [postscript]

    Forgot to say that I only found 4 instances of gSecurityMode_1_Level_3_c in source\app_config.c (Your Step 6).

  • A nice and helping effort that would be a good reference for others.

  • Steve,

     

    Please let me know if it works or not.

     

    Charles

  • Well done for working out the missing steps! I'll give that a try later.