'pin' is marked as deprecated in 'properties:'

I am migrating from nrfConnect 1.7.1 to 2.3.0 and am getting a number of build errors. I have a custom board definition for my product and in it we've obviously defined custom pins for the peripheral devices.

For example: uart0

&uart0 {
	status = "okay";
	compatible = "nordic,nrf-uarte";
	current-speed = <115200>;
	tx-pin = <20>;
	rx-pin = <19>;
};

When building, I get the following error:

'tx-pin' is marked as deprecated in 'properties:' in /opt/nordic/ncs/v2.3.0/zephyr/dts/bindings/serial/nordic,nrf-uarte.yaml for node /soc/uart@40002000.
'rx-pin' is marked as deprecated in 'properties:' in /opt/nordic/ncs/v2.3.0/zephyr/dts/bindings/serial/nordic,nrf-uarte.yaml for node /soc/uart@40002000.

I understand that I need to use `pincntrl-0: <>` instead. However, I have no idea what pinctrl expects. I keep getting an "unknown node" error. What can I reference? Is there a migration guide somewhere? 

I am guessing that it should look something like this: `pinctrl-0 = <&uart0_tx_pa20 &uart0_rx_pa19>;` but I have no idea. Any help is appreciated.

Parents
  • I have found the migration guide here: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/pin_control/index.html#ug-pinctrl

    But after following the instructions, I am now getting the following errors: 

    FAILED: zephyr/drivers/i2c/CMakeFiles/drivers__i2c.dir/i2c_nrfx_twim.c.obj 
    ccache /opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DNRF52832_XXAA -DUSE_PARTITION_MANAGER=1 -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -I/opt/nordic/ncs/v2.3.0/zephyr/include -Izephyr/include/generated -I/opt/nordic/ncs/v2.3.0/zephyr/soc/arm/nordic_nrf/nrf52 -I/opt/nordic/ncs/v2.3.0/zephyr/soc/arm/nordic_nrf/common/. -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/nrfx_glue -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/bluetooth -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/mgmt/mcumgr/util/include -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/mgmt/mcumgr/transport/include -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/settings/include -I/opt/nordic/ncs/v2.3.0/nrf/include -I/opt/nordic/ncs/v2.3.0/nrf/tests/include -I/opt/nordic/ncs/v2.3.0/modules/hal/cmsis/CMSIS/Core/Include -I/opt/nordic/ncs/v2.3.0/modules/hal/nordic/nrfx -I/opt/nordic/ncs/v2.3.0/modules/hal/nordic/nrfx/drivers/include -I/opt/nordic/ncs/v2.3.0/modules/hal/nordic/nrfx/mdk -I/opt/nordic/ncs/v2.3.0/zephyr/modules/hal_nordic/nrfx/. -I/opt/nordic/ncs/v2.3.0/modules/debug/segger/SEGGER -I/opt/nordic/ncs/v2.3.0/modules/debug/segger/Config -I/opt/nordic/ncs/v2.3.0/zephyr/modules/segger/. -I/opt/nordic/ncs/v2.3.0/modules/crypto/tinycrypt/lib/include -I/opt/nordic/ncs/v2.3.0/modules/lib/zcbor/include -I/opt/nordic/ncs/v2.3.0/nrfxlib/softdevice_controller/include -isystem /opt/nordic/ncs/v2.3.0/zephyr/lib/libc/minimal/include -isystem /opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/include -isystem /opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/include-fixed -fno-strict-aliasing -Os -imacros /Users/ericpietrowicz/Documents/work-projects/firmware-development/oslo_firmware/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=/opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/Users/ericpietrowicz/Documents/work-projects/firmware-development/oslo_firmware=CMAKE_SOURCE_DIR -fmacro-prefix-map=/opt/nordic/ncs/v2.3.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/opt/nordic/ncs/v2.3.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT zephyr/drivers/i2c/CMakeFiles/drivers__i2c.dir/i2c_nrfx_twim.c.obj -MF zephyr/drivers/i2c/CMakeFiles/drivers__i2c.dir/i2c_nrfx_twim.c.obj.d -o zephyr/drivers/i2c/CMakeFiles/drivers__i2c.dir/i2c_nrfx_twim.c.obj -c /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c
    In file included from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/toolchain.h:50,
                     from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/errno_private.h:10,
                     from /opt/nordic/ncs/v2.3.0/zephyr/lib/libc/minimal/include/errno.h:32,
                     from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/drivers/i2c.h:22,
                     from /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:8:
    /opt/nordic/ncs/v2.3.0/zephyr/soc/arm/nordic_nrf/common/soc_nrf_common.h:218:9: error: static assertion failed: "/soc/i2c@40003000 defined without required pin configuration"
      218 |         BUILD_ASSERT((IS_ENABLED(CONFIG_PINCTRL) &&                     \
          |         ^~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:419:9: note: in expansion of macro 'NRF_DT_CHECK_PIN_ASSIGNMENTS'
      419 |         NRF_DT_CHECK_PIN_ASSIGNMENTS(I2C(idx), 1, scl_pin, sda_pin);           \
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:462:1: note: in expansion of macro 'I2C_NRFX_TWIM_DEVICE'
      462 | I2C_NRFX_TWIM_DEVICE(0);
          | ^~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/soc/arm/nordic_nrf/common/soc_nrf_common.h:234:9: error: static assertion failed: "/soc/i2c@40003000 has pinctrl states defined although PINCTRL is not enabled"
      234 |         BUILD_ASSERT(IS_ENABLED(CONFIG_PINCTRL) ||                      \
          |         ^~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:419:9: note: in expansion of macro 'NRF_DT_CHECK_PIN_ASSIGNMENTS'
      419 |         NRF_DT_CHECK_PIN_ASSIGNMENTS(I2C(idx), 1, scl_pin, sda_pin);           \
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:462:1: note: in expansion of macro 'I2C_NRFX_TWIM_DEVICE'
      462 | I2C_NRFX_TWIM_DEVICE(0);
          | ^~~~~~~~~~~~~~~~~~~~
    In file included from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_macro.h:34,
                     from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util.h:17,
                     from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/devicetree.h:21,
                     from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/device.h:12,
                     from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/drivers/i2c.h:25:
    /Users/ericpietrowicz/Documents/work-projects/firmware-development/oslo_firmware/build/zephyr/include/generated/devicetree_generated.h:9393:37: error: 'DT_N_S_soc_S_i2c_40003000_P_scl_pin' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_i2c_40003000_P_status'?
     9393 | #define DT_N_NODELABEL_i2c0         DT_N_S_soc_S_i2c_40003000
          |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_internal.h:72:26: note: in definition of macro '__DEBRACKET'
       72 | #define __DEBRACKET(...) __VA_ARGS__
          |                          ^~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
       64 |         __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
          |         ^~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_internal.h:59:9: note: in expansion of macro '__COND_CODE'
       59 |         __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
          |         ^~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_macro.h:157:9: note: in expansion of macro 'Z_COND_CODE_1'
      157 |         Z_COND_CODE_1(_flag, _if_1_code, _else_code)
          |         ^~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:412:9: note: in expansion of macro 'COND_CODE_1'
      412 |         COND_CODE_1(CONFIG_PINCTRL,                     \
          |         ^~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/devicetree.h:607:32: note: in expansion of macro 'DT_CAT3'
      607 | #define DT_PROP(node_id, prop) DT_CAT3(node_id, _P_, prop)
          |                                ^~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:415:25: note: in expansion of macro 'DT_PROP'
      415 |                 (.scl = DT_PROP(I2C(idx), scl_pin),     \
          |                         ^~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/devicetree.h:3901:24: note: in expansion of macro 'DT_N_NODELABEL_i2c0'
     3901 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/devicetree.h:190:29: note: in expansion of macro 'DT_CAT'
      190 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
          |                             ^~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:394:18: note: in expansion of macro 'DT_NODELABEL'
      394 | #define I2C(idx) DT_NODELABEL(i2c##idx)
          |                  ^~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:415:33: note: in expansion of macro 'I2C'
      415 |                 (.scl = DT_PROP(I2C(idx), scl_pin),     \
          |                                 ^~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:442:25: note: in expansion of macro 'I2C_NRFX_TWIM_PIN_CFG'
      442 |                         I2C_NRFX_TWIM_PIN_CFG(idx)                             \
          |                         ^~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:462:1: note: in expansion of macro 'I2C_NRFX_TWIM_DEVICE'
      462 | I2C_NRFX_TWIM_DEVICE(0);
          | ^~~~~~~~~~~~~~~~~~~~
    /Users/ericpietrowicz/Documents/work-projects/firmware-development/oslo_firmware/build/zephyr/include/generated/devicetree_generated.h:9393:37: error: 'DT_N_S_soc_S_i2c_40003000_P_sda_pin' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_i2c_40003000_P_status'?
     9393 | #define DT_N_NODELABEL_i2c0         DT_N_S_soc_S_i2c_40003000
          |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_internal.h:72:26: note: in definition of macro '__DEBRACKET'
       72 | #define __DEBRACKET(...) __VA_ARGS__
          |                          ^~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
       64 |         __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
          |         ^~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_internal.h:59:9: note: in expansion of macro '__COND_CODE'
       59 |         __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
          |         ^~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_macro.h:157:9: note: in expansion of macro 'Z_COND_CODE_1'
      157 |         Z_COND_CODE_1(_flag, _if_1_code, _else_code)
          |         ^~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:412:9: note: in expansion of macro 'COND_CODE_1'
      412 |         COND_CODE_1(CONFIG_PINCTRL,                     \
          |         ^~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/devicetree.h:607:32: note: in expansion of macro 'DT_CAT3'
      607 | #define DT_PROP(node_id, prop) DT_CAT3(node_id, _P_, prop)
          |                                ^~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:416:25: note: in expansion of macro 'DT_PROP'
      416 |                  .sda = DT_PROP(I2C(idx), sda_pin),))
          |                         ^~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/devicetree.h:3901:24: note: in expansion of macro 'DT_N_NODELABEL_i2c0'
     3901 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/devicetree.h:190:29: note: in expansion of macro 'DT_CAT'
      190 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
          |                             ^~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:394:18: note: in expansion of macro 'DT_NODELABEL'
      394 | #define I2C(idx) DT_NODELABEL(i2c##idx)
          |                  ^~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:416:33: note: in expansion of macro 'I2C'
      416 |                  .sda = DT_PROP(I2C(idx), sda_pin),))
          |                                 ^~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:442:25: note: in expansion of macro 'I2C_NRFX_TWIM_PIN_CFG'
      442 |                         I2C_NRFX_TWIM_PIN_CFG(idx)                             \
          |                         ^~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:462:1: note: in expansion of macro 'I2C_NRFX_TWIM_DEVICE'
      462 | I2C_NRFX_TWIM_DEVICE(0);
          | ^~~~~~~~~~~~~~~~~~~~
    [78/351] Building C object zephyr/drivers/sensor/lis2dh/CMakeFiles/drivers__sensor__lis2dh.dir/lis2dh.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/v2.3.0/bin/cmake --build /Users/ericpietrowicz/Documents/work-projects/firmware-development/oslo_firmware/build


    Here is my pinctrl.dtsi configuration: 

    // https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/pin_control/index.html#ug-pinctrl
    &pinctrl {
    	uart0_default: uart0_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 20)>, <NRF_PSEL(UART_RX, 0, 19)>;
    		};
    	};
        uart0_sleep: uart0_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 20)>, <NRF_PSEL(UART_RX, 0, 19)>;
    		};
    	};
        i2c0_default: i2c0_default {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 0, 7)>, <NRF_PSEL(TWIM_SCL, 0, 8)>;
    		};
    	};
        i2c0_sleep: i2c0_sleep {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 0, 7)>, <NRF_PSEL(TWIM_SCL, 0, 8)>;
    		};
    	};
    };
     

Reply
  • I have found the migration guide here: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/pin_control/index.html#ug-pinctrl

    But after following the instructions, I am now getting the following errors: 

    FAILED: zephyr/drivers/i2c/CMakeFiles/drivers__i2c.dir/i2c_nrfx_twim.c.obj 
    ccache /opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DNRF52832_XXAA -DUSE_PARTITION_MANAGER=1 -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -I/opt/nordic/ncs/v2.3.0/zephyr/include -Izephyr/include/generated -I/opt/nordic/ncs/v2.3.0/zephyr/soc/arm/nordic_nrf/nrf52 -I/opt/nordic/ncs/v2.3.0/zephyr/soc/arm/nordic_nrf/common/. -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/nrfx_glue -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/bluetooth -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/mgmt/mcumgr/util/include -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/mgmt/mcumgr/transport/include -I/opt/nordic/ncs/v2.3.0/zephyr/subsys/settings/include -I/opt/nordic/ncs/v2.3.0/nrf/include -I/opt/nordic/ncs/v2.3.0/nrf/tests/include -I/opt/nordic/ncs/v2.3.0/modules/hal/cmsis/CMSIS/Core/Include -I/opt/nordic/ncs/v2.3.0/modules/hal/nordic/nrfx -I/opt/nordic/ncs/v2.3.0/modules/hal/nordic/nrfx/drivers/include -I/opt/nordic/ncs/v2.3.0/modules/hal/nordic/nrfx/mdk -I/opt/nordic/ncs/v2.3.0/zephyr/modules/hal_nordic/nrfx/. -I/opt/nordic/ncs/v2.3.0/modules/debug/segger/SEGGER -I/opt/nordic/ncs/v2.3.0/modules/debug/segger/Config -I/opt/nordic/ncs/v2.3.0/zephyr/modules/segger/. -I/opt/nordic/ncs/v2.3.0/modules/crypto/tinycrypt/lib/include -I/opt/nordic/ncs/v2.3.0/modules/lib/zcbor/include -I/opt/nordic/ncs/v2.3.0/nrfxlib/softdevice_controller/include -isystem /opt/nordic/ncs/v2.3.0/zephyr/lib/libc/minimal/include -isystem /opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/include -isystem /opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/include-fixed -fno-strict-aliasing -Os -imacros /Users/ericpietrowicz/Documents/work-projects/firmware-development/oslo_firmware/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=/opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/Users/ericpietrowicz/Documents/work-projects/firmware-development/oslo_firmware=CMAKE_SOURCE_DIR -fmacro-prefix-map=/opt/nordic/ncs/v2.3.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/opt/nordic/ncs/v2.3.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT zephyr/drivers/i2c/CMakeFiles/drivers__i2c.dir/i2c_nrfx_twim.c.obj -MF zephyr/drivers/i2c/CMakeFiles/drivers__i2c.dir/i2c_nrfx_twim.c.obj.d -o zephyr/drivers/i2c/CMakeFiles/drivers__i2c.dir/i2c_nrfx_twim.c.obj -c /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c
    In file included from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/toolchain.h:50,
                     from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/errno_private.h:10,
                     from /opt/nordic/ncs/v2.3.0/zephyr/lib/libc/minimal/include/errno.h:32,
                     from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/drivers/i2c.h:22,
                     from /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:8:
    /opt/nordic/ncs/v2.3.0/zephyr/soc/arm/nordic_nrf/common/soc_nrf_common.h:218:9: error: static assertion failed: "/soc/i2c@40003000 defined without required pin configuration"
      218 |         BUILD_ASSERT((IS_ENABLED(CONFIG_PINCTRL) &&                     \
          |         ^~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:419:9: note: in expansion of macro 'NRF_DT_CHECK_PIN_ASSIGNMENTS'
      419 |         NRF_DT_CHECK_PIN_ASSIGNMENTS(I2C(idx), 1, scl_pin, sda_pin);           \
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:462:1: note: in expansion of macro 'I2C_NRFX_TWIM_DEVICE'
      462 | I2C_NRFX_TWIM_DEVICE(0);
          | ^~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/soc/arm/nordic_nrf/common/soc_nrf_common.h:234:9: error: static assertion failed: "/soc/i2c@40003000 has pinctrl states defined although PINCTRL is not enabled"
      234 |         BUILD_ASSERT(IS_ENABLED(CONFIG_PINCTRL) ||                      \
          |         ^~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:419:9: note: in expansion of macro 'NRF_DT_CHECK_PIN_ASSIGNMENTS'
      419 |         NRF_DT_CHECK_PIN_ASSIGNMENTS(I2C(idx), 1, scl_pin, sda_pin);           \
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:462:1: note: in expansion of macro 'I2C_NRFX_TWIM_DEVICE'
      462 | I2C_NRFX_TWIM_DEVICE(0);
          | ^~~~~~~~~~~~~~~~~~~~
    In file included from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_macro.h:34,
                     from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util.h:17,
                     from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/devicetree.h:21,
                     from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/device.h:12,
                     from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/drivers/i2c.h:25:
    /Users/ericpietrowicz/Documents/work-projects/firmware-development/oslo_firmware/build/zephyr/include/generated/devicetree_generated.h:9393:37: error: 'DT_N_S_soc_S_i2c_40003000_P_scl_pin' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_i2c_40003000_P_status'?
     9393 | #define DT_N_NODELABEL_i2c0         DT_N_S_soc_S_i2c_40003000
          |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_internal.h:72:26: note: in definition of macro '__DEBRACKET'
       72 | #define __DEBRACKET(...) __VA_ARGS__
          |                          ^~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
       64 |         __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
          |         ^~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_internal.h:59:9: note: in expansion of macro '__COND_CODE'
       59 |         __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
          |         ^~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_macro.h:157:9: note: in expansion of macro 'Z_COND_CODE_1'
      157 |         Z_COND_CODE_1(_flag, _if_1_code, _else_code)
          |         ^~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:412:9: note: in expansion of macro 'COND_CODE_1'
      412 |         COND_CODE_1(CONFIG_PINCTRL,                     \
          |         ^~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/devicetree.h:607:32: note: in expansion of macro 'DT_CAT3'
      607 | #define DT_PROP(node_id, prop) DT_CAT3(node_id, _P_, prop)
          |                                ^~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:415:25: note: in expansion of macro 'DT_PROP'
      415 |                 (.scl = DT_PROP(I2C(idx), scl_pin),     \
          |                         ^~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/devicetree.h:3901:24: note: in expansion of macro 'DT_N_NODELABEL_i2c0'
     3901 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/devicetree.h:190:29: note: in expansion of macro 'DT_CAT'
      190 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
          |                             ^~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:394:18: note: in expansion of macro 'DT_NODELABEL'
      394 | #define I2C(idx) DT_NODELABEL(i2c##idx)
          |                  ^~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:415:33: note: in expansion of macro 'I2C'
      415 |                 (.scl = DT_PROP(I2C(idx), scl_pin),     \
          |                                 ^~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:442:25: note: in expansion of macro 'I2C_NRFX_TWIM_PIN_CFG'
      442 |                         I2C_NRFX_TWIM_PIN_CFG(idx)                             \
          |                         ^~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:462:1: note: in expansion of macro 'I2C_NRFX_TWIM_DEVICE'
      462 | I2C_NRFX_TWIM_DEVICE(0);
          | ^~~~~~~~~~~~~~~~~~~~
    /Users/ericpietrowicz/Documents/work-projects/firmware-development/oslo_firmware/build/zephyr/include/generated/devicetree_generated.h:9393:37: error: 'DT_N_S_soc_S_i2c_40003000_P_sda_pin' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_i2c_40003000_P_status'?
     9393 | #define DT_N_NODELABEL_i2c0         DT_N_S_soc_S_i2c_40003000
          |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_internal.h:72:26: note: in definition of macro '__DEBRACKET'
       72 | #define __DEBRACKET(...) __VA_ARGS__
          |                          ^~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
       64 |         __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
          |         ^~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_internal.h:59:9: note: in expansion of macro '__COND_CODE'
       59 |         __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
          |         ^~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/util_macro.h:157:9: note: in expansion of macro 'Z_COND_CODE_1'
      157 |         Z_COND_CODE_1(_flag, _if_1_code, _else_code)
          |         ^~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:412:9: note: in expansion of macro 'COND_CODE_1'
      412 |         COND_CODE_1(CONFIG_PINCTRL,                     \
          |         ^~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/devicetree.h:607:32: note: in expansion of macro 'DT_CAT3'
      607 | #define DT_PROP(node_id, prop) DT_CAT3(node_id, _P_, prop)
          |                                ^~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:416:25: note: in expansion of macro 'DT_PROP'
      416 |                  .sda = DT_PROP(I2C(idx), sda_pin),))
          |                         ^~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/devicetree.h:3901:24: note: in expansion of macro 'DT_N_NODELABEL_i2c0'
     3901 | #define DT_CAT(a1, a2) a1 ## a2
          |                        ^~
    /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/devicetree.h:190:29: note: in expansion of macro 'DT_CAT'
      190 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
          |                             ^~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:394:18: note: in expansion of macro 'DT_NODELABEL'
      394 | #define I2C(idx) DT_NODELABEL(i2c##idx)
          |                  ^~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:416:33: note: in expansion of macro 'I2C'
      416 |                  .sda = DT_PROP(I2C(idx), sda_pin),))
          |                                 ^~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:442:25: note: in expansion of macro 'I2C_NRFX_TWIM_PIN_CFG'
      442 |                         I2C_NRFX_TWIM_PIN_CFG(idx)                             \
          |                         ^~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:462:1: note: in expansion of macro 'I2C_NRFX_TWIM_DEVICE'
      462 | I2C_NRFX_TWIM_DEVICE(0);
          | ^~~~~~~~~~~~~~~~~~~~
    [78/351] Building C object zephyr/drivers/sensor/lis2dh/CMakeFiles/drivers__sensor__lis2dh.dir/lis2dh.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/v2.3.0/bin/cmake --build /Users/ericpietrowicz/Documents/work-projects/firmware-development/oslo_firmware/build


    Here is my pinctrl.dtsi configuration: 

    // https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/pin_control/index.html#ug-pinctrl
    &pinctrl {
    	uart0_default: uart0_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 20)>, <NRF_PSEL(UART_RX, 0, 19)>;
    		};
    	};
        uart0_sleep: uart0_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 20)>, <NRF_PSEL(UART_RX, 0, 19)>;
    		};
    	};
        i2c0_default: i2c0_default {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 0, 7)>, <NRF_PSEL(TWIM_SCL, 0, 8)>;
    		};
    	};
        i2c0_sleep: i2c0_sleep {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 0, 7)>, <NRF_PSEL(TWIM_SCL, 0, 8)>;
    		};
    	};
    };
     

