Hi,
I’m trying to work with the NFC without luck.
I’ve connected a few NFC antennas that work with other NFC devices but I can get any reading from it.
I’ve installed version 1.0.0 and used the example projects for text and URL.
Any ideas?
Hi,
I’m trying to work with the NFC without luck.
I’ve connected a few NFC antennas that work with other NFC devices but I can get any reading from it.
I’ve installed version 1.0.0 and used the example projects for text and URL.
Any ideas?
Did you enable the NFC pins as NFC pins? Not sure if they are enabled by default.
hmm… how do I do that?
They supposed to be enabled by default, but may be you can check. Also the NFC antenna circuit has to be very specific with proper external capacitors sizing. Check with this forum by Nordic:
https://devzone.nordicsemi.com/f/nordic-q-a/35505/nrf52-enabling-gpio-on-nfc-pins
What antennas have you tried, I plan on looking into being able to change the NFC (TAG) message programmatically if it’s indeed possible. Maybe some smart seeed guys or gals has an answer.
I see it requires tuning with the correct caps. I’m curious to find out how thick of material (PLA or Carbon-fiber nylon) would it pass through. ANy ideas or thoughts on the subject is appreciated.
GL ;-p
Hey just checking to see if you got this working I have wired up an antenna but it isn’t seeming to work using the seeed code.
Thanks
Hi Parker_Gust,
Wow cool what antenna is that? , What type ? Any schematic ,
what value of capacitors did yo use?
I use NFC pro Tools to test with… LOL
HTH
GL :-p
The Seeed nRF52 Boards version 1.1.3 and Seeed nRF52 mbed-enabled Boards version 2.9.2 have been tested and approved.
You can update these yourself in the Arduino IDE’s Board Manager.
Thank you all for waiting !
The NFC pins on the boards that I got were not set to NFC function.
I’ve reflashed the bootloader and it worked.
Hi Tovi,
Could you provide more info on the NFC configuration you are using. Would you be able to post relevant code example. any antenna info also, would be greatly appreciated and the users would all benefit.
GL PJ
For us Short bus Folks can You spell it out on This?
TIA
GL PJ
Due to the issue
Sorry, new users can only put one embedded media item in a post.
Sorry, new users can only put 2 links in a post.
I split this up in several posts …
I also tried to get the NFC running. Here what I did and how I got it running for my use cases.
Required steps
The Adafruit nRF52 bootloader does not include the XIAO BLE boards definition. You need to add them yourself. I took 0hotpotman0’s changes as a reference and applied it to the latest Adafruit nRF52 Bootloader version. See my git diff file below
It is required to get a NFC Antenna and tune it with the correct capacitors (It won’t work without these capacitors!)
I am not sure here, but it seemed somehow my UICR were protected?? So I required? an eraseall using a SWD debugger. (more info below)
See Nordic Devzone 82798 for more information
Erase all
Check the NFC related UICR. It should return FFFFFFFF and not FFFFFFFE
Flash the adafruit bootloader again after having erase all.
Copied this from the Adafruit Feather nRF52840 Sense tutorial on the Adafruit page (Sorry cannot use more than 2 links per post). This made me think I need to eraseall
D2/NFC2: The D2 pin is uses the same pad as one-half of the NFC antenna pins. By default, the nRF52840 Feather ships with these pins configured for GPIO mode, which is done by writing a value to the UICR flash config memory. If you wish to use NFC, you will need to erase the UICR memory which requires erasing the entire chip, and you will need a
[Segger J-Link] to reflash the bootloader and firmware.
This is how my board looks like now.
Verification by flashing the sample NFC: Launch App with an iPhone
Additional information / more details
Code to check if the NFC pins are configured for NFC and configure them for NFC if not.
if ((NRF_UICR->NFCPINS & UICR_NFCPINS_PROTECT_Msk) == (UICR_NFCPINS_PROTECT_NFC << UICR_NFCPINS_PROTECT_Pos)){
printk("NFCPINS = as NFC\n");
} else {
printk("NFCPINS = as GPIO\n");
nvmc_config(NVMC_CONFIG_WEN_Wen);
NRF_UICR->NFCPINS = NRF_UICR->NFCPINS | (UICR_NFCPINS_PROTECT_NFC << UICR_NFCPINS_PROTECT_Pos);
nvmc_wait();
nvmc_config(NVMC_CONFIG_WEN_Ren);
NVIC_SystemReset();
}
diff --git a/src/boards/boards.c b/src/boards/boards.c
index de95950..c2f56b2 100644
--- a/src/boards/boards.c
+++ b/src/boards/boards.c
@@ -73,9 +73,8 @@ void board_init(void)
// Use Internal OSC to compatible with all boards
NRF_CLOCK->LFCLKSRC = CLOCK_LFCLKSRC_SRC_RC;
NRF_CLOCK->TASKS_LFCLKSTART = 1UL;
-
- button_init(BUTTON_DFU);
- button_init(BUTTON_FRESET);
+ //button_init(BUTTON_DFU);
+ //button_init(BUTTON_FRESET);
NRFX_DELAY_US(100); // wait for the pin state is stable
#if LEDS_NUMBER > 0
diff --git a/src/boards/boards.h b/src/boards/boards.h
index 8aa0ece..9bb6b83 100644
--- a/src/boards/boards.h
+++ b/src/boards/boards.h
@@ -37,13 +37,13 @@
#define UF2_VOLUME_LABEL "NRF52BOOT "
#endif
-#ifndef BUTTON_DFU
-#define BUTTON_DFU BUTTON_1
-#endif
+//#ifndef BUTTON_DFU
+//#define BUTTON_DFU BUTTON_1
+//#endif
-#ifndef BUTTON_FRESET
-#define BUTTON_FRESET BUTTON_2
-#endif
+//#ifndef BUTTON_FRESET
+//#define BUTTON_FRESET BUTTON_2
+//#endif
// The primary LED is usually Red but not in all cases.
#define LED_PRIMARY 0
@@ -105,9 +105,9 @@ void led_tick(void);
// BUTTONS
//--------------------------------------------------------------------+
// Make sure we have at least two buttons (DFU + FRESET since DFU+FRST=OTA)
-#if BUTTONS_NUMBER < 2
-#error "At least two buttons required in the BSP (see 'BUTTONS_NUMBER')"
-#endif
+//#if BUTTONS_NUMBER < 2
+//#error "At least two buttons required in the BSP (see 'BUTTONS_NUMBER')"
+//#endif
void button_init(uint32_t pin);
bool button_pressed(uint32_t pin);
diff --git a/src/boards/xiao_nrf52840_ble/board.mk b/src/boards/xiao_nrf52840_ble/board.mk
index 8a77053..9142556 100644
--- a/src/boards/xiao_nrf52840_ble/board.mk
+++ b/src/boards/xiao_nrf52840_ble/board.mk
@@ -1,2 +1,3 @@
MCU_SUB_VARIANT = nrf52840
-SD_VERSION = 7.3.0
\ No newline at end of file
+SD_VERSION = 7.3.0
+USE_NFCT = yes
\ No newline at end of file
diff --git a/src/boards/xiao_nrf52840_ble_sense/board.mk b/src/boards/xiao_nrf52840_ble_sense/board.mk
index 8a77053..9142556 100644
--- a/src/boards/xiao_nrf52840_ble_sense/board.mk
+++ b/src/boards/xiao_nrf52840_ble_sense/board.mk
@@ -1,2 +1,3 @@
MCU_SUB_VARIANT = nrf52840
-SD_VERSION = 7.3.0
\ No newline at end of file
+SD_VERSION = 7.3.0
+USE_NFCT = yes
\ No newline at end of file
diff --git a/src/main.c b/src/main.c
index 960daa4..55e53d6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -259,10 +259,10 @@ static void check_dfu_mode(void)
/*------------- Determine DFU mode (Serial, OTA, FRESET or normal) -------------*/
// DFU button pressed
- dfu_start = dfu_start || button_pressed(BUTTON_DFU);
+ //dfu_start = dfu_start || button_pressed(BUTTON_DFU);
// DFU + FRESET are pressed --> OTA
- _ota_dfu = _ota_dfu || ( button_pressed(BUTTON_DFU) && button_pressed(BUTTON_FRESET) ) ;
+ //_ota_dfu = _ota_dfu || ( button_pressed(BUTTON_DFU) && button_pressed(BUTTON_FRESET) ) ;
bool const valid_app = bootloader_app_is_valid();
bool const just_start_app = valid_app && !dfu_start && (*dbl_reset_mem) == DFU_DBL_RESET_APP;
SORRY new users are not allowed to post more than 3 consecutive posts … So I have to remove all links below
How to attach SWD in case the device gets bricked or to erase flash and flash the complete bootloader incl. softdevice.
I found this XIAO BLE (Sense) bootloader bricked, how to restore it? (I had to remove the link. Search this forum yourself)
(What I did) You can use any Nordic dk. For example see chapter 4.11.2 Programming a board with custom connections of nRF7002_DK_User_Guide_v1.0.0.pdf (I had to remove the link. Google for yourself)
I did not use any Arduino code. So I do not know if there are issues.
Actually I cannot really make sense of this statement. “The Seeed nRF52 Boards version 1.1.3 and Seeed nRF52 mbed-enabled Boards version 2.9.2 have been tested and approved.”
Just a further note, in case you missed this in the documentation: Do not expect that you can read/write NFC. This is a NFC tag only.
I hope this help in getting the NFC feature work
The NFC function will perform well when we use the “Seeed nRF52 mbed-enabled Boards Library”.
I managed to replicate the Arduino example code in the Wiki using the “Seeed nRF52 mbed-enabled Boards Library” as stated and both antennas below:
Both worked right just after soldering without further circuit tuning. Later, I added two 43 pF caps from each NFC pad to GND to further enhance the interrogation distance for the TAOGLAS FXR.07.A.DG.
The ~40 pF cap value was calculated from subsection “6.14.10 NFCT antenna recommendations” in nRF52840 MCU product specification datasheet.
PS. Not sure why they mark these replies as spam - They’re not, just trying to help here…
Hi there,
They are not Spam, looks like a too quick to click with the Spam flag, the spam bombing the forum took.earlier.
Repost it as a topic Please , it’s good info for Xiao users here.
Thanks,
GL PJ
" Xiao NFC antenna info" or something. the "XIAO BLE NFC doesnt work " isn’t getting it LOL
Yeah, you’re right! Thanks for the suggestion.
Here is the new topic link for those interested: