From: Matthew S. <ma...@ec...> - 2006-03-21 16:26:33
|
Well the problem turned out to be bad code leaving the bus locked up. I am in the progress of making sure the pic times out the clock stretch. Interestingly and the bus hang will hang the gumstix. I am sure this is not appropriate behaviour, I shall investigate and fix when I get some free time. Just clock stretch for infinity and the gumstix will eventually stop responding. Thanks for your help, Matthew Swabey Dave Hylands wrote: > Hi Matthew, > >> I have been successfully using the I2C bus for some time, I have had my >> PICs hanging off the bus chatting perfectly. >> >> At the moment however: >> >> They use a protocol on the I2C bus of >> >> write(cmd) >> read(result) >> >> Now when the read instruction is issued by the gumstix if the data for >> result isn't ready the pic stretches the clock to accomplish this (as >> specified in the I2C standard). >> >> Currently the read ioctl is returning with EINPROGRESS and then exiting. >> >> This seems to be a return due to the driver timing out, however it >> leaves the bus in an unusable state, as my PIC is clock stretching for ever. >> >> Is there somewhere the bus timeout on the gumstix, and is it simple to >> control (a fcntl perhaps?), or if not would you suggest a different >> method of solving this problem? > > Which version of the kernel are you using? In the 2.6.11 kernel, I > found a bug where the timeout was way too short. > > If your PIC is stretching the clock forever, then that's whats leaving > the bus in an unusable state. There's no way for a master to recover > from that. This is because with the i2c bus you can only drive the bus > low, and not high, so whoever is driving it low is at fault. > > There are some ioctls mentioned in i2c-dev.h which indicate that the > number of retries and the timeout can be modifed, but I haven't tested > these. > > -- > Dave Hylands > Vancouver, BC, Canada > http://www.DaveHylands.com/ > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642 > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users -- Matthew Swabey Rm7025, Bldg21 Faraday Tower Department of ECS University of Southampton University Road Southampton, SO17 1BJ England Tel: 02380 597381 Mob: 07966 440946 |