We are still setting this up for the first time. The Torizon loaded up quickly and easily, docker and portainer are working well, we even have migrated to Microsoft from Eclipse which is something I didn’t ever think I would do.
However, we have something really fundamental to sort out and its been a day of struggle so far.
We have the imx8x 2gb and the evaluation board.
There are a pair of I2C busses to use on the evaluation board: bus 16 and 17 according to I2C (Linux).
So we want to bring up my devices (one is an SMBUS battery, one is a slave i2c device) and in the process, I wanted to see if we can see the device addresses on each bus.
The imx8x and colibri board has other ideas…
I wanted to use i2cdetect but torizoncore does not have this command, or even apt so it can be installed, so I need Debian via docker.
So I log in via ssh to the terminal, and run: “docker run --rm -it -v /var/run/dbus:/var/run/dbus -v /dev:/dev torizon/debian:$CT_TAG_DEBIAN bash”
Then I update with
apt updateroot@d152fd90ba33:/# “apt update”
Then I get the i2cdetect tool with “apt install libi2c-dev i2c-tools”.
Once all that is installed we can do the i2cdetect command: “i2cdetect -l”
The result is
i2c-17 unknown 5a810000.i2c N/A
i2c-16 unknown 5a800000.i2c N/A
unknown device and N/A bus…
It’s clear that the i2c just hasn’t been brought up, I had a look at /proc/modules and sure enough, there is no mention of the i2c module.
“i2cdetect -y -r 17” (its bus 17)
Error: Could not open file `/dev/i2c-17’: Operation not permitted
Now there is no modprobe command to manually load the i2c module up, lsmod also missing (but it’s fine as this is just formatting the /proc/modules file)
root@d152fd90ba33:/# modprobe bash: modprobe: command not found root@d152fd90ba33:/#
So how do I set this up so the i2c modules are loaded up, and the I2C into user space so I can just check to make sure my device addresses register on the busses?
i would expect a result from i2cdetect like:
i2c-17 i2c 5a810000.i2c i2c-17
i2c-16 i2c 5a800000.i2c i2c-16
How do i fix?
I think this can’t be done in the userspace, so I guess it’s down to working with the TorizonCore Builder?
But I looked around and there are no examples where the I2C’s are enabled for this system
Where should I go next to try?