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
  • Hello,

    Could you share the complete log here? If you haven’t enabled debug-level logs, please try enabling them and then share the full output. See the configuration option CONFIG_I2C_LOG_LEVEL_DBG.

    Is this a custom board or a Development Kit (DK)? Also, could you share the zephyr.dts file from the build folder?

    Kind regards,
    Abhijith

  • Abhijith, thanks for your reply.

    Here the log. Even with CONFIG_I2C_LOG_LEVEL_DBG=y they are nothing that appears in logs about I2C

    *** Booting nRF Connect SDK v3.0.1-9eb5615da66b ***
    *** Using Zephyr OS v4.0.99-77f865b8f8d0 ***
    
    [00:00:06.613,090] <dbg> AniTrack: main: Test log debug level
    [00:00:10.024,711] <inf> AniTrack: Testing ACC
    [00:00:10.024,743] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200026e0 - rx_bufs 0x200026f0 - 1
    [00:00:10.024,753] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x200026d8 (1), current_rx 0x200026e8 (1), tx buf/len 0x200026d0/2, rx buf/len 0x200026d4/2
    [00:00:10.024,793] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:10.024,801] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0
    [00:00:10.024,808] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:10.024,827] <inf> AniTrack: Requested WHO AM I, received : 69
    [00:00:10.024,832] <inf> AniTrack: ACC is responding !
    [00:00:10.024,837] <inf> AniTrack: Testing FLASH
    [00:00:10.024,851] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200026e0 - rx_bufs 0x200026f0 - 1
    [00:00:10.024,870] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x200026d8 (1), current_rx 0x200026e8 (1), tx buf/len 0x200026d0/4, rx buf/len 0x200026d4/4
    [00:00:10.024,924] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:10.024,931] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0
    [00:00:10.024,938] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:10.024,958] <inf> AniTrack: Requested WHO AM I, received : 44 37
    [00:00:10.024,963] <inf> AniTrack: FLASH is responding !
    [00:00:10.024,968] <inf> AniTrack: Testing EEPROM
    [00:00:10.024,972] <inf> AniTrack: Writting EEPROM
    [00:00:10.525,138] <inf> AniTrack: result : -5
    [00:00:10.525,153] <wrn> AniTrack: Fail to write EEPROM
    [00:00:10.936,546] <inf> AniTrack: Testing ACC
    [00:00:10.936,556] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200026e0 - rx_bufs 0x200026f0 - 1
    [00:00:10.936,565] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x200026d8 (1), current_rx 0x200026e8 (1), tx buf/len 0x200026d0/2, rx buf/len 0x200026d4/2
    [00:00:10.936,605] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:10.936,613] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0
    [00:00:10.936,621] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:10.936,639] <inf> AniTrack: Requested WHO AM I, received : 69
    [00:00:10.936,644] <inf> AniTrack: ACC is responding !
    [00:00:10.936,658] <inf> AniTrack: Testing FLASH
    [00:00:10.936,667] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200026e0 - rx_bufs 0x200026f0 - 1
    [00:00:10.936,676] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x200026d8 (1), current_rx 0x200026e8 (1), tx buf/len 0x200026d0/4, rx buf/len 0x200026d4/4
    [00:00:10.936,729] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:10.936,737] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0
    [00:00:10.936,743] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:10.936,763] <inf> AniTrack: Requested WHO AM I, received : 44 37
    [00:00:10.936,768] <inf> AniTrack: FLASH is responding !
    [00:00:10.936,773] <inf> AniTrack: Testing EEPROM
    [00:00:10.936,777] <inf> AniTrack: Reading EEPROM
    [00:00:11.436,946] <inf> AniTrack: result : -5
    [00:00:11.436,962] <wrn> AniTrack: Fail to read EEPROM

    This is a custom board. I also tried to run my code on the nrf54l15dk board and I get the same behavior. They are no I2C signals on P1.03(SCL) and P1.02(SDA).

     

    Please, find bellow the zephyr.dts file that was generated for my custom board.

    8228.zephyr.dts

    Kind regards,

    Thibaut

