One thing I didn't include was the test of SM_BUS capabilities. All that would do, if failed,
is formally tell us that the i2c adapter isn't documented to support the needed calls.
Do you know what i2c chip is on the board. Do you have source code?
I see only three i2c commands in the code:
i2c_smbus_write_byte
i2c_smbus_write_byte_data
i2c_smbus_read_byte
These in turn call lower level i2c commands. Clearly one of the smbus command translations fails.
>From there (in i2c-dev.h):
static inline __s32 i2c_smbus_read_byte(int file)
{
union i2c_smbus_data data;
if (i2c_smbus_access(file,I2C_SMBUS_READ,0,I2C_SMBUS_BYTE,&data))
return -1;
else
return 0x0FF & data.byte;
}
static inline __s32 i2c_smbus_write_byte(int file, __u8 value)
{
return i2c_smbus_access(file,I2C_SMBUS_WRITE,value,
I2C_SMBUS_BYTE,NULL);
}
static inline __s32 i2c_smbus_write_byte_data(int file, __u8 command,
__u8 value)
{
union i2c_smbus_data data;
data.byte = value;
return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
I2C_SMBUS_BYTE_DATA, &data);
}
And each of those call in turn:
static inline __s32 i2c_smbus_access(int file, char read_write, __u8 command,
int size, union i2c_smbus_data *data)
{
struct i2c_smbus_ioctl_data args;
args.read_write = read_write;
args.command = command;
args.size = size;
args.data = ""> return ioctl(file,I2C_SMBUS,&args);
}
A simple ioctl.
So my thoughts:
See if it's one of the three commands (write, write_byte or read) that fails consistently. See if the ioctl is supported. Choose another board.
Paul
On 5/27/06, Daniel Höper <[EMAIL PROTECTED]> wrote:
Good news: current version operates without any problem on a x86-machine with
a self-made i2c-parallel-port-adapter (see
linux/Documentation/i2c/busses/i2c-parport). Tested with a DS2482-100 and a
DS2890 digital potentiometer. Reading from and writing to this 1-wire device
works fine. Even two 1-Wire devices on the bus don't produce an error.
But we have a problem with our Kontron X-board<GP8> (Intel 80219 Processor,
Xscale core, arm compliant). I think the kernel driver is incorrect. Maybe
you have a hint for us. I added some debugging code to i2c_smbus_access():
% OW::get uncached
...
DEBUG: DS2482 search bit number 10
DEBUG: -> TRIPLET attempt direction 0
DEBUG: *** i2c_smbus_access(3, I2C_SMBUS_WRITE, 0x78 (1-Wire Triplet), ...):
Success (0)
DEBUG: *** i2c_smbus_access(3, I2C_SMBUS_READ, ..., ...): Success (0)
DEBUG: DS2482 read status ok
DEBUG: <- TRIPLET 0 1 0
DEBUG: DS2482 search bit number 11
DEBUG: -> TRIPLET attempt direction 0
DEBUG: *** i2c_smbus_access(3, I2C_SMBUS_WRITE, 0x78 (1-Wire Triplet), ...):
Success (0)
DEBUG: *** i2c_smbus_access(3, I2C_SMBUS_READ, ..., ...): Operation not
permitted (1)
DEBUG: Reading DS2482 status problem min=198 max=219 i=0 ret=-1
...
* The bit number after the process stops is different between each test cycle.
* Sometimes the "1-Wire Triplet"-Command returns the same error.
After this failure every other i2c command fails:
% OW::get uncached
...
DEBUG: Start of directory path=uncached device=00 00 00 00 00 00 00 00
DEBUG: Selecting a path (and device) path=uncached SN=00 00 00 00 00 00 00
00 last path=00 00 00 00 00 00 00 00
DEBUG: *** i2c_smbus_access(3, I2C_SMBUS_WRITE, 0xb4 (1-Wire Reset), ...):
Operation not permitted (1)
DEBUG: owserver dir post = uncached
...
Even a restart of owserver wouldn't help because the device reset command also
returns "Operation not permitted".
Only a power-down/power-up of the chip brings the device back to normal
operation.
Daniel
Am Mittwoch, 24. Mai 2006 00:08 schrieb Paul Alfille:
> Added more debugging info. It looks like there was a problem reading
> from the DS2482 status register. This may show why.
>
> Paul
>
> On 5/23/06, Paul Alfille <[EMAIL PROTECTED]> wrote:
> > Ok, fixed the directory caching problem.
> >
> > Paul
> >
> > On 5/23/06, Paul Alfille <[EMAIL PROTECTED]> wrote:
> > > Thank you, Daniel!
> > >
> > > 1. Detection seems to work
> > > 2. 1-wire search fails after 27 of 64 steps, Not sure why.
> > > 3. Clearly a failed directory listing is getting cached -- unrelated
> > > error.
> > >
> > > I'll make some changes to see if we can figure out why the search is
> > > failing. It seems like a timing, hardware or driver problem, really.
> > >
> > > Paul
> > >
> > > On 5/23/06, Daniel Höper <[EMAIL PROTECTED]> wrote:
> > > > Hello Paul,
> > > >
> > > > this is the debug output from owserver:
> > > >
> > > > ~ $ /usr/bin/owserver --foreground --error_level 9 -p 2000 /dev/i2c-1
> > > > CONNECT: Found an i2c device at /dev/i2c-1 address 24
> > > > CONNECT: i2c device at /dev/i2c-1 address 24 cannot be reset
> > > > CONNECT: Found an i2c device at /dev/i2c-1 address 25
> > > > CONNECT: i2c device at /dev/i2c-1 address 25 cannot be reset
> > > > CONNECT: Found an i2c device at /dev/i2c-1 address 26
> > > > DEBUG: DS2482 read status ok
> > > > CONNECT: i2c device at /dev/i2c-1 address 26 appears to be DS2482-x00
> > > > CALL: No message
> > > > CALL: owserver: parse path=
> > > > CALL: PARSENAME path=[]
> > > > CALL: Directory message
> > > > OWSERVER SpecifiedBus=0 pn->bus_nr=-1
> > > > DEBUG: owserver dir pre =
> > > > CALL: DIRECTORY path=
> > > > DEBUG: Get from cache sn 00 00 00 00 00 00 00 00 in=0x134b8 index=0
> > > > DEBUG: Found in cache
> > > > DEBUG: Start of directory path= device=00 00 00 00 00 00 00 00
> > > > DATA: BUS_first: No data will be returned
> > > > DEBUG: Selecting a path (and device) path= SN=00 00 00 00 00 00 00
> > > > 00 last path=01 00 00 00 00 00 00 00
> > > > DEBUG: Clearing root branch
> > > > DEBUG: owserver dir post =
> > > > CALL: owserver: parse path=
> > > > CALL: PARSENAME path=[]
> > > > CALL: Directory message
> > > > OWSERVER SpecifiedBus=0 pn->bus_nr=-1
> > > > DEBUG: owserver dir pre =
> > > > CALL: DIRECTORY path=
> > > > DEBUG: Get from cache sn 00 00 00 00 00 00 00 00 in=0x134b8 index=0
> > > > DEBUG: Found in cache
> > > > DEBUG: Start of directory path= device=00 00 00 00 00 00 00 00
> > > > DATA: BUS_first: No data will be returned
> > > > DEBUG: Selecting a path (and device) path= SN=00 00 00 00 00 00 00
> > > > 00 last path=01 00 00 00 00 00 00 00
> > > > DEBUG: Clearing root branch
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: DS2482 Reset
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: DS2482 Reset
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: DS2482 search bit number 0
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 0 1 0
> > > > DEBUG: DS2482 search bit number 1
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 0 1 0
> > > > DEBUG: DS2482 search bit number 2
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 1 0 1
> > > > DEBUG: DS2482 search bit number 3
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 1 0 1
> > > > DEBUG: DS2482 search bit number 4
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 0 1 0
> > > > DEBUG: DS2482 search bit number 5
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 1 0 1
> > > > DEBUG: DS2482 search bit number 6
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 0 1 0
> > > > DEBUG: DS2482 search bit number 7
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 0 1 0
> > > > DEBUG: DS2482 search bit number 8
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 1 0 1
> > > > DEBUG: DS2482 search bit number 9
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 1 0 1
> > > > DEBUG: DS2482 search bit number 10
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 0 1 0
> > > > DEBUG: DS2482 search bit number 11
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 1 0 1
> > > > DEBUG: DS2482 search bit number 12
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 0 1 0
> > > > DEBUG: DS2482 search bit number 13
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 0 1 0
> > > > DEBUG: DS2482 search bit number 14
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 0 1 0
> > > > DEBUG: DS2482 search bit number 15
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 0 1 0
> > > > DEBUG: DS2482 search bit number 16
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 0 1 0
> > > > DEBUG: DS2482 search bit number 17
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 0 1 0
> > > > DEBUG: DS2482 search bit number 18
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 0 1 0
> > > > DEBUG: DS2482 search bit number 19
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 1 0 1
> > > > DEBUG: DS2482 search bit number 20
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 1 0 1
> > > > DEBUG: DS2482 search bit number 21
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 1 0 1
> > > > DEBUG: DS2482 search bit number 22
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 0 1 0
> > > > DEBUG: DS2482 search bit number 23
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 1 0 1
> > > > DEBUG: DS2482 search bit number 24
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 1 0 1
> > > > DEBUG: DS2482 search bit number 25
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: DS2482 read status ok
> > > > DEBUG: <- TRIPLET 0 1 0
> > > > DEBUG: DS2482 search bit number 26
> > > > DEBUG: -> TRIPLET attempt direction 0
> > > > DEBUG: BUS_next return = -1 2C 0B B8 01 00 00 00 00
> > > > DEBUG: owserver dir post =
> > > > CALL: owserver: parse path=
> > > > CALL: PARSENAME path=[]
> > > > CALL: Directory message
> > > > OWSERVER SpecifiedBus=0 pn->bus_nr=-1
> > > > DEBUG: owserver dir pre =
> > > > CALL: DIRECTORY path=
> > > > DEBUG: Get from cache sn 00 00 00 00 00 00 00 00 in=0x134b8 index=0
> > > > DEBUG: Found in cache
> > > > DEBUG: Start of directory path= device=00 00 00 00 00 00 00 00
> > > > DEBUG: Selecting a path (and device) path= SN=00 00 00 00 00 00 00
> > > > 00 last path=00 00 00 00 00 00 00 00
> > > > DEBUG: owserver dir post =
> > > > CALL: owserver: parse path=
> > > > CALL: PARSENAME path=[]
> > > > CALL: Directory message
> > > > OWSERVER SpecifiedBus=0 pn->bus_nr=-1
> > > > DEBUG: owserver dir pre =
> > > > CALL: DIRECTORY path=
> > > > DEBUG: Get from cache sn 00 00 00 00 00 00 00 00 in=0x134b8 index=0
> > > > DEBUG: Found in cache
> > > > DEBUG: Start of directory path= device=00 00 00 00 00 00 00 00
> > > > DEBUG: Selecting a path (and device) path= SN=00 00 00 00 00 00 00
> > > > 00 last path=00 00 00 00 00 00 00 00
> > > > DEBUG: owserver dir post =
> > > > CALL: owserver: parse path=uncached
> > > > CALL: PARSENAME path=[uncached]
> > > > CALL: Directory message
> > > > OWSERVER SpecifiedBus=0 pn->bus_nr=-1
> > > > DEBUG: owserver dir pre = uncached
> > > > CALL: DIRECTORY path=uncached
> > > > DEBUG: Start of directory path=uncached device=00 00 00 00 00 00 00
> > > > 00 DEBUG: Selecting a path (and device) path=uncached SN=00 00 00 00
> > > > 00 00 00 00 last path=00 00 00 00 00 00 00 00
> > > > DEBUG: owserver dir post = uncached
> > > >
> > > > On the client side I executed:
> > > > % OW::init 10.0.1.1:2000
> > > > % OW::get
> > > > structure/ uncached/ bus.0/ settings/ system/ statistics/
> > > > % OW::get
> > > > structure/ uncached/ bus.0/ settings/ system/ statistics/
> > > > % OW::get
> > > > structure/ uncached/ bus.0/ settings/ system/ statistics/
> > > > % OW::get
> > > > structure/ uncached/ bus.0/ settings/ system/ statistics/
> > > > % OW::get uncached
> > > > structure/ bus.0/ settings/ system/ statistics/
> > > >
> > > > I hope it helps.
> > > > (Hardware components and configuration have not changed)
> > > >
> > > > Daniel
> > > >
> > > > Am Samstag, 20. Mai 2006 17:52 schrieb Paul Alfille:
> > > > > Daniel,
> > > > >
> > > > > This is better than I expected.
> > > > > With your modifications, it sounds like:
> > > > > 1. The chip is detected
> > > > > 2. Reset and the start of a device search works.
> > > > >
> > > > > I'm uploading a more heavily "instrumented" version -- more
> > > > > debugging information -- which might help us figure out the
> > > > > problem.
> > > > >
> > > > > Paul
> > > > >
> > > > > On 5/20/06, Daniel Höper <[EMAIL PROTECTED]> wrote:
> > > > > > My first attempt with the current CVS version failed, owserver
> > > > > > did not print anything on the console. I cannot find where
> > > > > > DS2482_detect() is called, thus I added the following code to the
> > > > > > switch() statement in LibStart(): ...
> > > > > > case bus_i2c:
> > > > > > ret = DS2482_detect(in);
> > > > > > break;
> > > > >
> > > > > Exactly! Fixed.
> > > > >
> > > > > > ...
> > > > > > (Is this the right place and method to initialize the device?)
> > > > > >
> > > > > > Next problem is a segmentation fault in DS2482_channel_select()
> > > > > > caused by the head pointer which is NULL during initialization.
> > > > > > In this case a "return 0" should be sufficient for the
> > > > > > DS2482-100. (probably I will finish a test environment with a
> > > > > > DS2482-800 in the next few days)
> > > > >
> > > > > Fixed. Thanks.
> > > > >
> > > > > > After this two modifications owserver shows the following:
> > > > > >
> > > > > > / $ /usr/bin/owserver --foreground --error_level 9 -p 2000
> > > > > > /dev/i2c-1 CONNECT: Found an i2c device at /dev/i2c-1 address 24
> > > > > > CALL: PARSENAME path=[]
> > > > > > CONNECT: Found an i2c device at /dev/i2c-1 address 25
> > > > > > CALL: PARSENAME path=[]
> > > > > > CONNECT: Found an i2c device at /dev/i2c-1 address 26
> > > > > > CALL: PARSENAME path=[]
> > > > > > CONNECT: i2c device at /dev/i2c-1 address 26 appears to be
> > > > > > DS2482-x00 CALL: No message
> > > > > > CALL: owserver: parse path=uncached
> > > > > > CALL: PARSENAME path=[uncached]
> > > > > > CALL: Directory message
> > > > > > OWSERVER SpecifiedBus=0 pn->bus_nr=-1
> > > > > > DEBUG: owserver dir pre = uncached
> > > > > > CALL: DIRECTORY path=uncached
> > > > > > DEBUG: Start of directory path=uncached device=00 00 00 00 00
> > > > > > 00 00 00 DEBUG: Selecting a path (and device) path=uncached SN=00
> > > > > > 00 00 00 00 00 00 00 last path=01 00 00 00 00 00 00 00
> > > > > > DEBUG: Clearing root branch
> > > > > > DEBUG: BUS_next return = -1 2C 0B B8 01 00 00 00 00
> > > > > > DEBUG: owserver dir post = uncached
> > > > > > CALL: owserver: parse path=
> > > > > > CALL: PARSENAME path=[]
> > > > > > CALL: Directory message
> > > > > > OWSERVER SpecifiedBus=0 pn->bus_nr=-1
> > > > > > DEBUG: owserver dir pre =
> > > > > > CALL: DIRECTORY path=
> > > > > > DEBUG: Get from cache sn 00 00 00 00 00 00 00 00 in=0x134b8
> > > > > > index=0 DEBUG: Found in cache
> > > > > > DEBUG: Start of directory path= device=00 00 00 00 00 00 00 00
> > > > > > DEBUG: Selecting a path (and device) path= SN=00 00 00 00 00 00
> > > > > > 00 00 last path=00 00 00 00 00 00 00 00
> > > > > > DEBUG: BUS_next return = -1 2C 0B 00 00 00 00 00 00
> > > > > > DEBUG: owserver dir post =
> > > > > >
> > > > > >
> > > > > > To communicate with the server I used owtcl on another machine:
> > > > > >
> > > > > > % OW::init 10.0.1.1:2000
> > > > > > % OW::get uncached
> > > > > > structure/ bus.0/ settings/ system/ statistics/
> > > > > > % OW::get
> > > > > > structure/ uncached/ bus.0/ settings/ system/ statistics/
> > > > > >
> > > > > > There is only one chip connected to the 1-wire bus.
> > > > > > It's a DS2890, ID: "2C 0B B8 05 00 00 00 E2"
> > > > > > This ID is partially shown in the debug output (BUS_next).
> > > > > >
> > > > > > I restarted the machine and owserver several times and run
> > > > > > "OW::get" but there wasn't an entry in the directory for the
> > > > > > chip.
> > > > > >
> > > > > > Daniel
> > > >
> > > > -------------------------------------------------------
> > > > All the advantages of Linux Managed Hosting--Without the Cost and
> > > > Risk! Fully trained technicians. The highest number of Red Hat
> > > > certifications in the hosting industry. Fanatical Support. Click to
> > > > learn more
> > > > http://sel.as-us.falkag.net/sel?cmdlnk&kid7521&bid$8729&dat1642
> > > > _______________________________________________
> > > > Owfs-developers mailing list
> > > > Owfs-developers@lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/owfs-developers
>
> -------------------------------------------------------
> All the advantages of Linux Managed Hosting--Without the Cost and Risk!
> Fully trained technicians. The highest number of Red Hat certifications in
> the hosting industry. Fanatical Support. Click to learn more
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642
> _______________________________________________
> Owfs-developers mailing list
> Owfs-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
--
http://keys.se.linux.org/pks/lookup?fingerprint=on&search=0x231C24FD6C800545
http://keys.se.linux.org/pks/lookup?op=get&search=0x231C24FD6C800545
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmdlnk&kid7521&bid$8729&dat1642
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers