nrf5340dk net core connects sensor through i2c

Hello,

I'm now using nrf5340dk. I want to use its net core to connect ina219 through i2c. I knew that net core i2c is &i2c0, so I set the overlay file like follow,

&i2c0 {
    status = "okay";
    compatible = "nordic,nrf-twim";
    clock-frequency = <I2C_BITRATE_STANDARD>;
    pinctrl-0 = <&i2c0_default>;
    pinctrl-1 = <&i2c0_sleep>;
    pinctrl-names = "default", "sleep";

    ina219@40 {
        status = "okay";
        compatible = "ti,ina219";
        reg = <0x40>;
        brng = <0>;
        pg = <0>;
        sadc = <13>;
        badc = <13>;
        shunt-milliohm = <100>;
        lsb-microamp = <10>;
    };
};
In the app core, I can connect ina219 and read the data from it. However, in net core, it didn't work.
So I want to know that whether net core can connect sensor through i2c?
Parents
  • Hi,

    Can you elaborate why you want to do this? The problem is that doing this is very complicated, because you would need to pass data from the netcore to the appcore, and then back to the netcore using the host controller interface. It's only intended to run the BLE stack on the netcore.

    But to answer your question; You will likely need to add the pins in question to the overlay file for the appcore, such that control of the pins in questions are forwarded from the appcore to the netcore. If you look for "fwd" in the appcore board files you likely will find some mention already.

    Kenneth

Reply
  • Hi,

    Can you elaborate why you want to do this? The problem is that doing this is very complicated, because you would need to pass data from the netcore to the appcore, and then back to the netcore using the host controller interface. It's only intended to run the BLE stack on the netcore.

    But to answer your question; You will likely need to add the pins in question to the overlay file for the appcore, such that control of the pins in questions are forwarded from the appcore to the netcore. If you look for "fwd" in the appcore board files you likely will find some mention already.

    Kenneth

Children
Related