Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User7921
Level 3
Level 3
Hi,

I configured the I2C Master app (4.1.8) to use DMA transfer for sending and receiving.
But the generated code just returns an error status:

I2C_MASTER_STATUS_t I2C_MASTER_Receive(I2C_MASTER_t *handle, bool send_start, const uint32_t address, uint8_t * data,                                       const uint32_t count, bool send_stop, bool send_nack)
{
I2C_MASTER_STATUS_t status;


status = I2C_MASTER_STATUS_BUSY;


if (handle->config->receive_mode == I2C_MASTER_TRANSFER_MODE_INTERRUPT)
{
#if (I2C_MASTER_INTERRUPT_RX_ENABLED == 1)
status = I2C_MASTER_StartReceiveIRQ(handle, send_start, address, data, count, send_stop, send_nack);
#endif
}
else if (handle->config->receive_mode == I2C_MASTER_TRANSFER_MODE_DMA)
{
#if (I2C_MASTER_DMA_RX_ENABLED == 1)
status = I2C_MASTER_STATUS_UNSUPPORTED_MODE;
#endif
}
else
{
#if (I2C_MASTER_DIRECT_RX_ENABLED == 1)
status = I2C_MASTER_lStartReceivePolling(handle, send_start, address, data, count, send_stop, send_nack);
#endif
}


return (status);
}



The function for DMA transfer is also generated:

I2C_MASTER_STATUS_t I2C_MASTER_StartReceiveDMA(const I2C_MASTER_t *const handle, uint32_t data_count, uint8_t *addr)


I guess it should be called in the main receive function.

The same issue is in the transmit function.

Of course I can just call the DMA function directly, but it is confusing.

Michael
0 Likes
2 Replies
Not applicable
Hi Michael,

You are right. Ideally, the I2C_Master_Receive API should handle the DMA transactions.

I have filed an eTicket for this request. Eticket#773307510.
You can track this in the following link.
https://www.infineonforums.com/support/dave3/index.php?option=com_maqmahelpdesk&Itemid=0&id_workgrou...

Regards,
Daryl
0 Likes
User7921
Level 3
Level 3
Thank you for the feedback!

Michael
0 Likes