This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I2C burst write for nRF5340 fails

I2C burst write for nRF5340 at 100kHz is failing with a reply of -5.   (Trying to use the BMI270 drivers sample, it will fail during reg_write of the configuration file)

Reading works. with nRF5340. I can read the Chip ID correctly. 

Same code on nRF52480 works perfectly. (Read and write). 

Parents
  • Hello Samuel,

    one difference between those two devices is that the nRF5340 is using TWIM drivers while the nRF52840 is using TWI drivers. TWIM has a hardware limitation which results in burst writes not all sensors are supporting. You can read more about this here. There is also a similar case in DevZone.

    A good starting point could be to add the concat-buf-size attribute in an overlay file and check if that makes any differences. Below you can see an example of the attribute usage:

    /*
     * Copyright (c) 2021 Bosch Sensortec GmbH
     *
     * SPDX-License-Identifier: Apache-2.0
     */
    &arduino_i2c {
        status = "okay";
        zephyr,concat-buf-size = <128>;
        bmi270@68 {
            compatible = "bosch,bmi270";
            reg = <0x68>;
            label = "BMI270";
        };
    };

    I hope this will help you!

    Regards,

    Markus

Reply
  • Hello Samuel,

    one difference between those two devices is that the nRF5340 is using TWIM drivers while the nRF52840 is using TWI drivers. TWIM has a hardware limitation which results in burst writes not all sensors are supporting. You can read more about this here. There is also a similar case in DevZone.

    A good starting point could be to add the concat-buf-size attribute in an overlay file and check if that makes any differences. Below you can see an example of the attribute usage:

    /*
     * Copyright (c) 2021 Bosch Sensortec GmbH
     *
     * SPDX-License-Identifier: Apache-2.0
     */
    &arduino_i2c {
        status = "okay";
        zephyr,concat-buf-size = <128>;
        bmi270@68 {
            compatible = "bosch,bmi270";
            reg = <0x68>;
            label = "BMI270";
        };
    };

    I hope this will help you!

    Regards,

    Markus

Children
Related