Hello NFC and Kinetis enthusiasts,
NTAG I2C plus tag ICs offer both, a contact (I2C) and a contactless interface (NFC) to ease the development of IoT, home-automation and consumer applications.
The target of this document and the example projects is to show how NTAG I2C plus can act as the bridge from a host NFC device, like a smartphone or PC, to an embedded board such as a Kinetis Freedom board. 2 main functionalities are demonstrated: embedded board control via NFC and firmware upgrades over NFC.
Board control with NFC enabled device
NTAG I2C plus provides an easy way of sending/receiving any kind of data between a product embedding an MCU to a host NFC device (e.g. smartphone). Some use cases include product configuration, control or data sensing. A major advantage is that we can have a customized application or graphic interface in the smartphone instead of expense of an LCD screen for the embedded board.
Bootloader over NFC
Firmware updates in the field are a very common practice for products based in an embedded system. The main advantages of a bootloader over NFC are the simplicity and the non intrusive nature, as it communicates using NFC antennas, i.e. without any wires or physical connections.
The next picture shows the setup and connections from the NTAG I2C Plus antenna board to the FRDM-K64F.
- Kinetis Freedom board FRDM-K64F
- NTAG I2C Plus Antenna board or flex antenna with the NTAG I2C plus IC.
- Kinetis Software Development Kit (KSDK) v2.0
- Kinetis Design Studio (KDS) v3.2
- NTAG I2C Demo Android application. Available from Google Play.
Note: Please verify that your smartphone supports NFC. Otherwise the Android app can be installed but it cannot be used for interfacing with the NTAG I2C Plus IC.
TESTING THE DEMO PROJECTS
There are two KDS projects attached to this document:
- NTAG_I2C_Plus_FRDMK64_Demo: Demonstrates the transfer of data between the phone and the MCU.
- NTAG_I2C_Plus_FRDMK64_Bootloader: Provides a mean to update the firmware in the Kinetis MCU. The application must be prepared to be placed at an offset of 0x4000 in the MCU internal flash.
To load any of these demos please open the corresponding project in KDS IDE, build the project and start a debugger session to program the K64.
1- In FRDM-K64F, SW2 must be pressed during reset to enter bootloader mode. Hence the 2 usual ways are:+
A) If the board is powered, press and hold SW2 and then press Reset button.
B) When the board is not powered, press and hold SW2 and then plug the USB cable.
2- From the Android demo app go to the "Flash" option. Then click on "Select from Storage" to browse for the application binary file.
Note: For this bootloader example, the application including the vector table must be relocated to an offset of 0x4000 in Flash.
3- Finally tap the phone to the NTAG I2C Plus antenna and hold it steady during the flashing progress. When the app shows "Flash Completed" the new application starts executing.
NOTE: By default the demo project has the 0x4000 offset, so please build the project and then load the generated binary using the bootloader as described above.
- Bring the NFC enabled phone near the NTAG I2C Antenna.
- Verify transfer is already in progress, by checking the "Board Status".
- Press the Orange/Blue/Green buttons in the Android app
to change the color of the RGB LED.
- Enable the checkbox for "Enable Temperature Sensor" to
see the reading of the K64 internal temperature.
I hope these demo projects are useful. Please feel free to share your comments or ask any questions.