NFC System OFF¶
Overview¶
The NFC System OFF sample shows how to make the NFC Tag device wake up from the System OFF mode when it detects the NFC field. It uses the NFC Data Exchange Format (NDEF) library.
The sample starts with the initialization of the NFC Tag device. The device then attempts to detect an external NFC field. If the field is not detected within three seconds, the device goes into the System OFF mode.
The device wakes up from the System OFF mode when an NFC field is detected. The system is started and the NFC Tag device is reinitialized. The tag can be read afterwards.
When the NFC field is not within range anymore, the device goes back to the System OFF mode.
Requirements¶
Before you start, check that you have the required hardware and software:
- 1x nRF54L15 Connect Kit
- 1x U.FL cabled 13.56 MHz NFC Antenna (included in the box)
- 1x USB-C Cable
- A smartphone or a tablet with NFC support
- A computer running macOS, Ubuntu, or Windows 10 or newer
Attaching the NFC antenna¶
Before applying power to the board, ensure the U.FL cabled NFC antenna is properly installed.
Building the sample¶
To build the sample, follow the instructions in Getting Started Guide to set up your preferred building environment.
Use the following steps to build the NFC System OFF sample on the command line.
-
Open a terminal window.
-
Go to
NCS-Project/nrf54l15-connectkit
repository cloned in the Getting Started Guide. -
Build the sample using the
west build
command, specifying the board (following the-b
option) asnrf54l15_connectkit/nrf54l15/cpuapp
.Tip
The
-p
always option forces a pristine build, and is recommended for new users. Users may also use the-p auto
option, which will use heuristics to determine if a pristine build is required, such as when building another sample. -
After building the sample successfully, the firmware with the name
merged.hex
can be found in thebuild
directory.
Flashing the firmware¶
Connect the nRF54L15 Connect Kit to the computer with a USB-C cable:
Then flash the sample using west flash
:
Tip
In case you wonder, the west flash
will execute the following command:
Testing¶
After programming the sample, test it by performing the following steps:
-
Open up a serial terminal, specifying the primary COM port that your computer uses to communicate with the nRF54L15:
- Start PuTTY.
-
Configure the correct serial port and click Open:
-
Press the DFU/RST button to reset the nRF54L15.
-
Once the sample starts running, you should see the following output:
-
Observe that the Green LED turns off three seconds after the programming has completed. This indicates that the system is in the System OFF mode.
-
Touch the NFC antenna with the smartphone or tablet.
-
Observe that the Green LED is lit. It turns off after three seconds. This indicates that system is in the System OFF mode again. Expected terminal output: