Skip to content

Conversation

@ankuns
Copy link
Contributor

@ankuns ankuns commented Jan 8, 2026

The Bare Metal requires TNEP tag handling which is implemented in subsys/nfc/tnep/tag.c file. Current code in subsys/nfc/tnep/tag.c used k_poll_event features directly, which are not available in Bare Metal.

This PR separates TNEP signalling from subsys/nfc/tnep/tag.c so that the subsys/nfc/tnep/tag.c file can be re-used by Bare Metal.
The TNEP signalling using zephyr primitives is provided in the sdk-nrf.
The TNEP signalling using other primitives will be provided in the sdk-nrf-bm (see PR nrfconnect/sdk-nrf-bm#606 )

Full justification in commit messages.

The NFC TNEP signalling functionality in the nRF Connect SDK
is based on Zephyr kernel primitives.  In the Bare Metal the Zephyr
primitives are not available. The Bare Metal will need a separate
implementation based on Bare Metal primitives. To allow that the
TNEP signalling is extracted from the subsys/nfc/tnep/tag.c into
separate files.

The include/nfc/tnep/tag_signalling.h is the header that defines
the signalling API that is used by subsys/nfc/tnep/tag.c
implementation.

The subsys/nfc/tnep/tag.c is now signalling-agnostic and uses the
signalling API defined in include/nfc/tnep/tag_signalling.h.

The subsys/nfc/tnep/tag_signalling_zephyr.c contains the Zephyr-based
implementation of the signalling API and the Zephyr-specific
initialization function. For other non Zephyr-based platforms
separate signalling implementation files may be created.

Because the way of handling signalling is platform-specific,
the `nfc_tnep_tag_init()` API is changed to not require
`struct k_poll_event *events, uint8_t event_cnt` parameters.
Instead, the platform-specific signalling initialization must be called
before calling `nfc_tnep_tag_init()`. The Zephyr-based signalling
initialization function is named `nfc_tnep_tag_signalling_init()`,
its prototype is declared in include/nfc/tnep/tag_signalling_zephyr.h,
and it is implemented in subsys/nfc/tnep/tag_signalling_zephyr.c.

To allow selection of applicable signalling implementation the
Kconfig choice `NFC_TNEP_TAG_SIGNALLING` is added. In the
nRF Connect SDK it has only one choice:
`NFC_TNEP_TAG_SIGNALLING_ZEPHYR`. The Bare Metal will extend the
choice and provide separate signalling implementation.

The applications based on nRF Connect SDK using the NFC TNEP tag
functionality must be updated in the following way:
- include the signalling header
  `#include <nfc/tnep/tag_signalling_zephyr.h>`
- call the signalling initialization function
  `nfc_tnep_tag_signalling_init()` before calling `nfc_tnep_tag_init()`
  The `events` and `event_cnt` parameters that were previously passed
  to `nfc_tnep_tag_init()` now are to be passed to
  `nfc_tnep_tag_signalling_init` function.

Signed-off-by: Andrzej Kuros <[email protected]>
@NordicBuilder NordicBuilder added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Jan 8, 2026
The `nfc_tnep_tag_init` function prototype has been changed.
It requires now that `nfc_tnep_tag_signalling_init` is called before.
This commit adjusts the samples accordingly.

Signed-off-by: Andrzej Kuros <[email protected]>
@ankuns ankuns force-pushed the nfc_tnep_tag_separate_signalling_v4main branch from 276de58 to d32394c Compare January 8, 2026 12:38
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Jan 8, 2026

CI Information

To view the history of this post, click the 'edited' button above
Build number: 3

Inputs:

Sources:

sdk-nrf: PR head: d32394ccb47eb1bf49533b656f2b2e3905841442

more details

sdk-nrf:

PR head: d32394ccb47eb1bf49533b656f2b2e3905841442
merge base: d6c88a74779647f151672a83b995215491d0df9a
target head (main): d6c88a74779647f151672a83b995215491d0df9a
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (9)
include
│  ├── nfc
│  │  ├── tnep
│  │  │  ├── tag.h
│  │  │  ├── tag_signalling.h
│  │  │  │ tag_signalling_zephyr.h
samples
│  ├── bluetooth
│  │  ├── peripheral_nfc_pairing
│  │  │  ├── src
│  │  │  │  │ main.c
│  ├── nfc
│  │  ├── tnep_tag
│  │  │  ├── src
│  │  │  │  │ main.c
subsys
│  ├── nfc
│  │  ├── tnep
│  │  │  ├── CMakeLists.txt
│  │  │  ├── Kconfig
│  │  │  ├── tag.c
│  │  │  │ tag_signalling_zephyr.c

Outputs:

Toolchain

Version: f911d4f4e7
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:f911d4f4e7_5ea73affbf

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 844
  • ✅ Integration tests
    • ✅ test-fw-nrfconnect-nfc
    • ✅ test-sdk-find-my
Disabled integration tests
    • test-fw-nrfconnect-nrf_lrcs_mosh
    • desktop52_verification
    • test_ble_nrf_config
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nrf-iot_cloud
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-ps-main
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-fw-nrfconnect-thread-main
    • test-low-level
    • test-sdk-audio
    • test-sdk-dfu
    • test-sdk-mcuboot
    • test-sdk-wifi
    • test-secdom-samples-public

Note: This message is automatically posted and updated by the CI

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

You can find the documentation preview for this PR here.

k_poll_signal_reset(tnep_ctrl.events[i].signal);
tnep_ctrl.events[i].state = K_POLL_STATE_NOT_READY;
if (nfc_tnep_tag_signalling_rx_event_check_and_clear(&event)) {
/* Run TNEP State Machine - prepare response */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Response or receive?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants