UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer imdads
Observer
476 Views
Registered: ‎05-03-2019

Reading/writing over IIC/I2C in petalinux

Jump to solution

I was expecting to be able to use i2cget, i2cset etc. in busybox, but they are not included in the list of applets. How can I add these to busybox or otherwise read/write over the I2C bus?

(Note: I have checked with dmesg that the i2c driver has been registered, and /dev/i2c-0 exists.)

Thanks!

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Observer imdads
Observer
150 Views
Registered: ‎05-03-2019

Re: Reading/writing over IIC/I2C in petalinux

Jump to solution

@afantina, thanks very much for replying! Unfortunately, I had tried that, and while it enabled the i2c drivers, it didn't add i2c-tools to busybox. I've stopped working on the project now, but I did eventually figure out how to make i2c-tools available, so I should probably mention it here in case it helps someone else!

It turns out you can use petalinux-config to configure more than is mentioned in the PetaLinux Tools Documentation (in fact, busybox isn't mentioned in the docs at all). The command

   petalinux-config -c busybox

will allow you to configure the busybox executable, and, in particular, it will allow you to include i2c-tools.

View solution in original post

6 Replies
Moderator
Moderator
404 Views
Registered: ‎02-07-2018

Re: Reading/writing over IIC/I2C in petalinux

Jump to solution

HI @imdads 

 

By defualt i2c-tools are not enabled in petalinux.Please follow below steps to  get the i2c tools as a part of your rootfs.

 

petalinux-config -c rootfs

Filesystem Packages ---> base ---> i2c-tools --->[*] i2c-tools   --> save & exit

petalinux-build

 

Thanks & regards

Aravind

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

0 Kudos
Observer imdads
Observer
394 Views
Registered: ‎05-03-2019

Re: Reading/writing over IIC/I2C in petalinux

Jump to solution

Hi @aravindb 

Thanks a lot for your response! Unfortunately, there is no "i2c-tools" sub-section under "base" in my petalinux rootfs configuration. Is there some other way to enable it?

Kind regards,
Imdad

0 Kudos
Moderator
Moderator
392 Views
Registered: ‎02-07-2018

Re: Reading/writing over IIC/I2C in petalinux

Jump to solution

Hi @imdads 

What is the petalinux version you are using.

 

Thanks & regards

Aravind

0 Kudos
Observer imdads
Observer
385 Views
Registered: ‎05-03-2019

Re: Reading/writing over IIC/I2C in petalinux

Jump to solution

Sorry, I should have mentioned, it's 2018.3.

0 Kudos
Observer afantina
Observer
163 Views
Registered: ‎04-04-2019

Re: Reading/writing over IIC/I2C in petalinux

Jump to solution

I am working in Petalinux_2019_1 and this is the instructions:

Type: petalinux-config -c kernel

And follow the path: Device Drivers --> I2C support (mark with * and go to Save)

After all, build the project again 

Hope this will help you :)

0 Kudos
Highlighted
Observer imdads
Observer
151 Views
Registered: ‎05-03-2019

Re: Reading/writing over IIC/I2C in petalinux

Jump to solution

@afantina, thanks very much for replying! Unfortunately, I had tried that, and while it enabled the i2c drivers, it didn't add i2c-tools to busybox. I've stopped working on the project now, but I did eventually figure out how to make i2c-tools available, so I should probably mention it here in case it helps someone else!

It turns out you can use petalinux-config to configure more than is mentioned in the PetaLinux Tools Documentation (in fact, busybox isn't mentioned in the docs at all). The command

   petalinux-config -c busybox

will allow you to configure the busybox executable, and, in particular, it will allow you to include i2c-tools.

View solution in original post