AnsweredAssumed Answered

twi driver bug?

Question asked by pfeifferc on Oct 22, 2009
Latest reply on Oct 22, 2009 by bobbiekydd

Hi !

i use the TWI_Device driver to communicate with I2C codecs.

My routine works since 2years but now it seems i have detected a bug in the driver.

Now after adding some code and data into my project i always get an ADI_TWI_RESULT_BAD_ADDR error

i call the function with following presets:


twiDataOutBuf.Buffer.pAdditionalInfo = (void*)0x10;  
twiDataOutBuf.Buffer.Data =  &twiDataOut[0];
twiDataOutBuf.Buffer.ElementCount = 8;
adi_dev_SequentialIO ( TWIDriverHandle , ADI_DEV_SEQ_1D , (ADI_DEV_BUFFER* ) &twiDataOutBuf )


so see my attached jpg - the marked section and the if condition is reached with buffer=NULL so the condition

access invalid /undefined memory  if (((u32)buffer->Buffer.pAdditionalInfo&ADI_TWI_RSTART)==ADI_TWI_RSTART)

and returns BAD_ADDR;


so i corrected this line to

if (((u32)buf->Buffer.pAdditionalInfo&ADI_TWI_RSTART)==ADI_TWI_RSTART)  and it works

is this a known bug ?


regards chris