Problem I2C Freertos driver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem I2C Freertos driver

Jump to solution
1,793 Views
ypkdani
Contributor III

Hello,

i have to transmit the data to a I2C memory. I have init the I2C0 with:

@

I2C_MasterGetDefaultConfig(&i2c0_config);
NVIC_SetPriority(I2C0_IRQn, 6);

error = I2C_RTOS_Init(&i2c0_handle, I2C0, &i2c0_config, CLOCK_GetFreq(I2C0_CLK_SRC));

then i have to write a data so:

data_transfer.slaveAddress = 0x50U;
data_transfer.direction = kI2C_Write;
data_transfer.subaddress = 0;
data_transfer.subaddressSize = 0;
data_transfer.data = data;
data_transfer.dataSize = n;
data_transfer.flags = kI2C_TransferDefaultFlag;

error = I2C_RTOS_Transfer(&i2c0_handle, &data_transfer);

but nothing happen and the device stop with the function

/* Wait for transfer to finish */
xSemaphoreTake(handle->semaphore, portMAX_DELAY);

in the function I2C_RTOS_Transfer. 

Other question is what are the variable ?

data_transfer.subaddress = 0;
data_transfer.subaddressSize = 0;

are the address of the device to point ? 

Thanks

1 Solution
1,410 Views
ypkdani
Contributor III

Solved, it was a my error with the I2C0 instead I2C2

View solution in original post

3 Replies
1,410 Views
Carlos_Mendoza
NXP Employee
NXP Employee


Hi Daniele,

Could you tell us which MCU are you using?

Thanks in advance!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos
1,410 Views
ypkdani
Contributor III

yes sorry, K22FX512

0 Kudos
1,411 Views
ypkdani
Contributor III

Solved, it was a my error with the I2C0 instead I2C2