NRF54L15 I2C Issue (I2C22)

Hello

I'm working on a custom electronics board with an nrf54L15 (QFAA). This MCU is interfaced with an EEPROM memory (24FC16T) via an I2C bus connected on P1.03(SCL) and P1.02(SDA).
I'm trying to use I2C22 instance to communicate with the eeprom memory currently without success.

When I try to read or write the eeprom, i2c functions return always error code -5.

I'm currently using SDK 3.0.1 with zephyr.

I added in my device tree the I2C22 enable and its pin mapping has follow :
#include <nordic/nrf54l15_cpuapp.dtsi>
...
&i2c22 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c22_default>;
pinctrl-1 = <&i2c22_sleep>;
pinctrl-names = "default", "sleep";
eeprom: eeprom@50 {
compatible = "i2c-device";
status = "okay";
reg = <0x50>;
};
};

&pinctrl {
i2c22_default: i2c22_default {
group1 {
psels = <NRF_PSEL(TWIM_SCL, 1, 3)>,
<NRF_PSEL(TWIM_SDA, 1, 2)>;
bias-pull-up;
};
};

i2c22_sleep: i2c22_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SCL, 1, 3)>,
<NRF_PSEL(TWIM_SDA, 1, 2)>;
low-power-enable;
bias-pull-up;
};
};
};
In the program, I retrieve the I2C22 node, check if it can be used and try to write data to memory as follow :
const struct i2c_dt_spec eeprom_i2c = I2C_DT_SPEC_GET(DT_NODELABEL(eeprom));
if (!device_is_ready(eeprom_i2c.bus)) {     // <-- Device is ready
	LOG_ERR("I2C bus %s is not ready!\n", eeprom_i2c.bus->name);
}

uint8_t tx[8] = {0x00};
uint8_t rx[8] = {0x00};

tx[0] = 0x12; //write start @ 0x12
tx[1] = 0x01; 
tx[2] = 0x23; 
tx[3] = 0x45; 
tx[4] = 0x67; 

int err;
err = i2c_write_dt(&eeprom_i2c, tx, 5);   // <-- always return -5
if(err < 0) {
	LOG_WRN("Fail to write EEPROM\n");
}
err = i2c_write_read_dt(&eeprom_i2c, tx, 1, rx, 4);     // <-- always return -5
if(err < 0) {
	LOG_WRN("Fail to read EEPROM\n");
}
The read and write functions always return -5

When I check signals with a scope, both SCL and SDA stay to Vcc.

When I check the exactly same code on I2C30 (SCL=P0.03 and SDA=P0.04) it's working (but don't match my board custom layout...)

Did I miss something in my configuration to make it work over I2C22?
Or, are there any limitations on the NRF54L15 that might prevent it from working over I2C22?

Thank you in advance, regards
Parents Reply
  • Abhijith, thanks for your reply.

    I followed the old DevZone thread and it solved the problem !

    As explained in this thread, by default pins P1.02 and P1.03 are routed to NFC functions, and it's necessary to add a directive in the device tree to specify that these pins must be used as standard GPIOs.

    This can be done by adding these lines in the device tree :

    &uicr {

          nfct-pins-as-gpios;

    };

    To test on the nrf54l15dk board, according the hardware shemes, it's necessary to mount 0ohm on R33/R34 and to unmount R21/R22.

    Kind regards,

    Thibaut

Children
No Data
Related