<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>NFC Wake Up and TNEP</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/126399/nfc-wake-up-and-tnep</link><description>Context : I&amp;#39;m building an embedded application using the nrf52832, that can turn on/off and be configured via NFC. These functionnality are implemented using the t4t library in R/W mode and are functional, I am able to read and write text NDEF messages</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Jan 2026 14:51:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/126399/nfc-wake-up-and-tnep" /><item><title>RE: NFC Wake Up and TNEP</title><link>https://devzone.nordicsemi.com/thread/558822?ContentTypeID=1</link><pubDate>Thu, 15 Jan 2026 14:51:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50f1b83e-ed53-49b8-a8bd-67160d853f46</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;We have made an internal ticket on this for investigation and I&amp;#39;ll keep you up to date on the progress.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NFC Wake Up and TNEP</title><link>https://devzone.nordicsemi.com/thread/558735?ContentTypeID=1</link><pubDate>Wed, 14 Jan 2026 19:43:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e209b46-b620-4577-8afb-5cf287696e63</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi bloonie,&lt;/p&gt;
&lt;p&gt;Please be informed that Simon is out of office this week and will return and continue helping you next week.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NFC Wake Up and TNEP</title><link>https://devzone.nordicsemi.com/thread/558293?ContentTypeID=1</link><pubDate>Thu, 08 Jan 2026 14:21:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9dee57b6-e36b-4c25-af30-439397640579</guid><dc:creator>bloonie</dc:creator><description>&lt;p&gt;I&amp;#39;ve been using ncs 3.1.1 until now, but I&amp;#39;ve just tried with v3.2.1 and the behavior is the same.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NFC Wake Up and TNEP</title><link>https://devzone.nordicsemi.com/thread/558272?ContentTypeID=1</link><pubDate>Thu, 08 Jan 2026 12:58:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a50da1cd-afd2-46bd-9370-e20001f3dd5b</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Thanks, I also see I haven&amp;#39;t asked which NCS version you&amp;#39;re working on. Can you confirm that as well? There were some known NFC issues prior to NCS v3.2.0, so if you&amp;#39;re on an older version, we strongly recommend migrating to NCS v3.2.0.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NFC Wake Up and TNEP</title><link>https://devzone.nordicsemi.com/thread/558241?ContentTypeID=1</link><pubDate>Thu, 08 Jan 2026 09:46:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6b75e38-e033-4957-b251-55309760b143</guid><dc:creator>bloonie</dc:creator><description>&lt;p&gt;Here is a cutdown version using only the NFC and LEDs, I tested it and it exhibits the same symptom as the full version.&lt;/p&gt;
&lt;p&gt;I do use a custom board, but it should work with the nRF52832DK, you may have to rewrite some values for the LEDs assignment.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;APP_main.h&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void APP_main_scheduleSystemOff(int delay_s);
void APP_main_cancelSystemOff  (void);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;APP_main.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;//--------- HEADER INCLUDE  ---------------
#include &amp;quot;APP_main.h&amp;quot;
//--------- C STANDARD INCLUDES -----------
#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stddef.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
//--------- &amp;#181;C INCLUDES -------------------
//--------- OS INCLUDES -------------------
#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;hal/nrf_power.h&amp;gt;
#if !NRF_POWER_HAS_RESETREAS
#include &amp;lt;hal/nrf_reset.h&amp;gt;
#endif
#include &amp;lt;zephyr/sys/poweroff.h&amp;gt;
//--------- EXTERNALS INCLUDES ------------
//--------- PROJECT INCLUDES --------------
#include &amp;quot;APP_led.h&amp;quot;
#include &amp;quot;APP_nfc.h&amp;quot;
//--------- MACROS ------------------------
#define APP_MAIN_SYSTEM_OFF_FROM_RESTART_DELAY_S    15       ///&amp;lt; Delay to set a value in nfc record before shutting off after a restart on nfc field detection
//--------- TYPES AND ENUMERATIONS --------

//--------- GLOBAL VARIABLES --------------

//--------- PRIVATE VARIABLES -------------

LOG_MODULE_REGISTER(APP_main);

K_SEM_DEFINE(l_continueStartSemaphore, 0, 1);

static struct k_work_delayable work_systemOff; //&amp;lt; Delayed work that enters system off. @ref cbWorkerSystemOff
//--------- PRIVATE FUNCTION PROTOTYPES ---
static void                   printResetReason(void);
static void                   cbWorkerSystemOff(struct k_work* pWork);
//--------- PUBLIC FUNCTIONS --------------

/**
 * @brief Schedule the system power off after a delay
 * @param delay_s delay before power off
 */
void APP_main_scheduleSystemOff(int delay_s)
{
	k_work_reschedule(&amp;amp;work_systemOff, K_SECONDS(delay_s));
}

void APP_main_cancelSystemOff()
{
    LOG_INF(&amp;quot;SystemOff canceled&amp;quot;);
	k_work_cancel_delayable(&amp;amp;work_systemOff); 
    k_sem_give(&amp;amp;l_continueStartSemaphore);
}
//--------- PRIVATE FUNCTIONS -------------


/**
 * @brief Function entering system off.
 * System off is delayed to make sure that NFC tag was correctly read.
 * @param pWork unused
 */
static void cbWorkerSystemOff(struct k_work* pWork)
{
	LOG_INF(&amp;quot;Powering off system...&amp;quot;);
	sys_poweroff();
}

/**
 * @brief  Helper function for printing the reason of the last reset.
 * Can be used to confirm that NCF field actually woke up the system.
 */
static void printResetReason(void)
{
	uint32_t reas;

#if NRF_POWER_HAS_RESETREAS

	reas = nrf_power_resetreas_get(NRF_POWER);
	nrf_power_resetreas_clear(NRF_POWER, reas);
	if (reas &amp;amp; NRF_POWER_RESETREAS_NFC_MASK) {
		LOG_INF(&amp;quot;Wake up by NFC field detect\n&amp;quot;);
	} else if (reas &amp;amp; NRF_POWER_RESETREAS_RESETPIN_MASK) {
		LOG_INF(&amp;quot;Reset by pin-reset\n&amp;quot;);
	} else if (reas &amp;amp; NRF_POWER_RESETREAS_SREQ_MASK) {
		LOG_INF(&amp;quot;Reset by soft-reset\n&amp;quot;);
	} else if (reas) {
		LOG_INF(&amp;quot;Reset by a different source (0x%08X)\n&amp;quot;, reas);
	} else {
		LOG_INF(&amp;quot;Power-on-reset\n&amp;quot;);
	}

#else

	reas = nrf_reset_resetreas_get(NRF_RESET);
	nrf_reset_resetreas_clear(NRF_RESET, reas);
	if (reas &amp;amp; NRF_RESET_RESETREAS_NFC_MASK) {
		printk(&amp;quot;Wake up by NFC field detect\n&amp;quot;);
	} else if (reas &amp;amp; NRF_RESET_RESETREAS_RESETPIN_MASK) {
		printk(&amp;quot;Reset by pin-reset\n&amp;quot;);
	} else if (reas &amp;amp; NRF_RESET_RESETREAS_SREQ_MASK) {
		printk(&amp;quot;Reset by soft-reset\n&amp;quot;);
	} else if (reas) {
		printk(&amp;quot;Reset by a different source (0x%08X)\n&amp;quot;, reas);
	} else {
		printk(&amp;quot;Power-on-reset\n&amp;quot;);
	}

#endif
}

/**
 * Initialize all modules and timers, read and/or apply configuration, start advertising, then go to idle forever.
 */
int main(void)
{
    int status;

    printResetReason();
    
    k_work_init_delayable(&amp;amp;work_systemOff, cbWorkerSystemOff);

    APP_main_scheduleSystemOff(APP_MAIN_SYSTEM_OFF_FROM_RESTART_DELAY_S);

    status = APP_nfc_init();
    if (0 != status)
    {
        LOG_ERR(&amp;quot;NFC initialization failed&amp;quot;);
        return status;
    }
    LOG_DBG(&amp;quot;NFC initialized successfuly&amp;quot;);

    status = APP_led_init();
    if (0 != status)
    {
        LOG_ERR(&amp;quot;Leds initialization failed&amp;quot;);
        return status;
    }
    LOG_DBG(&amp;quot;Leds initialized successfuly&amp;quot;);

    APP_led_blueOn();
    k_sleep(K_MSEC(500));
    APP_led_blueOff();

    k_sem_take(&amp;amp;l_continueStartSemaphore, K_FOREVER); // Wait until the correct values have been written in nfc records before resuming the start sequence

    LOG_INF(&amp;quot;START APP&amp;quot;);
    
    // LEDS
    APP_led_blueOn();
    k_sleep(K_MSEC(1000));
    APP_led_blueOff();
    k_sleep(K_MSEC(800));
    for(int i = 0; i &amp;lt; 3; i++)
    {
        k_sleep(K_MSEC(200));
        APP_led_blueOn();
        k_sleep(K_MSEC(200));
        APP_led_blueOff();
    }

    for (;;) {
        k_sleep(K_FOREVER);
    }
    return status;
}

//--------- END OF FILE -------------------&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;APP_nfc.h&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int APP_nfc_init();&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;APP_nfc.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;//--------- HEADER INCLUDE  ----------------
#include &amp;quot;APP_nfc.h&amp;quot;
//--------- C STANDARD INCLUDES ------------
#include &amp;lt;stdlib.h&amp;gt;
//--------- MCU INCLUDES -------------------
//--------- OS INCLUDES --------------------
#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
//--------- EXTERNALS INCLUDES -------------
#include &amp;lt;nfc_t4t_lib.h&amp;gt;
#include &amp;lt;nfc/ndef/msg.h&amp;gt;
#include &amp;lt;nfc/ndef/text_rec.h&amp;gt;
#include &amp;lt;nfc/tnep/tag.h&amp;gt;
#include &amp;lt;nfc/ndef/msg_parser.h&amp;gt;
#include &amp;lt;nfc/ndef/record_parser.h&amp;gt;
#include &amp;lt;nfc/t4t/ndef_file.h&amp;gt;
//--------- PROJECT INCLUDES ---------------
#include &amp;quot;APP_main.h&amp;quot;
//--------- MACROS -------------------------
#define MAX_REC_COUNT (2)
#define MAX_SVC_COUNT (1)
#define NDEF_BUF_SIZE (128)

#define ON_OFF_RECORD_INDEX (0)
#define TIME_RECORD_INDEX   (1)

#define APP_NFC_SYSTEM_OFF_DELAY_S                 3  ///&amp;lt; Delay before shutting off when device is turned off from NFC
//--------- TYPES AND ENUMERATIONS ---------
//--------- PRIVATE FUNCTION PROTOTYPES ----
static void cbNfc(void *pContext, nfc_t4t_event_t event, const uint8_t *pBuffer, size_t bufferLength, uint32_t flags);
static int  tnep_initial_msg_encode(struct nfc_ndef_msg_desc *msg);;
static void cbWorkerHandlePayload();
static int  getUsefulPayloadFromRecord(const struct nfc_ndef_record_desc *pRecord, uint8_t *pBuffer);
//--------- PRIVATE VARIABLES --------------
LOG_MODULE_REGISTER(APP_nfc);

static struct k_poll_event events[NFC_TNEP_EVENTS_NUMBER];

static uint8_t ndef_msg_buf[NDEF_BUF_SIZE] = {0};
static uint8_t tnep_swap_buf[NDEF_BUF_SIZE] = {0};
static uint8_t test_buf[NDEF_BUF_SIZE] = {0};
static uint8_t l_aOnOffRecordText[] = &amp;quot;OFF&amp;quot;;
static uint8_t l_aTimeRecordText[sizeof(&amp;quot;4294967295&amp;quot;)] = &amp;quot;0&amp;quot;;


