AnsweredAssumed Answered

Exception Thrown When Operating a BF547 Two Wire Interface

Question asked by spflanze on Jan 22, 2013
Latest reply on Apr 2, 2013 by SteveM

I am attempting to operate the Two Wire Interface in a BF547 using VDK. An exception is being thrown. I have traced the cause to the function twi_buffer_transmit() in adi_twi.c. The drv structure passed to twi_buffer_transmit() has the element drv->config.mode set to ADI_DEV_MODE_UNDEFINED. Because of this twi_buffer_transmit()'s buffer variable never gets set to a legitimate buffer, and so the exception is thrown on the line:


if (!buffer||buffer->ProcessedElementCount==buffer->ElementCount)


because of invalid memory addresses.


I have traced back through call stack to where I get a handler in the call to





                1,  // TWI Device Number

                NULL, // Client Handle ( passed to call back function )



                NULL, // DMA Handle (TWI has no DMA)

                adi_dcb_QueueHandle, //Handle to the deferred callback service deferred.

                twi1_ClientCallback // Call Back Function.


twi1_DeviceHandle returned by this call contains the buffer that never gets its config.mode element value set by the time it gets to twi_buffer_transmit(). At what point is this supposed to get set?