NRF5340: How to configure P0.02 and P0.03 (NFCT) as GPIO?

Hello,

We are working with the nRF5340DK using nRF Connect SDK v2.9.1.
Our firmware targets the nrf5340dk_nrf5340_cpuapp_ns board.

We would like to use P0.02 and P0.03 as GPIOs, specifically as UART2 RX and TX.
From what I have read (for example, here: nRF5340: best way to configure P0.02 (NFCT) as GPIO with TFM ), it seems that no special configuration is required—these pins should be usable as UART pins by simply configuring them in the device tree.

However, while I can successfully configure and use other pins as UART, when I assign P0.02 and P0.03, I am not able to send or receive any data.

Is there any additional configuration required to use these two pins as UART?

Regards,
Bruno

Parents
  • Hello,

    You need to use a devicetree overlay to configure the NFCT pins as GPIOs. Please try the following overlay file:

    &uicr {
    nfct-pins-as-gpios;
    };

    See this devzone case as a reference.

    Kind Regards,

    Abhijith

  • Hello Abhijith,

    Thanks for your quick reply. 

    As explained in the link in my previous post, the symbol uicr is not known in the nrf5340dk_nrf5340_cpuapp_ns target.

    I've already tried this solution before, but here is the compile log output:

    Found devicetree overlay: /Users/nono/Documents/git/firmware/app.overlay
    devicetree error: /Users/Nono/Documents/git/firmware/app.overlay:23 (column 1): parse error: undefined node label 'uicr'
    CMake Error at /Users/Nono/Documents/git/firmware/zephyr/cmake/modules/dts.cmake:295 (execute_process):
      execute_process failed command indexes:
    
        1: "Child return code: 1"

    Regards,

    Bruno

Reply
  • Hello Abhijith,

    Thanks for your quick reply. 

    As explained in the link in my previous post, the symbol uicr is not known in the nrf5340dk_nrf5340_cpuapp_ns target.

    I've already tried this solution before, but here is the compile log output:

    Found devicetree overlay: /Users/nono/Documents/git/firmware/app.overlay
    devicetree error: /Users/Nono/Documents/git/firmware/app.overlay:23 (column 1): parse error: undefined node label 'uicr'
    CMake Error at /Users/Nono/Documents/git/firmware/zephyr/cmake/modules/dts.cmake:295 (execute_process):
      execute_process failed command indexes:
    
        1: "Child return code: 1"

    Regards,

    Bruno

Children
Related