Using Mbed OS NFC library with NXP NTAG I2C Plus (NFC Type 2 Tag)

I have a NXP NTAG I2C Plus (NFC Type 2 Tag) - NTAG I2C Plus 2K: NFC Forum Type 2 Tag with I2C Interface | NXP Semiconductors

I wish to use this device with an Mbed OS compatible board.

I am reading through the Mbed documentation on GitHub to determine which NFC endpoint to use:

It wasn’t clear to me which to use. I then reviewed the HAL:

This looks more like it as this includes functions like:

void read_bytes(uint32_t address, size_t count);
void write_bytes(uint32_t address, const uint8_t *bytes, size_t count);

What’s not clear to me from documentation is how to implement.

For example, the NTAG uses I2C to communicate with the MCU. So what is the best method to merge the I2C read and write bytes with the NFC HAL API read and write byte functions etc.

Any guidance is greatly appreciated as it would be nice to see the Mbed NFC library in action with the NXP NTAG device.

Thanks.

Hi, thanks for looking into the NFC API!

The read_bytes()/write_bytes() functions should read & write inside the EEPROM’s memory.
You will need to map the I2C commands listed in the datasheet:

Thanks,

Don

Thanks @donatien for the datasheet.

I have made a start based on a partial port of an Arduino library I’ve used in the past.

I could simply recreate the whole library, but that fails to incorporate the Mbed NFC functionality.

So, what I’m struggling to grasp, is really the mechanics or basics on how to bridge the Mbed NFC library as I have no examples to work from.

Any advice greatly appreciated.

Thanks

G://

I think I found what I am looking for to help guide me

(I see this header file would be used to link in with the nfcEEPROM library. Ref: https://os.mbed.com/docs/mbed-os/v6.3/apis/nfc-eeprom.html):

But when opening up this file, I see the author(s) included a

namespace vendor { … }

So, one specific question for the forum readers… what the heck is “vendor” used for.

Hi, I also recently went looking for some drivers for the NXP NTAG I2C Plus, and came across this link:

It seems to have the required drivers implemented for doing the basics of communication.

There are also some NXP source files available as part of this demo here:

NFC DIN rail demo - how to do parametrization with... - NXP Community (in the link http://nxp.com/assets/downloads/data/en/software/DINRailDemo_SourceCode.zip)

Hope that helps!

Cheers,

Dave

1 Like

Thanks this helps a great deal.