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.

TMDS64EVM: I2C EEPROM 64KB FIle Write/Read Issue

Part Number: TMDS64EVM

Hello,

Using mcu_plus_sdk_am64x_10_01_00_32 and modify the i2c_memory_read.c for FILE write and read back to  compare.

Using the I2C device @0x50 physical address to test the file write/read and compare. The routine was using page write/read of 256 Byte page. Test condition of initial address of two cases 0x400 as per example and changed to start at 0x0. The results are the same. Here is the issue :

  1. If the file size is equal or less than 64KB (65536), then the file write and read back and compare passed.
  2. If the file size is just more than 64KB even 1 byte or 2 bytes, the test would fail. Remember it fails either starting address:   #define EEPROM_MEM_ADDRESS = 0x0  or 0x400

So what is likely the problem ?

 

Thanks,

Huynh

  • Additional information : statusFailed [I2C] Data at address 0x0 : Write 0x53 : Read 0x30
    Failed [I2C] Data at address 0x1 : Write 0x33 : Read 0x31
    Failed [I2C] Data at address 0x2 : Write 0x38 : Read 0x32
    Failed [I2C] Data at address 0x3 : Write 0x35 : Read 0x33
    Failed [I2C] Data at address 0x4 : Write 0x38 : Read 0x34
    Failed [I2C] Data at address 0x5 : Write 0x30 : Read 0x35
    Failed [I2C] Data at address 0x6 : Write 0x30 : Read 0x36
    Failed [I2C] Data at address 0x7 : Write 0x36 : Read 0x37
    Failed [I2C] Data at address 0x8 : Write 0x30 : Read 0x38
    Failed [I2C] Data at address 0x9 : Write 0x30 : Read 0x39
    Failed [I2C] Data at address 0xa : Write 0x30 : Read 0x41
    Failed [I2C] Data at address 0xb : Write 0x30 : Read 0x42
    Failed [I2C] Data at address 0xc : Write 0x34 : Read 0x43
    Failed [I2C] Data at address 0xd : Write 0x34 : Read 0x44
    Failed [I2C] Data at address 0xe : Write 0x34 : Read 0x45
    Failed [I2C] Data at address 0xf : Write 0x44 : Read 0x46
    Failed [I2C] Data at address 0x10000 : Write 0x30 : Read 0x30
    Failed [I2C] Data at address 0x10001 : Write 0x31 : Read 0x31
    Failed [I2C] Data at address 0x10002 : Write 0x32 : Read 0x32
    Failed [I2C] Data at address 0x10003 : Write 0x33 : Read 0x33
    Failed [I2C] Data at address 0x10004 : Write 0x34 : Read 0x34
    Failed [I2C] Data at address 0x10005 : Write 0x35 : Read 0x35
    Failed [I2C] Data at address 0x10006 : Write 0x36 : Read 0x36
    Failed [I2C] Data at address 0x10007 : Write 0x37 : Read 0x37
    Failed [I2C] Data at address 0x10008 : Write 0x38 : Read 0x38
    Failed [I2C] Data at address 0x10009 : Write 0x39 : Read 0x39
    Failed [I2C] Data at address 0x1000a : Write 0x41 : Read 0x41
    Failed [I2C] Data at address 0x1000b : Write 0x42 : Read 0x42
    Failed [I2C] Data at address 0x1000c : Write 0x43 : Read 0x43
    Failed [I2C] Data at address 0x1000d : Write 0x44 : Read 0x44
    Failed [I2C] Data at address 0x1000e : Write 0x45 : Read 0x45
    Failed [I2C] Data at address 0x1000f : Write 0x46 : Read 0x46
    Some [I2C] tests have failed!!

    I believe the address is wrap-around when terminal count of 16-bit address. Initial write at [0] = 0x53 and later [10000] = 0x30. On the read both location have the same value 0x30 and so on.

    More over; from i2c_memory_read example; the "board.c" defines :

    uint16_t Board_i2cGetEepromMemAddr()
    {
        return EEPROM_MEM_ADDRESS;
    }
    On the "i2c.h", memAddr defines as 32-bit
    typedef struct {

        uint32_t            memAddr;
        /**< [IN] Memory address to write to or read from */
        uint8_t             memAddrSize;
        /**< [IN] Memory address size \ref I2CLLD_MemoryAddrSize */
        uint8_t             *buffer;
        /**< [IN] Pointer to Read or Write buffer */
        uint32_t            size;
        /**< [IN] Size of Read or Write buffer */
        uint8_t             memDataDir;
        /**< [IN] Target internal memory data direction \ref I2C_memTransactionDir*/
    } I2C_Mem_Transaction;
    And on the example file itself : 
    uint32_t        i2cEepromMemAddr;
    but this field is cast from 16-bit to 32-bit : 
    i2cEepromMemAddr = (uint32_t)Board_i2cGetEepromMemAddr();
    before apply it to : 
    mem_transaction.memAddrSize = i2cEepromAddrSize;
    ------------------------------------
    I suspect that in the low level interface A16 field of device address (first byte interface was not updated correctly) and keeps value = 0 always
  • Even after I changed on "board.c" from :  uint16_t Board_i2cGetEepromMemAddr() to 32-bit

     uint32_t Board_i2cGetEepromMemAddr()

    it still has the same problem

  • Hi,

    The assigned expert is out of office, please expect delayed responses.

    Regards,

    Vaibhav

  • Hi 

    Which board are you using? Is it AM64x-EVM or AM64x-SK?

    Regards,

    Tushar

    • If the file size is equal or less than 64KB (65536), then the file write and read back and compare passed.
    • If the file size is just more than 64KB even 1 byte or 2 bytes, the test would fail. Remember it fails either starting address:   #define EEPROM_MEM_ADDRESS = 0x0  or 0x400

    Looks like this is the expected behavior. Please refer  RE: AM6422: sdk8.6 iic write error for details. 

  • Well, other people has the similar issue and still having no resolution other than the limitation of the low level driver itself as per section 4.4.2.1.1.2 of TRM.

    Do we expect this to be fixed in the next SDK release for AM64x-EVM board? I am very sure that this is the limitation of the driver now as it shows the assignment of only 16-bit in "board.c" here : 

    uint16_t Board_i2cGetEepromMemAddr();   and as I indicted it is no avail even when change it to 32-bit     uint32_t Board_i2cGetEepromMemAddr()
    But the device itself AT24CM01 is 128KB. Do you expect the user to guard the boundary of 64KB and change the starting address from 0x0 to 65536 and continue for the next 64KB ?
    I could understand this phenomenon such as legacy in development when most of the devices supported are less than 64KB (example in SK64 board). However; there are more density devices such as :AT24CM02 (256KB) and if used will be a problem as well.
    Waiting for the right answer.
    Regards;
  • The low level driver for EEPROM handles the edge case also. Please try calling the low level EEPROM_AT24C_read() and EEPROM_AT24C_write() APIs.

    Please refer below image.