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 Reply Children
  • 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

  • In addition, when I read the NFCPINS UICR register (0x00FF8028), I get the value 0xFFFFFFFE:

    nrfjprog --memrd 0x00FF8028
    0x00FF8028: FFFFFFFE
    

    which is the expected value for configuring the pins as GPIO instead of NFC.

    I don't knwon what I miss.

    Regards,

    Bruno

Related