Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

RTOS/66ak2h12: i2c probe hangs

$
0
0

Part Number:66ak2h12

Tool/software:TI-RTOS

Hello,

I have a 66ak2h12, CCS 7.2.0,  sdk_rtos_k2hk_4_00_00_04, and pdk_k2hk_4_0_6.

I need to perform an i2c probe to determine what devices are physically connected to each of the 3 busses.

The process is this:

  call I2C_init: status OK

  Init a params block, bit rate is 400KHz;  I have tried blocking and non-blocking

  I2C_open (busNo, &params):   OK

  For each of the 128 possible addresses:

Build a transaction:

write 0 bytes, read 1 byte

slave addr = address

master mode = true

if (blocking mode)

callback function: function which posts to a semaphore

arg = semaphore ID

else

timeout = 2000

status = I2C_transfer (handle, &transaction)

if blocking mode, wait on sem with timeout = 2000

report status

incr device address

close device

I confirmed that there are devices at 0x4f, 0x50, and 0x51 using uBoot.  However, the TI-RTOS implementation behaves in this way:

  • The first several probes return a status of -3
  • The next several probes return a status of 0, after reaching the timeout period

If I start the scan at 0x50, then I get good status for 0x50 and 0x51, followed by the behavior above.

Questions:

  1. Once the driver detects an ACK error, is there some recovery function I need to call to clear the prior transaction, which failed?
  2. I see there is an I2C command function, and a command for "probe", but that returned an error code indicating it was not implemented.  Is that correct?
  3. Is there a probe example for the RTOS I2C driver which I can examine?

Many thanks,

Tim

The behavior is this:


Viewing all articles
Browse latest Browse all 262198

Trending Articles