Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NFC doesn't work when the softdevice is enabled

Hello,

I'm using the sdk v17.0.2 with softdevice s140 with a custom PCB shipping the nrf52840.

I'm facing an issue where I cannot enable NFC and softdevice at the same time.

When the NFC is enabled and the softdevice is not, the my tag can be read from an Android smartphone. But I soon I enable the softdevice (with nrf_sdh_enable_request), the tag cannot be read anymore.

There is my very simple example:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "nfc_ndef_msg.h"
#include "nfc_t2t_lib.h"
#include "nfc_text_rec.h"
#include <app_error.h>
#include <nrf_log.h>
#include <nrf_pwr_mgmt.h>
#include <nrf_sdh.h>
#include <string.h>
#define MAX_REC_COUNT 3 /**< Maximum records count. */
/* Text message in English with its language code. */
/** @snippet [NFC text usage_1] */
static const uint8_t en_payload[] = {
'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
static const uint8_t en_code[] = {'e', 'n'};
/** @snippet [NFC text usage_1] */
/* Buffer used to hold an NFC NDEF message. */
uint8_t m_ndef_msg_buf[256];
/**
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I found a similar issue here [1] but the fix doesn't work for me.

There is my linker script file:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Linker script to configure memory regions. */
SEARCH_DIR(.)
GROUP(-lgcc -lc -lnosys)
MEMORY
{
FLASH (rx) : ORIGIN = 0x27000, LENGTH = 0xc9000
RAM (rwx) : ORIGIN = 0x20002C00, LENGTH = 0x3d400
uicr_bootloader_start_address (r) : ORIGIN = 0x10001014, LENGTH = 0x4
}
SECTIONS
{
. = ALIGN(4);
.uicr_bootloader_start_address :
{
PROVIDE(__start_uicr_bootloader_start_address = .);
KEEP(*(SORT(.uicr_bootloader_start_address*)))
PROVIDE(__stop_uicr_bootloader_start_address = .);
} > uicr_bootloader_start_address
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I still do not understand if I need to register soc event with NRF_SDH_BLE_OBSERVER. Do the nfc_t2t handle it?

[1] https://devzone.nordicsemi.com/f/nordic-q-a/42141/nrf52832---nfc-stops-working-when-softdevice-is-enabled

Best,

Joël