This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM263P4-Q1: AM263Px: How to specify a timeout period when using EEPROM_read() and EEPROM_write()

Part Number: AM263P4-Q1

EEPROM_read() and EEPROM_write() will return error with the parameters passed is not valid, if the I2C Bus is busy or if timeout occurs.How do I specify a timeout period when using EEPROM_read() and EEPROM_write()?
Note: I am using AM263Px MCU+ SDK 09.02.00 and AM263Px MCU+ SDK 11.00.00.

  • Imaoka,

    The EEPROM_read() and EEPROM_write() functions do not have a timeout parameter. The timeout is controlled at the I2C driver level.

    The EEPROM driver internally uses I2C_Transaction which has a timeout field:

    typedef struct I2C_Transaction_s {
        // ... other fields ...
        uint32_t timeout; // <-- Timeout is here
        // ...
    } I2C_Transaction;

    However, the EEPROM driver calls I2C_Transaction_init() which sets timeout to SystemP_WAIT_FOREVER (wait indefinitely), and does not expose a way to override it.

    The option here would be to write a custom EEPROM function to bypass the driver and use I2C_transfer() directly with a custom timeout.

    Regards,

    Brennan