LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 02-15-2020, 09:49 PM   #1
ncherry
LQ Newbie
 
Registered: Feb 2020
Location: NJ, USA
Posts: 2

Rep: Reputation: Disabled
I2C Slave questions on i.MX7 board


First this is not a Pi, it's a different SBC (i.MX7).

I've been assigned an interesting task, I need to do I2C Multi-Master where we're transferring a status request and commands between two I2C master. I've not worked with I2C so I don't know how to proceed.

I've been doing a lot of searching and I've found that a device can be an I2C master and a slave (good). The problem I have is that if my daemon (master A) is running I need to use the i2c-x device to be the master and that's okay. I can send a request (write to the slave B). But in order for the other master (B) to send updates randomly to the daemon I need to have the daemon controller (A) also be a slave. But the slave device, like the eeprom sample from the 2015 I2C slave device, is in the sysfs. That makes coding in the daemon a bit messy as I don't get a software interrupt (there is no change on file change). Is there some other way to get the data from the I2C subsystems?

Device A = Master A and Slave A
Device B = Master B and Slave B

Master A issues commands (I2C Write) -> Slave B (Device B)
Master B issues updates (I2C Write) -> Slave A (Device A)

And I have given consideration of having my daemon poll the other master for the status. I just want to cover my bases.

Master A issues commands (I2C Write) -> Slave B
Master A issues poll for status (I2C Read) <- Slave B

Any comments or suggest?
 
Old 02-15-2020, 10:49 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,842
Blog Entries: 13

Rep: Reputation: 4894Reputation: 4894Reputation: 4894Reputation: 4894Reputation: 4894Reputation: 4894Reputation: 4894Reputation: 4894Reputation: 4894Reputation: 4894Reputation: 4894
For multi-master, you need a form of bus arbitration.

One way would be unique bus signalling.

Another way would be to use HW signalling.
 
Old 02-16-2020, 11:39 PM   #3
ncherry
LQ Newbie
 
Registered: Feb 2020
Location: NJ, USA
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rtmistler View Post
For multi-master, you need a form of bus arbitration.

One way would be unique bus signalling.

Another way would be to use HW signalling.
Not going to play with the bus signaling and I can't get an additional hardware signal. But I found a link on using the i2c-stub and a suggestion that one of the ioctl calls will work. So I'll give that a try. I'm not too thrilled with the sysfs interface but I can live with it if I can get something that says 'come and get it'.

https://eraretuya.github.io/2016/12/...tub-in-action/

This is the i2c-stub link. The link that mentioned may have been a different link. Hopefully that will work. Otherwise I'll resort to treachery and drop a cheap Arduino Uno Pro and translate the I2C to plain serial. ;-) Not sure how the main Engineer will like that but he's changing the interface after the demo date and won't tell me what he has in mind.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Customizable Alexa development board builds on i.MX7 module LXer Syndicated Linux News 0 02-27-2018 02:25 PM
i2c-dev.h missing i2c read/write functions dbrazeau Programming 1 12-17-2015 11:40 PM
How to forward IOCTL's from i2c-dev.c to adapter driver (i2c-rt3352.c) elonica.pl Linux - Kernel 2 08-23-2011 03:03 AM
[SOLVED] No /dev/i2c-0 entry after insmod i2c-dev sajnanazeer Linux - Newbie 1 08-10-2011 08:39 AM
Help! Problems with i2c-dev. No more /dev/i2c-* em1l Fedora 0 10-28-2005 06:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 04:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration