Some GPIO pins are not working on nRF52840 DK

I have a project that I need to use most of the GPIO pins available on the nRF52840 DK. I'm using SDK V17.

I'm writing a test program that toggles all GPIO pins on an nRF52840 DK. All GPIO pins are configured as outputs.I find out some of the GPIO pins are not toggling:

P0.0 P0.01 P0.06 P0.08 P0.09 P0.10

How do I make the above GPIO working?

Parents
  • Hello,

    The GPIOs you mention are hardwired to be used for XL1, XL2, UART TXD, RXD and NFC1 and NFC2, i.e you can't toggle them without modifications. See either the backside on the DK or in the DK datasheet https://docs.nordicsemi.com/bundle/ug_nrf52840_dk/page/UG/dk/intro.html.

    If you for instance want to use the NFC pins as GPIO you can do these suggestion (depending on board and SDK version):

    1. Device Tree Overlay:
      In NCS 3.0.0 and later, the recommended way to configure NFC pins as GPIOs is through the device tree overlay, not just Kconfig. For example, add the following to your board's overlay file:
      &uicr {
      nfct-pins-as-gpios;
      };
      This tells the system to configure the NFC pins for GPIO use instead of NFC functionality.

    2. prj.conf (for backward compatibility):
      You may still see references to CONFIG_NFCT_PINS_AS_GPIOS=y in some documentation or forum posts, but this method is deprecated in favor of the device tree approach in recent SDK versions, including 3.0.0. If you use only the Kconfig option, it may not be effective in NCS 3.0.0 and later [nRF54L15 disabling NFC].

    3. Board Hardware Modifications:
      On development kits, you may need to physically disconnect certain resistors and short others to fully disconnect the NFC antenna and enable GPIO functionality on those pins. The exact resistors depend on your DK and SoC. For example, on nRF52833 DK, you need to disconnect R44 and R46 and short R43 and R45 with 0Ω resistors [nRF52833 DK NFC interface].

    Kind regards,
    Andreas

Reply
  • Hello,

    The GPIOs you mention are hardwired to be used for XL1, XL2, UART TXD, RXD and NFC1 and NFC2, i.e you can't toggle them without modifications. See either the backside on the DK or in the DK datasheet https://docs.nordicsemi.com/bundle/ug_nrf52840_dk/page/UG/dk/intro.html.

    If you for instance want to use the NFC pins as GPIO you can do these suggestion (depending on board and SDK version):

    1. Device Tree Overlay:
      In NCS 3.0.0 and later, the recommended way to configure NFC pins as GPIOs is through the device tree overlay, not just Kconfig. For example, add the following to your board's overlay file:
      &uicr {
      nfct-pins-as-gpios;
      };
      This tells the system to configure the NFC pins for GPIO use instead of NFC functionality.

    2. prj.conf (for backward compatibility):
      You may still see references to CONFIG_NFCT_PINS_AS_GPIOS=y in some documentation or forum posts, but this method is deprecated in favor of the device tree approach in recent SDK versions, including 3.0.0. If you use only the Kconfig option, it may not be effective in NCS 3.0.0 and later [nRF54L15 disabling NFC].

    3. Board Hardware Modifications:
      On development kits, you may need to physically disconnect certain resistors and short others to fully disconnect the NFC antenna and enable GPIO functionality on those pins. The exact resistors depend on your DK and SoC. For example, on nRF52833 DK, you need to disconnect R44 and R46 and short R43 and R45 with 0Ω resistors [nRF52833 DK NFC interface].

    Kind regards,
    Andreas

Children
No Data
Related