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

Wake-on-NFC for PCA10059 (Dongle)

Hi,

I am no programmer, but I wanted to try the Wake-on-NFC example on the 52840 dongle (I soldered an NFC flex on pins P0.09 and P0.10). I have downloaded SES and nRF SDK 16.0.0. As there is no such example for the PCA10059 board I took the example for PCA10056 and changed the board setting to BOARD_PCA10059. Everything fine so far, links to board.c seems ok pointing to correct board. I am unsure if I need to do anything more in the code, but I tried to build and that went ok. Then when I try to progam the hex using the nRFConnect I get  specified sdReq does not match current SoftDevice. Googling I found that the softdevice need to be programmed as well. Trying around I think I got it to work by first programming the softdevice (which seems to be version S140 v 7.0.1, 0xCA), then clearing the hex and adding the application hex and then specifying 0xCA in the "custom field" of the list of soft devices that comes up (v7.0.1 is not listed). That seems to work, is that the correct procedure? I attached the log.

2020-03-13T14:26:25.692Z INFO Application data folder: C:\Users\xyz\AppData\Roaming\nrfconnect\pc-nrfconnect-programmer
2020-03-13T14:26:25.918Z DEBUG App pc-nrfconnect-programmer v1.3.1 official
2020-03-13T14:26:25.919Z DEBUG App path: C:\Users\xyz\.nrfconnect-apps\node_modules\pc-nrfconnect-programmer
2020-03-13T14:26:25.919Z DEBUG nRFConnect 3.3.0 is supported by the app (^3.3.0)
2020-03-13T14:26:25.919Z DEBUG nRFConnect path: C:\Users\xyz\AppData\Local\Programs\nrfconnect\resources\app.asar
2020-03-13T14:26:25.920Z DEBUG HomeDir: C:\Users\xyz
2020-03-13T14:26:25.920Z DEBUG TmpDir: C:\Users\xyz~1\AppData\Local\Temp
2020-03-13T14:26:25.978Z INFO Using nrfjprog library 10.5.0, pc-nrfjprog-js 1.6.0
2020-03-13T14:26:32.509Z INFO Using USB SDFU protocol to communicate with target
2020-03-13T14:26:32.543Z INFO Protocol Version:  1 found
2020-03-13T14:26:32.546Z INFO Hardware: 52840 found
2020-03-13T14:26:32.551Z INFO Firmware: Bootloader found
2020-03-13T14:26:32.551Z INFO Firmware: Application found
2020-03-13T14:26:40.365Z INFO Parsing HEX file:  C:\Projects\Nordic_files\nRF5_SDK_16.0.0_98a08e2\components\softdevice\s140\hex\s140_nrf52_7.0.1_softdevice.hex
2020-03-13T14:26:40.388Z INFO File was last modified at  8/28/2019, 4:02:28 PM
2020-03-13T14:26:40.517Z INFO Data block: 0x00000000-0x00000B00 (0x00000B00  bytes long)
2020-03-13T14:26:40.517Z INFO Data block: 0x00001000-0x00026598 (0x00025598  bytes long)
2020-03-13T14:26:40.521Z INFO SoftDevice detected, id 0xCA (S140 v7.0.1)
2020-03-13T14:26:43.422Z INFO Does not need to be reloaded:  C:\Projects\Nordic_files\nRF5_SDK_16.0.0_98a08e2\components\softdevice\s140\hex\s140_nrf52_7.0.1_softdevice.hex
2020-03-13T14:26:43.427Z INFO SdReq for SoftDevice is set as 0x00.
2020-03-13T14:26:43.429Z INFO Hash is generated by SHA256
2020-03-13T14:26:43.431Z INFO Performing DFU. This may take a few seconds
2020-03-13T14:26:43.457Z INFO DFU procedure starts. This may take a few seconds.
2020-03-13T14:26:51.970Z INFO DFU for SoftDevice completed successfully!
2020-03-13T14:26:51.971Z INFO 0 dfu package(s) left.
2020-03-13T14:26:51.971Z INFO Waiting for device
2020-03-13T14:26:52.980Z INFO All dfu images have been written to the target device.
2020-03-13T14:26:52.981Z INFO Using USB SDFU protocol to communicate with target
2020-03-13T14:26:52.988Z INFO Protocol Version:  1 found
2020-03-13T14:26:52.990Z INFO Hardware: 52840 found
2020-03-13T14:26:52.996Z INFO Firmware: Bootloader found
2020-03-13T14:26:52.996Z INFO Firmware: SoftDevice found
2020-03-13T14:26:53.014Z INFO SoftDevice detected, id 0xCA (S140 v7.0.1)
2020-03-13T14:27:00.161Z INFO Parsing HEX file:  C:\Projects\Nordic_files\nRF5_SDK_16.0.0_98a08e2\examples\nfc\wake_on_nfc\pca10059_custom\blank\ses\Output\Release\Exe\wake_on_nfc_pca10059_custom.hex
2020-03-13T14:27:00.161Z INFO File was last modified at  3/13/2020, 1:06:58 PM
2020-03-13T14:27:00.194Z INFO Data block: 0x00000000-0x00003A06 (0x00003A06  bytes long)
2020-03-13T14:27:00.195Z INFO Data block: 0x00003A08-0x00003ECA (0x000004C2  bytes long)
2020-03-13T14:27:00.195Z INFO Data block: 0x00003ECC-0x00003F08 (0x0000003C  bytes long)
2020-03-13T14:27:10.718Z INFO Does not need to be reloaded:  C:\Projects\Nordic_files\nRF5_SDK_16.0.0_98a08e2\examples\nfc\wake_on_nfc\pca10059_custom\blank\ses\Output\Release\Exe\wake_on_nfc_pca10059_custom.hex
2020-03-13T14:27:10.721Z INFO Hash is generated by SHA256
2020-03-13T14:27:21.122Z INFO Performing DFU. This may take a few seconds
2020-03-13T14:27:21.128Z INFO DFU procedure starts. This may take a few seconds.
2020-03-13T14:27:23.445Z INFO DFU for Application completed successfully!
2020-03-13T14:27:23.445Z INFO 0 dfu package(s) left.
2020-03-13T14:27:23.445Z INFO Waiting for device
2020-03-13T14:27:28.447Z ERROR Reopen device failed: Timeout while waiting for device  D35164D87A24 to be attached and enumerated
2020-03-13T14:27:28.448Z INFO Nordic DFU Trigger Interface was not found.Please physically reset device.
2020-03-13T14:27:28.452Z ERROR Device not found due to failure during DFU
2020-03-13T14:27:28.464Z INFO Target device closed.

