TyMeew / tinyos-main

Automatically exported from code.google.com/p/tinyos-main
1 stars 0 forks source link

STOP-condition-only packet not implemented in Atm128I2CMasterPacketP #122

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try to write a zero-length packet with I2C_STOP flag set, in order to 
generate a STOP condition, using the I2CPacket interface of 
Atm128I2CMasterPacketP

What is the expected output? What do you see instead?
The STOP condition should be generated and I2CPacket.writeDone signaled. 
Instead, the driver locks up.

What version of the product are you using? On what operating system?
Latest revision of Atm128I2CMasterPacketP (r5669)

Please provide any additional information below.
The driver seems to be locking up because its state is transitioned to 
I2C_STOPPING and is never handled in I2C.commandComplete (when a zero length 
packet with I2C_STOP flag is written)

This is specially important for the case where no slave device acknowledges to 
the slave address. In which case the master should generate a STOP condition. 
Either the ability to explicitly generate a STOP condition with the I2CPacket 
interface has to be implemented, or the STOP condition has to be automatically 
generated when the slave does not ACK the address.

Original issue reported on code.google.com by anderson...@spensatech.com on 20 Feb 2012 at 8:28

GoogleCodeExporter commented 8 years ago

Original comment by philip.l...@gmail.com on 8 Mar 2012 at 10:53

GoogleCodeExporter commented 8 years ago
This looks like a tricky one which will require a lot of effort and testing. 
Until then, I'd recommend using the Atm128I2C.stop command.

Original comment by philip.l...@gmail.com on 12 Mar 2012 at 10:35

GoogleCodeExporter commented 8 years ago
The atm128 doesn't generate interrupt after a stop condition, so checking for 
it in commandComplete is not enough. I will try to write a patch for this soon.

Original comment by andras.b...@unicomp.hu on 1 Oct 2012 at 3:09

GoogleCodeExporter commented 8 years ago
Could you try the fix commited here?
https://github.com/andrasbiro/tinyos/tree/i2c_fixes

Original comment by andras.b...@unicomp.hu on 1 Nov 2012 at 8:25