static size_t nfc_data_len = 0;
static const uint8_t en_code[] = {&amp;#39;e&amp;#39;, &amp;#39;n&amp;#39;};
static const uint8_t aSvcUri[] = &amp;quot;LXS&amp;quot;;
static struct k_work work_test;

NFC_TNEP_TAG_SERVICE_DEF(nfcService, aSvcUri, sizeof(aSvcUri), NFC_TNEP_COMM_MODE_SINGLE_RESPONSE, 20, 10, 0, NULL, NULL, NULL, NULL);
//--------- PUBLIC VARIABLES ---------------
//--------- PUBLIC FUNCTIONS ---------------
int APP_nfc_init()
{
    int err = 0;
    size_t len = sizeof(ndef_msg_buf);

    k_work_init(&amp;amp;work_test, cbWorkerHandlePayload);

    err = nfc_tnep_tag_tx_msg_buffer_register(ndef_msg_buf, tnep_swap_buf, len);
    if (0 != err)
    {
        LOG_ERR(&amp;quot;Cannot register tnep buffer, err: %d\n&amp;quot;, err);
        return 0;
    }

    err = nfc_tnep_tag_init(events, ARRAY_SIZE(events), nfc_t4t_ndef_rwpayload_set);
    if (0 != err)
    {
        LOG_ERR(&amp;quot;Cannot initialize TNEP protocol, err: %d\n&amp;quot;, err);
        return 0;
    }



    err = nfc_t4t_setup(cbNfc, NULL);

    if(0 == err)
    {
        /* Set created message as the NFC payload */
        err = nfc_tnep_tag_initial_msg_create(MAX_REC_COUNT + MAX_SVC_COUNT, tnep_initial_msg_encode);
        if (0 == err) {
            err = nfc_t4t_emulation_start();
            if (0 != err)
            {
                LOG_ERR(&amp;quot;NFC T4T emulation start failed with %d&amp;quot;, err);
            }
        }
        else
        {
            LOG_ERR(&amp;quot;Cannot set payload! %d&amp;quot;, err);
        }
    }
    else
    {
        LOG_ERR(&amp;quot;NFC T4T SETUP failed with %d&amp;quot;, err);
    }

    return err;
}
//--------- PRIVATE FUNCTIONS --------------
static void cbNfc(void *pContext, nfc_t4t_event_t event, const uint8_t *pBuffer, size_t bufferLength, uint32_t flags)
{
    switch (event) {
        case NFC_T4T_EVENT_NDEF_UPDATED:
            LOG_INF(&amp;quot;NFC NDEF_UPDT&amp;quot;);
            if(0 &amp;lt; bufferLength)
            {
                nfc_data_len = bufferLength;
                nfc_tnep_tag_rx_msg_indicate(nfc_t4t_ndef_file_msg_get(pBuffer), bufferLength);
                memcpy(test_buf, nfc_t4t_ndef_file_msg_get(pBuffer), bufferLength);
                k_work_submit(&amp;amp;work_test);
            }
            break;
        case NFC_T4T_EVENT_FIELD_ON:
            LOG_INF(&amp;quot;NFC field on&amp;quot;);
            break;
        case NFC_T4T_EVENT_FIELD_OFF:
            LOG_INF(&amp;quot;NFC field off&amp;quot;);
            break;
        default:
            break;
    }
}

static int tnep_initial_msg_encode(struct nfc_ndef_msg_desc *msg)
{
    
    // Use Text Record to test with generic app
    NFC_NDEF_TEXT_RECORD_DESC_DEF(onOffRecord, UTF_8, en_code,
                      sizeof(en_code), l_aOnOffRecordText,
                      strlen(l_aOnOffRecordText));

    NFC_NDEF_TEXT_RECORD_DESC_DEF(timeRecord, UTF_8, en_code,
                      sizeof(en_code), l_aTimeRecordText,
                      strlen(l_aTimeRecordText));

    struct nfc_ndef_record_desc records[] = { NFC_NDEF_TEXT_RECORD_DESC(onOffRecord), NFC_NDEF_TEXT_RECORD_DESC(timeRecord) };
    

    return nfc_tnep_initial_msg_encode(msg,
                       records,
                       MAX_REC_COUNT);

}

static void cbWorkerHandlePayload()
{
    uint32_t data_len = nfc_data_len;
    uint8_t res_buf[NDEF_BUF_SIZE * MAX_REC_COUNT];
    uint32_t res_buf_size = sizeof(res_buf);
    
    int err = nfc_ndef_msg_parse(res_buf, &amp;amp;res_buf_size, test_buf, &amp;amp;data_len);
    if (0 == err)
    {
        struct nfc_ndef_msg_desc* msg_desc = (struct nfc_ndef_msg_desc*)(res_buf);
        nfc_ndef_msg_printout(msg_desc); //DEBUG
        if(0 != getUsefulPayloadFromRecord(msg_desc-&amp;gt;record[ON_OFF_RECORD_INDEX], l_aOnOffRecordText))
        {
            if (0 == strcmp(l_aOnOffRecordText, &amp;quot;OFF&amp;quot;))
            {
                LOG_INF(&amp;quot;NFC REC OFF&amp;quot;);
                APP_main_scheduleSystemOff(APP_NFC_SYSTEM_OFF_DELAY_S);
            }
            else if (0 == strcmp(l_aOnOffRecordText, &amp;quot;ON&amp;quot;))
            {
                LOG_INF(&amp;quot;NFC REC ON&amp;quot;);
                APP_main_cancelSystemOff();
            }
        }
        if(0 != getUsefulPayloadFromRecord(msg_desc-&amp;gt;record[TIME_RECORD_INDEX], l_aTimeRecordText))
        {
            LOG_INF(&amp;quot;NFC REC TIME&amp;quot;);
            //APP_time_setReferenceTime(strtoul(l_aTimeRecordText, NULL, 10));
        }
        
    }
    else
    {
        LOG_ERR(&amp;quot;nfc ndef msg parse failed with %d&amp;quot;, err);
    }
}

static int getUsefulPayloadFromRecord(const struct nfc_ndef_record_desc *pRecord, uint8_t *pBuffer)
{
    const struct nfc_ndef_bin_payload_desc* pBinPayloadDescriptor = pRecord-&amp;gt;payload_descriptor;
    const uint8_t* pUsefulRecBuf = pBinPayloadDescriptor-&amp;gt;payload + sizeof(en_code) + 1;
    const uint8_t usefulRecSize = pBinPayloadDescriptor-&amp;gt;payload_length - sizeof(en_code) - 1;
    const uint8_t currentSize   = strlen(pBuffer);
    int comparisonValue = 0xFF;

    if (usefulRecSize == currentSize){ comparisonValue = memcmp(pBuffer, pUsefulRecBuf, currentSize); }

    LOG_HEXDUMP_INF(pBuffer      , currentSize  , &amp;quot;existing record&amp;quot;);
    LOG_HEXDUMP_INF(pUsefulRecBuf, usefulRecSize, &amp;quot;incoming record&amp;quot;);

    memcpy(pBuffer, pUsefulRecBuf, usefulRecSize);
    pBuffer[usefulRecSize] = 0x00;  //Add null char at end of array, not found in NDEF messages.
    LOG_HEXDUMP_INF(pBuffer, strlen(pBuffer) , &amp;quot;new record&amp;quot;);

    return comparisonValue;
}
//--------- END OF FILE --------------------&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;APP_led.h&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int  APP_led_init   (void);
void APP_led_blueOn (void);
void APP_led_blueOff(void);
void APP_led_redOn  (void);
void APP_led_redOff (void);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;APP_led.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;//--------- PRIVATE VARIABLES -------------
LOG_MODULE_REGISTER(APP_led);

static const struct gpio_dt_spec l_blueLed = GPIO_DT_SPEC_GET(DT_PATH(leds, led_0), gpios); //&amp;lt; Zephyr pointer to blue led
static const struct gpio_dt_spec l_redLed  = GPIO_DT_SPEC_GET(DT_PATH(leds, led_1), gpios); //&amp;lt; Zephyr pointer to red led

//--------- PRIVATE FUNCTION PROTOTYPES ---
//--------- PUBLIC FUNCTIONS --------------

/**
 * @brief initialize LEDs (and configure unused GPIOs TEST IF USEFUL)
 * @retval 0   = OK
 * @retval 1   = Device not ready
 * @retval &amp;lt; 0 = Zephyr error code
 */
int APP_led_init()
{
    int status = 0;
    if(false == device_is_ready(l_blueLed.port))
    {
        LOG_ERR(&amp;quot;Blue led is not ready&amp;quot;);
        return 1;
    }
    if(false == device_is_ready(l_redLed.port))
    {
        LOG_ERR(&amp;quot;Red led is not ready&amp;quot;);
        return 1;
    }

    status = gpio_pin_configure_dt(&amp;amp;l_blueLed, GPIO_OUTPUT_ACTIVE);
    if(0 != status) {
        LOG_ERR(&amp;quot;Blue led pin configuration failed with %d&amp;quot;, status);
        return status;
    }

    status = gpio_pin_configure_dt(&amp;amp;l_redLed , GPIO_OUTPUT_ACTIVE);
    if(0 != status)
    {
        LOG_ERR(&amp;quot;Red led pin configuration failed with %d&amp;quot;, status);
        return status;
    }

    return 0;
}


/// @brief Turn on blue LED
void APP_led_blueOn ()     { gpio_pin_set_dt   (&amp;amp;l_blueLed, 0); }
/// @brief Turn off blue LED
void APP_led_blueOff()     { gpio_pin_set_dt   (&amp;amp;l_blueLed, 1); }
/// @brief Turn on red LED
void APP_led_redOn  ()     { gpio_pin_set_dt   (&amp;amp;l_redLed , 0); }
/// @brief Turn off red LED
void APP_led_redOff ()     { gpio_pin_set_dt   (&amp;amp;l_redLed , 1); }

//--------- PRIVATE FUNCTIONS -------------

//--------- END OF FILE -------------------&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;CMakeLists.txt&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cmake_minimum_required(VERSION 3.20.0)
set(BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(IoTag)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
target_sources(app PRIVATE 
    src/APP_main.c
    src/APP_led.c
    src/APP_nfc.c
    )
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;prj.conf&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_USE_SEGGER_RTT=y
CONFIG_CBPRINTF_FP_SUPPORT=y
CONFIG_GPIO=y

CONFIG_LOG=y

CONFIG_NFC_T4T_NRFXLIB=y

CONFIG_NFC_NDEF=y
CONFIG_NFC_NDEF_MSG=y
CONFIG_NFC_NDEF_RECORD=y
CONFIG_NFC_NDEF_TEXT_RECORD=y
CONFIG_POWEROFF=y
CONFIG_NFC_TNEP_TAG=y
CONFIG_POLL=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;iotag.dts&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/dts-v1/;
#include &amp;lt;nordic/nrf52832_qfaa.dtsi&amp;gt;
#include &amp;quot;IoTag-pinctrl.dtsi&amp;quot;

/ {
    model = &amp;quot;Linxens IoTag&amp;quot;;
    compatible = &amp;quot;Linxens,IoTag&amp;quot;;

    chosen {
        zephyr,sram = &amp;amp;sram0;
        zephyr,flash = &amp;amp;flash0;
    };

    leds {
        compatible = &amp;quot;gpio-leds&amp;quot;;

        led0: led_0 {
            gpios = &amp;lt;&amp;amp;gpio0 17 GPIO_ACTIVE_LOW&amp;gt;;
            label = &amp;quot;Blue LED 0&amp;quot;;
        };

        led1: led_1 {
            gpios = &amp;lt;&amp;amp;gpio0 18 GPIO_ACTIVE_LOW&amp;gt;;
            label = &amp;quot;Red LED 1&amp;quot;;
        };
    };

};

&amp;amp;gpio0 {
    status = &amp;quot;okay&amp;quot;;
};

&amp;amp;gpiote {
    status = &amp;quot;okay&amp;quot;;
};

&amp;amp;nfct {
	status = &amp;quot;okay&amp;quot;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NFC Wake Up and TNEP</title><link>https://devzone.nordicsemi.com/thread/558226?ContentTypeID=1</link><pubDate>Thu, 08 Jan 2026 07:43:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:209793bc-b116-4840-aa8b-767e7ea11bd0</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Do you have the project you&amp;#39;re working on here so we can try reproduce it on our end? Will it also run on the nRF52832 DK for example? I have asked internally if anyone has any idea of what&amp;#39;s going on here, as this sounds very strange indeed.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NFC Wake Up and TNEP</title><link>https://devzone.nordicsemi.com/thread/558161?ContentTypeID=1</link><pubDate>Wed, 07 Jan 2026 13:29:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5563ad5b-c1e4-4bb8-8778-55f40d35d6bb</guid><dc:creator>bloonie</dc:creator><description>&lt;p&gt;The use case is a smart sensor that can be turned on/off and be configured over NFC, I feel that the need to move the phone around instead of just keeping it there would be a huge detriment to the user experience, especially for the ones that may be unfamiliar with the system&amp;#39;s inner working.&lt;br /&gt;&lt;br /&gt;What I want is for the device to wake up from a phone&amp;#39;s NFC field, and be able to edit NDEF records without moving away and back.&lt;br /&gt;&lt;br /&gt;I am already using the t4t, and I also have noticed a strange behavior regarding the field ON/OFF events that may be linked to my problem. When the device is already on, and&amp;nbsp; I approach it with my phone, the events are called as expected (OFF only when I move away, ON only when I get closer). BUT if the device is Off and I wake it up with the phone&amp;#39;s NFC and leave it there (which is the end goal), I repeatedly get the FIELD_OFF event until I move the phone away.&lt;/p&gt;
&lt;p&gt;I have tried restarting the NFC tag emulation (nfc_t4t_emulation_start/stop functions) and noticed no changes, if you meant something else, I&amp;#39;m not aware of how to proceed.&lt;/p&gt;
&lt;p&gt;Thank you for the quick responses, by the way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NFC Wake Up and TNEP</title><link>https://devzone.nordicsemi.com/thread/558142?ContentTypeID=1</link><pubDate>Wed, 07 Jan 2026 12:06:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad7fcffd-7fa5-4d7b-82ef-7aac8ff92c92</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Let me make sure I get this straight.&lt;/p&gt;
&lt;p&gt;I tested on my end with the writable &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/nfc/record_text/README.html"&gt;NDEF msg sample project&lt;/a&gt;&amp;nbsp;now, and as long as I choose in the NFC Tools app that I want to write to a tag it does write to it as soon as I approach it. But if I have not selected &amp;quot;Write&amp;quot; before approaching it I will indeed have to move away from it before being able to write to it again.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What you want is to approach the tag as normal, but then write to it without moving away from it to write and edit NDEF records on the spot, correct? I don&amp;#39;t think changing to the T4T library will make a change. The only thing I can think of is&amp;nbsp;to uninitialize and reinitialize NFC on the nRF52832&amp;nbsp;some time after the NFC_T2T_EVENT_FIELD_ON event has been there for a while so that it can be triggered again after initialization as means to &amp;quot;check&amp;quot; for any updates. As far as I know there are no ways to check for changes in the NFC libraries, and moving away from and back to the device is the most common way to do so. Do you have some more details on the use case itself? Why do they need to be constantly close to each other?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NFC Wake Up and TNEP</title><link>https://devzone.nordicsemi.com/thread/558063?ContentTypeID=1</link><pubDate>Tue, 06 Jan 2026 15:17:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6cf44af4-c390-4e9c-a2d1-6ffae32acdf6</guid><dc:creator>bloonie</dc:creator><description>&lt;p&gt;I mainly use the ST25 app because it&amp;#39;s the only one I&amp;#39;ve found that can edit existing NDEF records, but I&amp;#39;ve had the same problem with the android NFC tools app, and the nRF NFC Toolbox.&lt;br /&gt;&lt;br /&gt;Just to clarify, the tags do pop up instantly when the device is already on, the problem is when the device is off and starts emulating a tag while the phone RF field is still around.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NFC Wake Up and TNEP</title><link>https://devzone.nordicsemi.com/thread/558059?ContentTypeID=1</link><pubDate>Tue, 06 Jan 2026 15:04:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16d3854a-3f31-4da4-bd20-e6da51b5d966</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What NFC app exactly are you using on your phone. In my experience, when using the NFC Tools app for Android, NFC tags pops up instantly when discovered without having to move them away from the device. I can try recreating this on my end tomorrow with the unmodified NDEF sample on a development kit.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>