NRF_CONFIG_NFCT_PINS_AS_GPIOS isn't defined

Hello everyone,

I'm working on an NRF54L15 DK evaluation board and I need to use NFCT pins as normal GPIOs. I found out here that I should define CONFIG_NFCT_PINS_AS_GPIOS=y in prj.conf in order to do so, but the solution isn't working.

By manually setting `NRF_NFCT_S->PADCONFIG = 0;` I was able to fix it, but digging a little deeper I realized that the part of the SystemInit that was supposed to do it for me wasn't executing because it depends on the symbol NRF_CONFIG_NFCT_PINS_AS_GPIOS, which isn't defined in my project. How come? It seems to be set by a CMake file in `modules/hal_nordic/nrfx/CMakeLists.txt` but it doesn't work for me.

Am I missing some kind of configuration option? I'm worried this may be a symptom of other problems.

Parents
  • Hi,

    You can find the NFCT pin configuration within the uirc node of the device tree. If you set the nfct-pins-as-gpios property to true, the program will configure these pins as GPIOs.

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

    Next, let's look at how the program writes this configuration to the PADCONFIG register after it's been set.

    The file ..\zephyr\modules\hal_nordic\nrfx\CMakeLists.txt contains the following code:

    dt_nodelabel(uicr_path NODELABEL "uicr")
    if(DEFINED uicr_path)
      dt_prop(nfct_pins_as_gpios PATH ${uicr_path} PROPERTY "nfct-pins-as-gpios")
      if(${nfct_pins_as_gpios})
        zephyr_library_compile_definitions(
          CONFIG_NFCT_PINS_AS_GPIOS
          NRF_CONFIG_NFCT_PINS_AS_GPIOS
        )
      endif()

    This code snippet checks the uicr node. If it exists and the nfct-pins-as-gpios property is set to true, it will define two configurations: CONFIG_NFCT_PINS_AS_GPIOS and NRF_CONFIG_NFCT_PINS_AS_GPIOS.

    Subsequently, the file ..\modules\hal\nordic\nrfx\mdk\system_nrf54l.c will have the following setting within the SystemInit() function:

    #if defined(NRF_CONFIG_NFCT_PINS_AS_GPIOS)
        NRF_NFCT_S->PADCONFIG = (NFCT_PADCONFIG_ENABLE_Disabled << NFCT_PADCONFIG_ENABLE_Pos);
    #endif

    Best Regards,

    Jesse

Reply
  • Hi,

    You can find the NFCT pin configuration within the uirc node of the device tree. If you set the nfct-pins-as-gpios property to true, the program will configure these pins as GPIOs.

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

    Next, let's look at how the program writes this configuration to the PADCONFIG register after it's been set.

    The file ..\zephyr\modules\hal_nordic\nrfx\CMakeLists.txt contains the following code:

    dt_nodelabel(uicr_path NODELABEL "uicr")
    if(DEFINED uicr_path)
      dt_prop(nfct_pins_as_gpios PATH ${uicr_path} PROPERTY "nfct-pins-as-gpios")
      if(${nfct_pins_as_gpios})
        zephyr_library_compile_definitions(
          CONFIG_NFCT_PINS_AS_GPIOS
          NRF_CONFIG_NFCT_PINS_AS_GPIOS
        )
      endif()

    This code snippet checks the uicr node. If it exists and the nfct-pins-as-gpios property is set to true, it will define two configurations: CONFIG_NFCT_PINS_AS_GPIOS and NRF_CONFIG_NFCT_PINS_AS_GPIOS.

    Subsequently, the file ..\modules\hal\nordic\nrfx\mdk\system_nrf54l.c will have the following setting within the SystemInit() function:

    #if defined(NRF_CONFIG_NFCT_PINS_AS_GPIOS)
        NRF_NFCT_S->PADCONFIG = (NFCT_PADCONFIG_ENABLE_Disabled << NFCT_PADCONFIG_ENABLE_Pos);
    #endif

    Best Regards,

    Jesse

Children
No Data
Related