nRF54L15 - NFCT Pins as GPIO with TF-M

Good day,

I'm trying to use pin 1.02 as a GPIO in a TF-M build using a (custom) non-secure board target, and I'm struggling to find the appropriate way to accomplish this. 

All current resources point to deprecated Kconfig defines (USE_NFCT_PINS_AS_GPIO), do not support non-secure targets (uisng the &uicr node in devicetree), are for older SoCs (

TFM_NFCT_PINS_AS_GPIOS only applies to nRF5340 according to v2.9.0 SDK). The only working option I've found is to edit the NFCT PADCONFIG register (which worked); are there any other options?

Thank you
Kind regards,
Mark Laloo
  • Hi Justin,

    No problem. I too agree that choosing a less special pin is the best way forward. Would also limit the amount of change necessary if one day in the future, NFC is considered.

    Please just let me know if the issue becomes bothersome again in the future.

    -----------------------

    Hi Mark,

    If the issue is blocking your project, please let me know.

    Best regards,

    Hieu

  • Hi Hieu,
    I am trying to use P1.02 and P1.03 as PWM outputs on a custom board that I developed. Now I am running into the same issue, that disabling NFC does not release these two GPIOs. As I need 8 Analog inputs and 7 analog outputs I used all GPIOs from P1 and cannot simply change the PIN. Could you please assist me in solving that issue?
    Do you have any news from the DeviceTree team working on this?

    Thank you in advance!

    Best regards,

    Walter

  • Hi Hieu,

    I was able to fix the issue by deleting the PADCONFIG bit manually like suggested by you. I used:

    static int disable_nfc_pads_early(const struct device *unused)
    {
        ARG_UNUSED(unused);
    
        /* Clear the PADCONFIG bit so the NFC pads stop being forced to NFC */
        NRF_NFCT_NS->PADCONFIG = 0;   /* Use NRF_NFCT_NS if called from non-secure */
        return 0;
    }
    
    /* Run before GPIO and pinctrl take effect */
    SYS_INIT(disable_nfc_pads_early, PRE_KERNEL_1, 0);

    Br

    Walter

Related