This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NFC example not working

Hello,

I am running the NFC example applicaiotn(URI Message Example) in SDK5 v11.0.0. I am using a PCA10040(V1.1.1) dev board with the NFC antenna connected to it and testing against an NFC-enabled Android phone(SONY ZR) with NXP TagInfo App installed.

I followed steps at link text, but couldn't observe that LED 1 is lit and of course URL "www.nordicsemi.com" was not opened on SmartPhone and TagInfo showed nothing. The results were the same with running other NFC examples.

I've retried the same test on another PCA10040(V0.9.0)dev board with another NFC antenna to temporarily exclude the hardware issue. Also I've checked the CLOCK_ENABLED is 1 in nrf_drv_config.h as nrf_drv_config.h

Some information for device is as below:

-Softdevice s132 with firmware S132_nRF52_2.0.0

-Nordicsemi nRF5 SDK v11.0.0

-PATH: \examples\nfc\record_url\pca10040\arm5_no_packs

So, any ideas would be great appreciated!!!

Moreover, how to enable the NFC_HAL log as in link text

Thanks

Parents
  • First of all, the example you mentioned is meant to work without SoftDevice. It is not possible to flash this example (when compiled with default settings from SDK) on a device with SoftDevice programmed before. To enable UART logs, configure NRF_LOG_USES_UART=1, for RTT logs, configure NRF_LOG_USES_RTT=1 (global defines) in project options.

Reply
  • First of all, the example you mentioned is meant to work without SoftDevice. It is not possible to flash this example (when compiled with default settings from SDK) on a device with SoftDevice programmed before. To enable UART logs, configure NRF_LOG_USES_UART=1, for RTT logs, configure NRF_LOG_USES_RTT=1 (global defines) in project options.

Children
  • Thank you for your prompt reply. It's really helpful! After erasing all partitions and only programming \examples\nfc\record_url\hex\nfc_url_record_pca10040.hex, it works! And then I try to change URL within the \record_url\main.c . Rebuild(Keil uVersion V5.17.0.0) and program again, but nfc couldn't work as before. What I observe is the nrf52832_xxaa.hex(user build?) I build and flash is generated in \examples\nfc\record_url\pca10040\arm5_no_packs_build, whereas the nfc_url_record_pca10040.hex(official build?) mentioned above is in \examples\nfc\record_url\hex\ , but the imgae size is the same. So is there any other configuration that I need to setup? Sorry, I'm really not familiar with Nordic solution!

  • Spent much time finally worked it out.

    1. If I want to modify \record_url\main.c file and build my own .hex file, I have to flash not only nrf52832_xxaa.hex but also softdevice.hex. But why? Can I have a explanation? Thanks!

    2. According to link text, NRF_LOG_USES_RTT=1 does also work for me. I finally can observe the logs on RTT viewer, but ENABLE_DEBUG_LOG_SUPPORT or NRF_LOG_USES_UART=1 still didn't get anything via Tera Term...

  • My comments on the 2 points above:

    1. The hex file located in examples\nfc\record_url\hex is a precompiled one - ready to program. If you want to modify the example, you need to rebuild the project (either Keil5 or 4, IAR or gcc) located in examples\nfc\record_url\pca10040. The hex will be generated by the tool in e.g. arm5_no_packs_build. What you need to do is just flash it without SoftDevice. SoftDevice is not used in this example.
    2. NRF_LOG_USES_UART=1 should be enough to enable logs (works for me). Maybe check your serial terminal setup (baudrate = 115200, other settings should be default, 8 data bits, 1 stop bit, no parity)
  • It's weird because every time I repeated running the modified nfc example with or without SoftDevice, I always use Nordic nRFgo Studio to see whether or not there's SoftDevice. And as I tested, the modified NFC example couldn't work without SoftDevice...lol

    My steps:

    Test 1(modified NFC URL example without SoftDevice)

    -Erase all using nRFgo Studio

    -Program nrf52832_xxaa.hex using nRFgo Studio

    -Touch the NFC antenna with the NFC-enabled smartphone

    -Result: Not working

    Test 2(modified NFC URL example with SoftDevice)

    -Erase all using nRFgo Studio

    -Program SoftDevice.hex using nRFgo Studio

    -Program nrf52832_xxaa.hex using nRFgo Studio

    -Touch the NFC antenna with the NFC-enabled smartphone

    -Result: Working

  • Very weird... Which nRFgo Studio version are you using? For me v1.21.0.2 works - without SoftDevice if you program the hex file (regardless if from the hex folder or built from my project) it works. Just use "Program Application" tab

Related