Reply
  • Abhijith, thanks for your reply.

    Here the log. Even with CONFIG_I2C_LOG_LEVEL_DBG=y they are nothing that appears in logs about I2C

    *** Booting nRF Connect SDK v3.0.1-9eb5615da66b ***
    *** Using Zephyr OS v4.0.99-77f865b8f8d0 ***
    
    [00:00:06.613,090] <dbg> AniTrack: main: Test log debug level
    [00:00:10.024,711] <inf> AniTrack: Testing ACC
    [00:00:10.024,743] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200026e0 - rx_bufs 0x200026f0 - 1
    [00:00:10.024,753] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x200026d8 (1), current_rx 0x200026e8 (1), tx buf/len 0x200026d0/2, rx buf/len 0x200026d4/2
    [00:00:10.024,793] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:10.024,801] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0
    [00:00:10.024,808] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:10.024,827] <inf> AniTrack: Requested WHO AM I, received : 69
    [00:00:10.024,832] <inf> AniTrack: ACC is responding !
    [00:00:10.024,837] <inf> AniTrack: Testing FLASH
    [00:00:10.024,851] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200026e0 - rx_bufs 0x200026f0 - 1
    [00:00:10.024,870] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x200026d8 (1), current_rx 0x200026e8 (1), tx buf/len 0x200026d0/4, rx buf/len 0x200026d4/4
    [00:00:10.024,924] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:10.024,931] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0
    [00:00:10.024,938] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:10.024,958] <inf> AniTrack: Requested WHO AM I, received : 44 37
    [00:00:10.024,963] <inf> AniTrack: FLASH is responding !
    [00:00:10.024,968] <inf> AniTrack: Testing EEPROM
    [00:00:10.024,972] <inf> AniTrack: Writting EEPROM
    [00:00:10.525,138] <inf> AniTrack: result : -5
    [00:00:10.525,153] <wrn> AniTrack: Fail to write EEPROM
    [00:00:10.936,546] <inf> AniTrack: Testing ACC
    [00:00:10.936,556] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200026e0 - rx_bufs 0x200026f0 - 1
    [00:00:10.936,565] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x200026d8 (1), current_rx 0x200026e8 (1), tx buf/len 0x200026d0/2, rx buf/len 0x200026d4/2
    [00:00:10.936,605] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:10.936,613] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0
    [00:00:10.936,621] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:10.936,639] <inf> AniTrack: Requested WHO AM I, received : 69
    [00:00:10.936,644] <inf> AniTrack: ACC is responding !
    [00:00:10.936,658] <inf> AniTrack: Testing FLASH
    [00:00:10.936,667] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200026e0 - rx_bufs 0x200026f0 - 1
    [00:00:10.936,676] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x200026d8 (1), current_rx 0x200026e8 (1), tx buf/len 0x200026d0/4, rx buf/len 0x200026d4/4
    [00:00:10.936,729] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:10.936,737] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0
    [00:00:10.936,743] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:10.936,763] <inf> AniTrack: Requested WHO AM I, received : 44 37
    [00:00:10.936,768] <inf> AniTrack: FLASH is responding !
    [00:00:10.936,773] <inf> AniTrack: Testing EEPROM
    [00:00:10.936,777] <inf> AniTrack: Reading EEPROM
    [00:00:11.436,946] <inf> AniTrack: result : -5
    [00:00:11.436,962] <wrn> AniTrack: Fail to read EEPROM

    This is a custom board. I also tried to run my code on the nrf54l15dk board and I get the same behavior. They are no I2C signals on P1.03(SCL) and P1.02(SDA).

     

    Please, find bellow the zephyr.dts file that was generated for my custom board.

    8228.zephyr.dts

    Kind regards,

    Thibaut

Children
No Data
Related