ICM20948 integration with zephyr and BLE (without ble working fine)

Hi, I am using custom board. i am facing issue when i am integrating with ble we are facing issue that i2c stopped working. event we are not able to read(scan) slave address.  

&i2c1 {
	status = "ok";
	compatible = "nordic,nrf-twim";
	sda-pin = < 21 >;
	scl-pin = < 19 >;
    clock-frequency = <I2C_BITRATE_STANDARD>;  
};

&i2c2 {
	status = "ok";
	compatible = "nordic,nrf-twim";
	sda-pin = < 32 >;
	scl-pin = < 33 >;
    clock-frequency = <I2C_BITRATE_STANDARD>;
    zephyr,concat-buf-size = <256>;	
};

&i2c3 {
	status = "ok";
	compatible = "nordic,nrf-twim";
	sda-pin = < 34 >;
	scl-pin = < 35 >;
    clock-frequency = <I2C_BITRATE_STANDARD>;  
};

# nothing here

## Print on Segger IDE console
CONFIG_STDOUT_CONSOLE=y
CONFIG_PRINTK=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_UART_CONSOLE=n

#CONFIG_LOG=y
#CONFIG_LOG_DEFAULT_LEVEL=4
#CONFIG_DEBUG_OPTIMIZATIONS=y
#CONFIG_LOG_PRINTK=y

# Segger RTT
#CONFIG_USE_SEGGER_RTT=y
#CONFIG_RTT_CONSOLE=y
#CONFIG_UART_CONSOLE=n
#CONFIG_LOG_BACKEND_RTT=y
#CONFIG_LOG_BACKEND_UART=n
#
#CONFIG_ASSERT=y
#CONFIG_STACK_SENTINEL=y
#CONFIG_LOG_PROCESS_THREAD=y


# I2C enable
CONFIG_I2C=y


# GPIO enable
CONFIG_GPIO=y

#SPI flash


CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_DEBUG=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_FLASH_PAGE_LAYOUT=y

CONFIG_FPU=y
CONFIG_FP_HARDABI=y
CONFIG_NEWLIB_LIBC=y
CONFIG_IDLE_STACK_SIZE=4096

my Pins and .conf file si attached above.

when i am debugging things i found I2C communication is going slower.

Parents
  • Hi,

    Have you written the driver for ICM20948 yourself, or are you using an existing driver? Can you post/link to the source code of the driver, and how you use it in your application?

    What is the IRQ priority for the I2C/TWI peripheral that you use?

    Best regards,
    Jørgen

  • We had not change any thing ...

    below is i2c initialize code

    const struct device *i2c_dev;
    const struct device *i2c_dev2;
    const struct device *i2c_dev3;
    
    int I2C_Driver_Init()
    {
      i2c_dev =  device_get_binding("I2C_1");
    
      if (!i2c_dev)
      {
          printk("Binding failed I2C_1.");
          return 0;
      }
    
      i2c_dev2 =  device_get_binding("I2C_2");
      
      if (!i2c_dev2)
      {
      	printk("Binding failed I2C_2.");
      	return 0;
      }
      
      i2c_dev3 =  device_get_binding("I2C_3");
      
      if (!i2c_dev3)
      {
          printk("Binding failed I2C_3.");
          return 0;
      }
      
      return 0;
    }

    &i2c2 {
    status = "ok";
    compatible = "nordic,nrf-twim";
    sda-pin = < 32 >;
    scl-pin = < 33 >;
    clock-frequency = <I2C_BITRATE_STANDARD>;
    zephyr,concat-buf-size = <256>;
    };
    
    

    I2c 2 we are using.

    we had ported code provided by invensense it is working fine when we are not using ble bluetooth\peripheral_ht code. when we integrate it i2c3 only working other things stop working

Reply
  • We had not change any thing ...

    below is i2c initialize code

    const struct device *i2c_dev;
    const struct device *i2c_dev2;
    const struct device *i2c_dev3;
    
    int I2C_Driver_Init()
    {
      i2c_dev =  device_get_binding("I2C_1");
    
      if (!i2c_dev)
      {
          printk("Binding failed I2C_1.");
          return 0;
      }
    
      i2c_dev2 =  device_get_binding("I2C_2");
      
      if (!i2c_dev2)
      {
      	printk("Binding failed I2C_2.");
      	return 0;
      }
      
      i2c_dev3 =  device_get_binding("I2C_3");
      
      if (!i2c_dev3)
      {
          printk("Binding failed I2C_3.");
          return 0;
      }
      
      return 0;
    }

    &i2c2 {
    status = "ok";
    compatible = "nordic,nrf-twim";
    sda-pin = < 32 >;
    scl-pin = < 33 >;
    clock-frequency = <I2C_BITRATE_STANDARD>;
    zephyr,concat-buf-size = <256>;
    };
    
    

    I2c 2 we are using.

    we had ported code provided by invensense it is working fine when we are not using ble bluetooth\peripheral_ht code. when we integrate it i2c3 only working other things stop working

Children
No Data
Related