This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/PROCESSOR-SDK-AM437X: INA226 sensor configuration

Part Number: PROCESSOR-SDK-AM437X
Other Parts Discussed in Thread: INA226

Tool/software: Linux

Hi,

I would like to turn on the INA266 sensors on the EVM board. But I have difficulties to map the linux kernel driver into the dts file, since there are two ina266 sensors on board, one on address 0x40, the other on address 0x41. Is it legal to map multiple devices into one driver? If not, how should I proceed this?

Thanks.

Jerry Wang

  • Hi,

    The I2C bus of these sensors is connected only to an external header (J6). They have no connection to the processor I2C ports and cannot be controlled from software running on-board.
  • We used jumper wire from J6 to J3 just for the I2C0 wires. Is this OK?
  • Hello Jerry,

    I am not a hardware expert, so I cannot comment on signal integrity over jumper wires. If we assume that ringing, signal reflections, noise coupling, etc are all very small, then I expect jumping J6 to J3 would allow you to control the INA226 chips on the i2c0 bus.

    You should be able to add both chips to the device tree. Please take a look at linux-4..../Documentation/devicetree/bindings/hwmon/ina2xx.txt for information on how to add the INA226 device nodes into &i2c0{} in the am437x-gp-evm.dts device tree.

    Regards,
    Nick
  • Let me hop onto this conversation... There is a tool on Github that allows you to use the onboard INA devices. It's very simple to use: powertool. You will just need to clone the repo and build the tool (either 'make CROSS_COMPILE=arm-linux-gnueabihf-' or 'make' natively on the EVM) then create a ".conf" file that provides info on the INA devices to the tool. There is no need to set up the INA devices in your device tree. The tool just communicates with the I2C bus directly and therefore it does not need the Kernel to be aware of the INA devices or set them up for us. 

    Running the tool after it's built can be done with this command: 

    ./ptool -c configs/your_board.conf -e -s 100 -n 100

    -e will collect data on all the rails defined in your config file
    -s defines the milliseconds between samples
    -n defines the number of samples to capture

    You can also run the Powertool on a Linux PC with a FTDI cable / USB-to-I2C converter. That would let you measure the AM437x power without the ptool affecting results. Cable I've tested with: C232HM-DDHSL. A guide for this method isn't written yet but I could provide some guidance and resources if desired.