Hello CircuitDojo Community,
I’m working with Sparkfun Thing Plus nrf9160 and a custom board with similar features, with battery powered operation a key design goal. I’m building a custom Zephyr 2.6.0 app that’s based on Nordic Semi’s aws_iot sample (plus some parts of a couple other samples, and a fair amount of custom code at this time).
Until last Friday the lowest floor current I could reach via Kconfig and run time configurations was about 19uA. I’m now down to about 4.5uA, at the high end of floor current range that’s my goal. But I to get here I needed to disable my i2c on-chip peripheral in device tree source board file:
&i2c1 {
compatible = "nordic,nrf-twim";
// status = "okay";
status = "disabled";
sda-pin = <6>; // <-- Ted temporarily moving I2C pins to test direct GPIO configuration on them.
scl-pin = <5>;
clock-frequency = <I2C_BITRATE_FAST>;
};
This experimental change works to reach low floor current, but it is a compile time change and in no way change-able at run time.
Does anyone here on this forum have experience with an API or run-time accessible feature of Zephyr’s in-tree driver base, something which would not only suspend an I2C peripheral but change a given device instance’ pin configuration at run time?
My suspicion, with hardware sleuthing help from team mate, is that pull-ups on nRF9160 ARM processor SDA and SCL pins are drawing the roughly 15uA of current we observe disappear, when we disable the one I2C peripheral we have been using for sensors.
Zephyr’s on-line documentation for I2C driver doesn’t appear to cover or even make reference to internal pull-up settings. I realize these would be, most likely, vendor specific to each target microcontroller, so there may not be specific Zephyr source tree code to configure pins at this level.
I’ve also searched Zephyr sources directly, looking for and at ref’s to a routine named i2c_configure(), and GPIO_PULL_UP. So far I come up empty handed. There are references to this routine, but no implementation to be found, not even in the build artifacts of my local project repo.
Have I missed some key thing in Zephyr documentation on-line, or its project sources? Is there an nRF9160 Hardware Abstraction Layer source tree I should be reviewing? Or look elsewhere?
As always, any help and insight shared to this question I’ll appreciate!