Children
  • Hi,

    You also need to enable pinctrl in configs. In the defconfig file of the custom board, add CONFIG_PINCTRL=y.

    Your pinctrl.dtsi file looks correct. Did you also add the pinctrl nodes to the UART and I2C nodes? They should be added to the node like this:

    &uart0 {
    	status = "okay";
    	compatible = "nordic,nrf-uarte";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart0_default>;
    	pinctrl-1 = <&uart0_sleep>;
    	pinctrl-names = "default", "sleep";
    };

    Best regards,
    Marte

  • Hi Marte, thank you for your quick response. I added CONFIG_PINCTRL=y to my prj.conf file and am still facing the same error. 

    I can also confirm my what my uart0 node in the .dts file looks like: 


    &uart0 {
    	status = "okay";
    	compatible = "nordic,nrf-uarte";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart0_default>;
    	pinctrl-1 = <&uart0_sleep>;
    	pinctrl-names = "default", "sleep";
    };


    Error output

    In file included from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/toolchain.h:50,
                     from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/sys/errno_private.h:10,
                     from /opt/nordic/ncs/v2.3.0/zephyr/lib/libc/minimal/include/errno.h:32,
                     from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/drivers/uart.h:23,
                     from /opt/nordic/ncs/v2.3.0/zephyr/drivers/serial/uart_nrfx_uarte.c:11:
    /opt/nordic/ncs/v2.3.0/zephyr/soc/arm/nordic_nrf/common/soc_nrf_common.h:218:9: error: static assertion failed: "/soc/uart@40002000 defined without required pin configuration"
      218 |         BUILD_ASSERT((IS_ENABLED(CONFIG_PINCTRL) &&                     \
          |         ^~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/serial/uart_nrfx_uarte.c:2076:9: note: in expansion of macro 'NRF_DT_CHECK_PIN_ASSIGNMENTS'
     2076 |         NRF_DT_CHECK_PIN_ASSIGNMENTS(UARTE(idx), 1,                            \
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/serial/uart_nrfx_uarte.c:2181:1: note: in expansion of macro 'UART_NRF_UARTE_DEVICE'
     2181 | UART_NRF_UARTE_DEVICE(0);
          | ^~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/soc/arm/nordic_nrf/common/soc_nrf_common.h:234:9: error: static assertion failed: "/soc/uart@40002000 has pinctrl states defined although PINCTRL is not enabled"
      234 |         BUILD_ASSERT(IS_ENABLED(CONFIG_PINCTRL) ||                      \
          |         ^~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/serial/uart_nrfx_uarte.c:2076:9: note: in expansion of macro 'NRF_DT_CHECK_PIN_ASSIGNMENTS'
     2076 |         NRF_DT_CHECK_PIN_ASSIGNMENTS(UARTE(idx), 1,                            \
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.3.0/zephyr/drivers/serial/uart_nrfx_uarte.c:2181:1: note: in expansion of macro 'UART_NRF_UARTE_DEVICE'
     2181 | UART_NRF_UARTE_DEVICE(0);
          | ^~~~~~~~~~~~~~~~~~~~~

    Although, I'm noticing that the error is just complaining about the UART driver, these changes seem to resolve I2C errors. 

    Any ideas?

  • It seems to be complaining that the PIN_CTRL configuration is not enabled. But In build ./build/zephyr/.config file I clearly see 

    CONFIG_PINCTRL=y

    as well as other PINCTRL related configurations:

    CONFIG_DT_HAS_NORDIC_NRF_PINCTRL_ENABLED=y
    CONFIG_PINCTRL_STORE_REG=y
    CONFIG_PINCTRL_NRF=y
    I've tried deleting the build folder and running pristine builds. I'm not sure what I'm missing. 
  • Okay, I figured it out. For some reason adding CONFIG_PINCTRL=y to the root .prj file did not work.

    However, adding CONFIG_PINCTRL=y to the defconfig file in your ./boards/arm/customboard/customboard_defconfig file fixes it.

    Here is what I used as a reference: 

    github.com/.../adafruit_feather_nrf52840_defconfig

  • Hi,

    I was having the same issue with a little different error.  It looked like in the PINCTRL Driver that the common.c routine was not getting compiled.  This was causing a couple of routines to not be resolved and getting a build error.  With CONFIG_PINCTRL=y set in proj.conf it should have been built.  But, as you commented above, putting that in the proj.conf did not appear to work.  That was recommended to me as well, although I had already tried that as a result of looking in the CMakeLists.txt.

    Luckily, I saw your post of finding a hint by putting it in the device tree defconfig file and that did that trick for me as well.

    So thanks for your digging into this. It would be good to know why it isn't working when put in the proj.conf file like you would think it should.

    Thanks again,

    h.

Related