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

Taiyo Yuden EYSHJNZXZ (nRF52832) cannot use NFC pins as GPIO

I am having trouble using GPIO P0_9 and P0_10 as GPIO pins. These are the pins designated as NFC1 and NFC2.

I am using the following sample code:

#include <stdbool.h>
#include <stdint.h>
#include "nrf_delay.h"
#include "boards.h"

/**
 * @brief Function for application main entry.
 */
int main(void)
{
    nrf_gpio_cfg_output(9);
    nrf_gpio_cfg_output(10);

    while (true)
    {
    nrf_gpio_pin_toggle(9);
    nrf_gpio_pin_toggle(10);
    nrf_delay_ms(500);
    }
}

I have confirmed that UICR 0x20C is set to 0xFFFFFFFE:

sh-3.2# nrfjprog --memrd 0x1000120c --family nrf52
0x1000120C: FFFFFFFE                              |....|

I can use any other pin for GPIO, except P0_9 and P0_10. Any insights as to what is going on, would be greatly appreciated.

  • Have you searched the forum, e.g. this question? The UICR settings is one thing but there could be some HW components on board. What the vendor says?

  • set CONFIG_NFCT_PINS_AS_GPIOS as a define in the Preprocessor Symbols in Keil

  • I discovered that the issue was actually a module alignment issue on the PCB. After throwing the board back into the reflow oven, the outputs started working. My bad. For anyone stumbling onto this question and using the NRF52832 / NRF52_DK with MBED-CLI, the targets.json file needs to be modified in order to include the CONFIG_NFCT_PINS_AS_GPIOS define, as Daniel hinted to above:

    "NRF52_DK": {
            "supported_form_factors": ["ARDUINO"],
            "inherits": ["MCU_NRF52"],
            "macros_add": ["BOARD_PCA10040", "NRF52_PAN_12", "NRF52_PAN_15", "NRF52_PAN_58", "NRF52_PAN_55", "NRF52_PAN_54", "NRF52_PAN_31", "NRF52_PAN_30", "NRF52_PAN_51", "NRF52_PAN_36", "NRF52_PAN_53", "S132", "CONFIG_NFCT_PINS_AS_GPIOS", "BLE_STACK_SUPPORT_REQD", "SWI_DISABLE0", "NRF52_PAN_20", "NRF52_PAN_64", "NRF52_PAN_62", "NRF52_PAN_63"],
            "device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE"],
            "release_versions": ["2", "5"],
            "device_name": "nRF52832_xxAA"
        },
    
  • I actually found the issue (see my comment above). The Taiyo Yuden module includes a 32MHz crystal and a few capacitors under the hood and has a built-in Bluetooth antenna. It is a fully certified module. It does not have a 32kHz crystal, but the GPIO9/10 pins are exposed directly from the nrf52832 chip, so nothing unexpected.

Related