NRF54L10: I2C configuration error

Hello Team,

I'm using nrf54l15 dk and ncs version 2.9.0 for the development. I am getting an error while configuring I2C. I selected i2c20 from the device tree and assigned P1.00 for SCL and P1.01 for SDA. It generated the following code in the nrf54l15dk_nrf54l10_cpuapp.overlay file

&i2c20 {
	pinctrl-0 = <&i2c20_default>;
	pinctrl-names = "default";

};

&pinctrl {
	i2c20_default: i2c20_default {
		group1 {
			psels = <NRF_PSEL(TWIM_SDA, 1, 1)>, <NRF_PSEL(TWIM_SCL, 1, 0)>;
		};
	};
};

Added the following configuration in the prj.conf file

CONFIG_I2C=y
CONFIG_PINCTRL=y
And wrote the following code to initialize I2C
#define I2C_NODE        DT_NODELABEL(i2c20)
const struct device *const i2c_dev = DEVICE_DT_GET(I2C_NODE);
const uint16_t i2c_addr = 0x68;
const struct i2c_dt_spec *i2c_spec;

i2c_spec = I2C_DT_SPEC_GET(I2C_NODE);
I'm getting the following error
devicetree error: 'pinctrl-0' is marked as required in 'properties:' in C:/ncs/v2.9.0/zephyr/dts/bindings\i2c\nordic,nrf-twim.yaml, but does not appear in <Node /soc/peripheral@50000000/i2c@c6000 in 'C:/ncs/v2.9.0/zephyr/misc/empty_file.c'>
Kindly help me resolve the error.
Regards,
Payal
Parents
  • Hi,

     

    P1.00 / P1.01 is by default used for the external LFXO. If testing on a DK, you should choose other pins.

    I am testing blinky, with your proposed overlay file in ncs v2.9.0, and I am unable to see this issue when compiling for nrf54l15/nrf54l10/cpuapp.

     

    Have you done any board-related changes in the zephyr/boards/nordic/nrf54l15dk catalog? If yes, try reverting those.

     

    Kind regards,

    Håkon

  • Hi,

    I tried configuring P1.02 for SDA and P1.03 for SCL. Now I am getting the following error.

    CMake Error at C:/ncs/v2.9.0/zephyr/cmake/modules/FindDeprecated.cmake:40 (if):
    if given arguments:

    "CROSS_COMPILE" "IN_LIST" "Deprecated_FIND_COMPONENTS"

    I am testing blinky, with your proposed overlay file in ncs v2.9.0, and I am unable to see this issue when compiling for nrf54l15/nrf54l10/cpuapp.

    While compiling the blinky sample for nrf54l10, I didn't add the .overlay file, but still I was getting the error.

    Have you done any board-related changes in the zephyr/boards/nordic/nrf54l15dk catalog? If yes, try reverting those.

    No, I didn't change anything in the zephyr/boards/nordic/nrf54l15dk catalog.

    While compiling any of the sample codes for nrf54l10 (not including .overlay file), I am getting the "devicetree error: 'pinctrl-0' is marked as required in 'properties:' in C:/ncs/v2.9.0/zephyr/dts/bindings\i2c\nordic,nrf-twim.yaml, but does not appear in <Node /soc/peripheral@50000000/i2c@c6000 in 'C:/ncs/v2.9.0/zephyr/misc/empty_file.c'>" error

  • Hi,

     

    Could you please share the full build output?

     

    Kind regards,

    Håkon

  • Attached is the file for the complete

     *  Executing task: nRF Connect: Generate config nrf54l15dk/nrf54l10/cpuapp for c:\Payal\Project\Gas_meter\gas_meter_base_fw\Code_1\Code 
    
    Building Code
    C:\Windows\system32\cmd.exe /d /s /c "west build --build-dir c:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build_1 c:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code --pristine --board nrf54l15dk/nrf54l10/cpuapp -- -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=c:/payal/project/gas_meter/gas_meter_base_fw/code_1/code"
    
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: C:/ncs/toolchains/b620d30767/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v2.9.0/zephyr/.cache
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf54l15dk, qualifiers: nrf54l10/cpuapp
    Parsing C:/ncs/v2.9.0/zephyr/share/sysbuild/Kconfig
    Loaded configuration 'C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build_1/_sysbuild/empty.conf'
    Merged configuration 'c:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/sysbuild.conf'
    Configuration saved to 'C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build_1/zephyr/.config'
    Kconfig header saved to 'C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build_1/_sysbuild/autoconf.h'
    -- 
       *****************************
       * Running CMake for mcuboot *
       *****************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/b620d30767/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v2.9.0/zephyr/.cache
    -- Zephyr version: 3.7.99 (C:/ncs/v2.9.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf54l15dk, qualifiers: nrf54l10/cpuapp
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/b620d30767/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/b620d30767/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/b620d30767/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6") 
    -- Found BOARD.dts: C:/ncs/v2.9.0/zephyr/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp.dts
    -- Found devicetree overlay: C:/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/app.overlay
    devicetree error: 'pinctrl-0' is marked as required in 'properties:' in C:/ncs/v2.9.0/zephyr/dts/bindings\i2c\nordic,nrf-twim.yaml, but does not appear in <Node /soc/peripheral@50000000/i2c@c6000 in 'C:/ncs/v2.9.0/zephyr/misc/empty_file.c'>
    CMake Error at C:/ncs/v2.9.0/zephyr/cmake/modules/dts.cmake:295 (execute_process):
      execute_process failed command indexes:
    
        1: "Child return code: 1"
    
    Call Stack (most recent call first):
      C:/ncs/v2.9.0/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
      C:/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      C:/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:12 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
      CMake configure failed for Zephyr project: mcuboot
    
      Location: C:/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/
    Call Stack (most recent call first):
      cmake/modules/sysbuild_images.cmake:20 (ExternalZephyrProject_Cmake)
      cmake/modules/sysbuild_default.cmake:20 (include)
      C:/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      C:/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      C:/ncs/v2.9.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    See also "C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build_1/CMakeFiles/CMakeOutput.log".
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\b620d30767\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/b620d30767/opt/bin/python.exe '-Bc:\Payal\Project\Gas_meter\gas_meter_base_fw\Code_1\Code\build_1' -GNinja -DBOARD=nrf54l15dk/nrf54l10/cpuapp -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=c:/payal/project/gas_meter/gas_meter_base_fw/code_1/code '-SC:\ncs\v2.9.0\zephyr\share\sysbuild' '-DAPP_DIR:PATH=c:\Payal\Project\Gas_meter\gas_meter_base_fw\Code_1\Code'
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 
    
    error log

  • Hi,

     

    It looks like you have altered the mcuboot app.overlay file:

    ....
    -- Found devicetree overlay: C:/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/app.overlay
    devicetree error: 'pinctrl-0' is marked as required in 'properties:' in C:/ncs/v2.9.0/zephyr/dts/bindings\i2c\nordic,nrf-twim.yaml, but does not appear in <Node /soc/peripheral@50000000/i2c@c6000 in 'C:/ncs/v2.9.0/zephyr/misc/empty_file.c'>
    CMake Error at C:/ncs/v2.9.0/zephyr/cmake/modules/dts.cmake:295 (execute_process):
      execute_process failed command indexes:
      
    ....
    I would recommend that you revert the changes done in this file:

    Go to folder "C:/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/" and open a cmd line in this path, then write:

    git checkout app.overlay

     

    Kind regards,

    Håkon

  • Hi,

    Go to folder "C:/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/" and open a cmd line in this path, then write:

    git checkout app.overlay

    I tried this, but I still get the same error while compiling for nrf54l10.

Reply Children
  • Hi,

     

    That is strange.

    Q1: Is the issue due to path length on your end?

    Try using a shorter path, for instance c:\sdk\my_app

    Q2: are you using a custom board, since you always add mcuboot even for blinky?

     

    Kind regards,

    Håkon

  • Try using a shorter path, for instance c:\sdk\my_app

    Tried. Not working.

    Q2: are you using a custom board, since you always add mcuboot even for blinky?

    No.

  • Hi,

    Could you share the full blinky project that fails, including which board you configure towards?

     

    Kind regards,

    Håkon

  •  *  Executing task: nRF Connect: Build: Code/Code (active) 
    
    Building Code
    C:\Windows\system32\cmd.exe /d /s /c "west build --build-dir c:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build --domain Code"
    
    -- west build: building domain(s): Code
    [0/1] Re-running CMake...
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code
    -- CMake version: 3.21.0
    -- Cache files will be written to: C:/ncs/v2.9.0/zephyr/.cache
    -- Zephyr version: 3.7.99 (C:/ncs/v2.9.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf54l15dk, qualifiers: nrf54l10/cpuapp
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/b620d30767/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/b620d30767/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v2.9.0/zephyr/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp.dts
    -- Found devicetree overlay: C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/nrf54l15dk_nrf54l10_cpuapp.overlay
    unit address and first address in 'reg' (0x5004c000) don't match for /soc/peripheral@50000000/vpr@4c000/mailbox@1
    -- Generated zephyr.dts: C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/Code/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/Code/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/Code/zephyr/dts.cmake
    Parsing C:/ncs/v2.9.0/zephyr/Kconfig
    Loaded configuration 'C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/Code/zephyr/.config'
    Merged configuration 'C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/Code/zephyr/.config.sysbuild'
    No change to configuration in 'C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/Code/zephyr/.config'
    No change to Kconfig header in 'C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/Code/zephyr/include/generated/zephyr/autoconf.h'
    =========== Generating psa_crypto_config ===============
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Backup: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
    Backup: CONFIG_MBEDTLS_THREADING: False
    Backup: CONFIG_MBEDTLS_THREADING_ALT: True
    =========== Checkpoint: backup ===============
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Restore: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
    Restore: CONFIG_MBEDTLS_THREADING: False
    Restore: CONFIG_MBEDTLS_THREADING_ALT: True
    =========== End psa_crypto_config ===============
    =========== Generating psa_crypto_library_config ===============
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Backup: CONFIG_MBEDTLS_USE_PSA_CRYPTO: True
    Backup: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
    Backup: CONFIG_MBEDTLS_THREADING: False
    Backup: CONFIG_MBEDTLS_THREADING_ALT: True
    =========== Checkpoint: backup ===============
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Restore: CONFIG_MBEDTLS_USE_PSA_CRYPTO: True
    Restore: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
    Restore: CONFIG_MBEDTLS_THREADING: False
    Restore: CONFIG_MBEDTLS_THREADING_ALT: True
    =========== End psa_crypto_library_config ===============
    -- Including signing script: C:/ncs/v2.9.0/nrf/cmake/sysbuild/image_signing.cmake
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/Code
    [51/191] Building C object zephyr/drivers/i2c/CMakeFiles/drivers__i2c.dir/i2c_nrfx_twim.c.obj
    FAILED: zephyr/drivers/i2c/CMakeFiles/drivers__i2c.dir/i2c_nrfx_twim.c.obj 
    C:\ncs\toolchains\b620d30767\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DDEVELOP_IN_NRF54L15 -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"nrf-psa-crypto-config.h\" -DMBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE=\"nrf-psa-crypto-user-config.h\" -DNRF54L10_XXAA -DNRF_APPLICATION -DNRF_CONFIG_CPU_FREQ_MHZ=128 -DPICOLIBC_DOUBLE_PRINTF_SCANF -DUSE_PARTITION_MANAGER=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -IC:/ncs/v2.9.0/nrf/drivers/mpsl/clock_control -IC:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/Code/zephyr/include/generated/zephyr -IC:/ncs/v2.9.0/zephyr/include -IC:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/Code/zephyr/include/generated -IC:/ncs/v2.9.0/zephyr/soc/nordic -IC:/ncs/v2.9.0/zephyr/soc/nordic/nrf54l/. -IC:/ncs/v2.9.0/zephyr/soc/nordic/common/. -IC:/ncs/v2.9.0/zephyr/subsys/mgmt/mcumgr/util/include -IC:/ncs/v2.9.0/bootloader/mcuboot/boot/bootutil/include -IC:/ncs/v2.9.0/zephyr/subsys/mgmt/mcumgr/transport/include -IC:/ncs/v2.9.0/zephyr/subsys/bluetooth -IC:/ncs/v2.9.0/zephyr/subsys/settings/include -IC:/ncs/v2.9.0/nrf/include -IC:/ncs/v2.9.0/nrf/lib/multithreading_lock/. -IC:/ncs/v2.9.0/nrf/subsys/bluetooth/controller/. -IC:/ncs/v2.9.0/zephyr/drivers/flash -IC:/ncs/v2.9.0/nrf/tests/include -IC:/ncs/v2.9.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.9.0/zephyr/modules/cmsis/. -IC:/ncs/v2.9.0/modules/hal/nordic/nrfx -IC:/ncs/v2.9.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.9.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.9.0/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.9.0/modules/crypto/tinycrypt/lib/include -IC:/ncs/v2.9.0/modules/lib/zcbor/include -IC:/ncs/v2.9.0/nrfxlib/softdevice_controller/include -IC:/ncs/v2.9.0/nrfxlib/mpsl/fem/common/include -IC:/ncs/v2.9.0/nrfxlib/mpsl/fem/nrf21540_gpio/include -IC:/ncs/v2.9.0/nrfxlib/mpsl/fem/nrf21540_gpio_spi/include -IC:/ncs/v2.9.0/nrfxlib/mpsl/fem/nrf2220/include -IC:/ncs/v2.9.0/nrfxlib/mpsl/fem/nrf2240/include -IC:/ncs/v2.9.0/nrfxlib/mpsl/fem/nrf22xx/include -IC:/ncs/v2.9.0/nrfxlib/mpsl/fem/simple_gpio/include -IC:/ncs/v2.9.0/nrfxlib/mpsl/fem/include -IC:/ncs/v2.9.0/nrfxlib/mpsl/fem/include/protocol -IC:/ncs/v2.9.0/nrfxlib/mpsl/include -IC:/ncs/v2.9.0/nrfxlib/mpsl/include/protocol -IC:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/Code/generated/library_nrf_security_psa -IC:/ncs/v2.9.0/nrf/subsys/nrf_security/include -IC:/ncs/v2.9.0/nrf/subsys/nrf_security/src/threading/include -IC:/ncs/v2.9.0/nrf/subsys/nrf_security/src/utils -IC:/ncs/v2.9.0/nrf/subsys/nrf_security/src/drivers/cracen/common/include -IC:/ncs/v2.9.0/nrf/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include -IC:/ncs/v2.9.0/nrf/subsys/nrf_security/src/drivers/cracen/silexpk/target/baremetal_ba414e_with_ik -IC:/ncs/v2.9.0/nrf/subsys/nrf_security/src/drivers/cracen/silexpk/include -IC:/ncs/v2.9.0/nrf/subsys/nrf_security/src/drivers/cracen/sicrypto/include -IC:/ncs/v2.9.0/nrf/subsys/nrf_security/src/drivers/cracen/cracenpsa/include -IC:/ncs/v2.9.0/modules/crypto/oberon-psa-crypto/include -IC:/ncs/v2.9.0/modules/crypto/oberon-psa-crypto/library -IC:/ncs/v2.9.0/modules/crypto/mbedtls/library -IC:/ncs/v2.9.0/modules/crypto/mbedtls/include -IC:/ncs/v2.9.0/modules/crypto/mbedtls/include/library -IC:/ncs/v2.9.0/nrfxlib/crypto/nrf_oberon/include -isystem C:/ncs/v2.9.0/zephyr/lib/libc/common/include -Os -DNDEBUG -Wshadow -fno-strict-aliasing -Os -imacros C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/Code/zephyr/include/generated/zephyr/autoconf.h -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mfp16-format=ieee -mtp=soft --sysroot=C:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.9.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.9.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.9.0=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=picolibc.specs -std=c99 -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 C:/ncs/v2.9.0/zephyr/drivers/i2c/i2c_nrfx_twim.c
    In file included from C:/ncs/v2.9.0/zephyr/include/zephyr/toolchain.h:50,
                     from C:/ncs/v2.9.0/zephyr/include/zephyr/sys/__assert.h:11,
                     from C:/ncs/v2.9.0/zephyr/include/zephyr/irq_multilevel.h:15,
                     from C:/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:20,
                     from C:/ncs/v2.9.0/zephyr/include/zephyr/device.h:12,
                     from C:/ncs/v2.9.0/zephyr/include/zephyr/drivers/i2c.h:27,
                     from C:/ncs/v2.9.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:7:
    C:/ncs/v2.9.0/zephyr/include/zephyr/toolchain/gcc.h:87:36: error: static assertion failed: "/soc/peripheral@50000000/i2c@c7000 defined without sleep state"
       87 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert((EXPR), "" MSG)
          |                                    ^~~~~~~~~~~~~~
    c:\ncs\v2.9.0\zephyr\soc\nordic\common\soc_nrf_common.h:235:9: note: in expansion of macro 'BUILD_ASSERT'
      235 |         BUILD_ASSERT(!IS_ENABLED(CONFIG_PM_DEVICE) ||                          \
          |         ^~~~~~~~~~~~
    C:/ncs/v2.9.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:230:9: note: in expansion of macro 'NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP'
      230 |         NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx));                         \
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.9.0/zephyr/drivers/i2c/i2c_nrfx_twim.c:298:1: note: in expansion of macro 'I2C_NRFX_TWIM_DEVICE'
      298 | I2C_NRFX_TWIM_DEVICE(21);
          | ^~~~~~~~~~~~~~~~~~~~
    [56/191] Building C object zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\b620d30767\opt\bin\cmake.EXE' --build C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/Code
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 
    

    Hi,

    I tried reinstalling the NCS version 2.9.0, and now I can compile the samples for nrf54l10 without any errors.

    Now I want to configure I2C in my code, as you said, P1.00 and P1.01 are used for the external LFXO.

    P1.00 / P1.01 is by default used for the external LFXO. If testing on a DK, you should choose other pins.

    I configured P1.12 as SCL and P1.14 as SDA. Now I am getting the following error.

    C:/ncs/v2.9.0/zephyr/include/zephyr/toolchain/gcc.h:87:36: error: static assertion failed: "/soc/peripheral@50000000/i2c@c7000 defined without sleep state"
    87 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert((EXPR), "" MSG)

    The full error log file is attached.

    Can you help me resolve the error? Or how to configure I2C in NCS version 2.9.0?

    Thanks,

    Payal

  • Hi,

     

    Glad to hear that you got that sorted!

    Based on that build error message, it seems that there's defined a default and sleep pinctrl state, but not declared a sleep pinctrl entry.

     

    Here's a suggestion (feel free to change the pinout):

    &i2c20 {
    	status = "okay";
    	pinctrl-0 = <&i2c20_default>;
    	pinctrl-1 = <&i2c20_sleep>;
    	pinctrl-names = "default", "sleep";
    
    };
    
    &uart20 {
    	status = "disabled";
    };
    
    &pinctrl {
    	i2c20_default: i2c20_default {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 1, 11)>,
    				<NRF_PSEL(TWIM_SCL, 1, 12)>;
    		};
    	};
    
    	i2c20_sleep: i2c20_sleep {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 1, 11)>,
    				<NRF_PSEL(TWIM_SCL, 1, 12)>;
    			low-power-enable;
    		};
    	};
    };
    

     

    Kind regards,

    Håkon

Related