Then we have the slight problem that the wake-on-nfc hack does not seem to work. No LEDs are lit after programming (or after pressing the larger white button, I assume BTN_ID_SLEEP 0 is this button) and the dongle does not respond to NFC. Any suggestions? As above, I copied the 10056 wake-on-nfc project and just changed the board to BOARD_PCA10059 by editing the wake_on_nfc_...emProject file in an editor.

Regards,

Peter

  • Hi Peter

    Have you tuned the NFC antenna at all? Please check out our NFC antenna tuning whitepaper, as the NFC antenna can't be expected to just work by soldering the antenna itself onto the P0.09 and P0.10 pins.

    Other than that, your procedure seems correct. To avoid confusion, the nRFConnect programmer can have both the  SoftDevice file and the application file in the file layout at once and you can flash them onto the Dongle with one action instead of two separate "flashing actions"

    Best regards,

    Simon

  • Hi Simon,

    Yes, the NFC antenna is tuned. I put a 150pF capacitor across its terminals, should be good enough, it is what you use on the 10056 board. I don't expect it to differ much on the 10059. From the SDK example documentation, there should be some LEDs blinking when running the wake-on-NFC example, but I don't get that so I guess there is something more to it. I'll try to run the example on the 10056 board as well. By the way, I tried by using NFC Tools app on my phone, I guess no special app is needed?

    /Peter

  • Hi

    The reason LEDs aren't blinking on your Dongle is that the Dongle and DK have different configurations to the LED(s) and button(s). Try changing the configurations to make the button and LED on the Dongle be the ones used instead of the ones on the DK. You can see the difference in pin configurations on the HW files found here for the DK, and here for the Dongle.

    There is also no guarantee that the same tuning components that work on the DK will work on the Dongle as well as the form factor is so very different. Please see the tuning whitepaper for details on how to tune your device.

    Best regards,

    Simon

  • Hi,

    But the buttons/leds are configured in the boards.h => pca10059.h files. Seems to be generic, i.e. since BOARD_PCA10059 is defined the proper pins are set up for buttons/leds for the dongle, or am I wrong? Selecting PCA10059 also enables the 3V GPIO levels if I am not mistaken. 

    For the antenna I use the Nordic supplied NFC antenna and the same type of connector. Since this is 13MHz I think some differences in line lengths on the PCB is negligible.

    /Peter

  • Hi

    Keep in mind that the Dongle has way fewer buttons and LEDs than the DK (1 of each instead of 4), so in order to have any button/LED functionality, you need to make sure that the ones in the example go to the pins you expect them to.

    Have you confirmed that the Dongle is emitting 13.56MHz with your current setup? I'm not so sure that it will just by using the same capacitors and antenna as the DK is.

    Best regards,

    Simon

Related