NRF5340 PCF8574 with i2c

Hello,

I am using the nRF5340DK and the PCF8574 with I2C communication. The issue I am encountering is that the function device_is_ready(pcf8574.bus) fails to initialize the I2C bus, causing my program to hang at this point with the message: "I2C device not ready".

I have attached the files I am using for reference. I have also double-checked the hardware wiring, and it is correct.

Could you please help me identify what might be causing this problem?

Thank you in advance for your assistance.

overlay : 

 

&i2c1 {
compatible = "nordic,nrf-twim";
status = "okay";
pinctrl-0 = <&i2c1_default>;
pinctrl-1 = <&i2c1_sleep>;
clock-frequency = <I2C_BITRATE_FAST>;
pinctrl-names = "default""sleep";

pcf8574: pcf8574@21 {
compatible = "i2c-device";
status = "okay";
label = "PCF8574";
reg = <0x21>;
};
};

&pinctrl {
/omit-if-no-ref/ i2c1_defaulti2c1_default {
group1 {
psels = <NRF_PSEL(TWIM_SCL, 1, 14)>,
<NRF_PSEL(TWIM_SDA, 1, 15)>;
};
};
/omit-if-no-ref/ i2c1_sleepi2c1_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SCL, 1, 14)>,
<NRF_PSEL(TWIM_SDA, 1, 15)>;
low-power-enable;
};
};
};
.c : 
 
&i2c1 {
compatible = "nordic,nrf-twim";
status = "okay";
pinctrl-0 = <&i2c1_default>;
pinctrl-1 = <&i2c1_sleep>;
clock-frequency = <I2C_BITRATE_FAST>;
pinctrl-names = "default""sleep";

pcf8574: pcf8574@21 {
compatible = "i2c-device";
status = "okay";
label = "PCF8574";
reg = <0x21>;
};
};

&pinctrl {
/omit-if-no-ref/ i2c1_defaulti2c1_default {
group1 {
psels = <NRF_PSEL(TWIM_SCL, 1, 14)>,
<NRF_PSEL(TWIM_SDA, 1, 15)>;
};
};
/omit-if-no-ref/ i2c1_sleepi2c1_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SCL, 1, 14)>,
<NRF_PSEL(TWIM_SDA, 1, 15)>;
low-power-enable;
};
};
};
prf.conf : 
   
 
# Logging
CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=n
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=y

# Segger RTT
CONFIG_USE_SEGGER_RTT=y

CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_PRINTK=y

CONFIG_I2C=y
CONFIG_GPIO=y
CONFIG_ASSERT=y
CONFIG_I2C_LOG_LEVEL_DBG=y

CONFIG_I2C_GPIO=y
Related