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,

     

    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

  • Hi,

    Tried your suggestion. I got the following error.

    devicetree error: pinctrl-names property in /soc/peripheral@50000000/i2c@c7000 in C:/ncs/v2.9.0/zephyr/misc/empty_file.c has 2 strings, expected 1 strings
    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"

    Executing task: nRF Connect: Build [pristine]: Code/build 
    
    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 c:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code --pristine --board nrf54l15dk/nrf54l10/cpuapp --sysbuild -- -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/_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/zephyr/.config'
    Kconfig header saved to 'C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/_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
    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/mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/mcuboot/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/mcuboot/zephyr/dts.cmake
    
    warning: NRF_RTC_TIMER_USER_CHAN_COUNT (defined at
    C:/ncs/v2.9.0/zephyr/soc/nordic\nrf53\Kconfig.sync_rtc:23, drivers/timer/Kconfig.nrf_rtc:20) was
    assigned the value '0' but got the value ''. Check these unsatisfied dependencies: ((NRF53_SYNC_RTC
    && SOC_SERIES_NRF53X && SOC_FAMILY_NORDIC_NRF) || (NRF_RTC_TIMER && SYS_CLOCK_EXISTS)) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT and/or look
    up NRF_RTC_TIMER_USER_CHAN_COUNT in the menuconfig/guiconfig interface. The Application Development
    Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual
    might be helpful too.
    
    Parsing C:/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v2.9.0/zephyr/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_defconfig'
    Merged configuration 'C:/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/prj.conf'
    Merged configuration 'C:/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/boards/nrf54l15dk_nrf54l10_cpuapp.conf'
    Merged configuration 'C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/mcuboot/zephyr/.config.sysbuild'
    Configuration saved to 'C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/mcuboot/zephyr/.config'
    Kconfig header saved to 'C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/mcuboot/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Setting build type to 'MinSizeRel' as none was specified.
    MCUBoot bootloader key file: C:/ncs/v2.9.0/bootloader/mcuboot/root-rsa-2048.pem
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/build/mcuboot
    -- 
       **************************
       * Running CMake for Code *
       **************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code
    -- 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:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code/nrf54l15dk_nrf54l10_cpuapp.overlay
    devicetree error: pinctrl-names property in /soc/peripheral@50000000/i2c@c7000 in C:/ncs/v2.9.0/zephyr/misc/empty_file.c has 2 strings, expected 1 strings
    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:4 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
      CMake configure failed for Zephyr project: Code
    
      Location: C:/Payal/Project/Gas_meter/gas_meter_base_fw/Code_1/Code
    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/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' -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. 
    

  • Hi,

     

    And how does your .overlay file look now?

    It seems that you're lacking the pinctrl-1 entry, based on the error message.

     

    Kind regards,

    Håkon

  • Hi,

    It seems that you're lacking the pinctrl-1 entry, based on the error message.

    Yes, the pinctrl-1 entry was missing; adding it successfully compiled my code.

    Thanks for the help.

    I have one doubt when I configured P1.12 and P1.14 for SDA and SCL, in devicetree.

    Only the code below is generated in my .overlayfile

    &pinctrl {
        i2c21_default: i2c21_default {
            group1 {
                psels = <NRF_PSEL(TWIM_SCL, 1, 12)>, <NRF_PSEL(TWIM_SDA, 1, 14)>;
            };
        };
    };
    
    &i2c21 {
        status = "okay";
        pinctrl-0 = <&i2c21_default>;
        pinctrl-names = "default";
        zephyr,deferred-init;
    };

    Can you help me understand why pincntrl-1 entry code and 

    i2c20_sleep: i2c20_sleep {
    group1 {
    psels = <NRF_PSEL(TWIM_SDA, 1, 11)>,
    <NRF_PSEL(TWIM_SCL, 1, 12)>;
    low-power-enable;
    };
    };

    is not generated?

    Are there any additional settings for this?

    Thanks,

    Payal

  • Hi,

     

    You are currently using i2c21 and not i2c20, so this entry will not be used:

    payalD said:
    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

Reply Children
Related