AM6422: sdk8.6 iic write error

Part Number: AM6422


Hello,

    We are developing with SDK 8.6, and under FreeRTOS, we have written a test program that writes to the EEPROM every 10ms at address 0xFF00 with data ranging from 0 to 100. Then, it reads back the data from this address for verification. Occasionally, the read data appears as 0, which is inconsistent with the written data. Currently, this error seems to occur with a relatively high probability specifically at address 0xFF00. The components used are consistent with the development board, and the code directly calls the library functions. 

uint16_t tmp1=0,tmp1Bak=0,tmpwdata=0x1234;
#define TestAddr 0xff01
uint16_t eetesti=0;
void eetest()
{
    uint16_t i=0;
    int32_t status = OK;
    if(EEPROM_read(gEepromHandle[CONFIG_EEPROM0],TestAddr,(uint8_t *)&tmp1,2)!= SystemP_SUCCESS)
    {
        DebugP_log("read error addr = %d\r\n",TestAddr);
    }
    DebugP_log("tmp1 = %d\r\n",tmp1);
    for(eetesti=0;eetesti<100;eetesti++)
    {
        wdg_cpld();
        status = EEPROM_write(gEepromHandle[CONFIG_EEPROM0], TestAddr, (const uint8_t*)&eetesti, 2);
        if(status != OK)
        {
            DebugP_log("===== write err = %d\r\n",TestAddr);
        }
        tmp1Bak = 0;
        if(EEPROM_read(gEepromHandle[CONFIG_EEPROM0],TestAddr,(uint8_t *)&tmp1Bak,2)!= SystemP_SUCCESS)
        {
            DebugP_log("read tmp1Bak error addr = %d\r\n",TestAddr);
        }
        if(eetesti!=tmp1Bak)
        {
            DebugP_log("write err i= %d,tmp1Bak = %d\r\n",eetesti,tmp1Bak);
            EEPROM_read(gEepromHandle[CONFIG_EEPROM0],TestAddr,(uint8_t *)&tmp1Bak,2);
        }
    }
}

  • Hi,

    Which device are you using? AM64x-EVM or AM64x-SK?

    What is the slave address used here?

    Regards,

    Tushar

  • Hello,

        The EVM is being used with address 0x50, equipped with a 128K at24cm1 model, and the write address is set to 0xff00.

  • Hi,

    Thanks for providing above details. I will try to reproduce the issue at my end.

    Please specify which core are you using?

    Regards,

    Tushar

  • Hello,

        Using the AM6422 SDK 8.6, on the R5F0-0 core under FreeRTOS, the slave address is 0x50, and the EEPROM size is 128KB.

  • Hello,

        Does SDK8.6 have any issues with the I2C interface for the AT24C series EEPROM, and will there be any changes to this part in the future?

  • Hello,

    Can you please share your example.syscfg file with us?

    Regards,

    Tushar

  •     All right, I'll send the configuration to you.

        

    /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "AM64x_beta" --package "ALV" --part "Default" --context "r5fss0-0" --product "MCU_PLUS_SDK_AM64x@08.06.00"
     * @versions {"tool":"1.14.0+2667"}
     */
    
    /**
     * Import the modules used in this configuration.
     */
    const eeprom        = scripting.addModule("/board/eeprom/eeprom", {}, false);
    const eeprom1       = eeprom.addInstance();
    const flash         = scripting.addModule("/board/flash/flash", {}, false);
    const flash1        = flash.addInstance();
    const ecap          = scripting.addModule("/drivers/ecap/ecap", {}, false);
    const ecap1         = ecap.addInstance();
    const gpio          = scripting.addModule("/drivers/gpio/gpio", {}, false);
    const gpio1         = gpio.addInstance();
    const i2c           = scripting.addModule("/drivers/i2c/i2c", {}, false);
    const i2c1          = i2c.addInstance();
    const i2c2          = i2c.addInstance();
    const pruicss       = scripting.addModule("/drivers/pruicss/pruicss", {}, false);
    const pruicss1      = pruicss.addInstance();
    const uart          = scripting.addModule("/drivers/uart/uart", {}, false);
    const uart1         = uart.addInstance();
    const uart2         = uart.addInstance();
    const udma          = scripting.addModule("/drivers/udma/udma", {}, false);
    const udma1         = udma.addInstance();
    const freertos_fat  = scripting.addModule("/fs/freertos_fat/freertos_fat", {}, false);
    const freertos_fat1 = freertos_fat.addInstance();
    const clock         = scripting.addModule("/kernel/dpl/clock");
    const debug_log     = scripting.addModule("/kernel/dpl/debug_log");
    const mpu_armv7     = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
    const mpu_armv71    = mpu_armv7.addInstance();
    const mpu_armv72    = mpu_armv7.addInstance();
    const mpu_armv73    = mpu_armv7.addInstance();
    const mpu_armv74    = mpu_armv7.addInstance();
    const mpu_armv75    = mpu_armv7.addInstance();
    const mpu_armv76    = mpu_armv7.addInstance();
    const timer         = scripting.addModule("/kernel/dpl/timer", {}, false);
    const timer1        = timer.addInstance();
    const timer2        = timer.addInstance();
    const timer3        = timer.addInstance();
    const enet_cpsw     = scripting.addModule("/networking/enet_cpsw/enet_cpsw", {}, false);
    const enet_cpsw1    = enet_cpsw.addInstance();
    
    /**
     * Write custom configuration values to the imported modules.
     */
    eeprom1.$name = "CONFIG_EEPROM0";
    
    flash1.$name                  = "CONFIG_FLASH0";
    flash1.peripheralDriver.$name = "CONFIG_OSPI0";
    
    ecap1.$name = "CONFIG_ECAP0";
    
    gpio1.$name                    = "CONFIG_GPIO0";
    gpio1.pinDir                   = "OUTPUT";
    gpio1.useMcuDomainPeripherals  = true;
    gpio1.MCU_GPIO.$assign         = "MCU_GPIO0";
    gpio1.MCU_GPIO.gpioPin.$assign = "ball.A7";
    
    i2c1.$name               = "CONFIG_I2C0";
    eeprom1.peripheralDriver = i2c1;
    i2c1.I2C.$assign         = "I2C0";
    
    i2c2.$name           = "CONFIG_I2C1";
    i2c2.I2C.$assign     = "I2C1";
    i2c2.I2C.SCL.$assign = "ball.C18";
    i2c2.I2C.SDA.$assign = "ball.B19";
    
    pruicss1.$name                           = "CONFIG_PRU_ICSS1";
    pruicss1.instance                        = "ICSSG1";
    pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0";
    
    uart1.$name            = "CONFIG_UART0";
    uart1.baudRate         = 9600;
    uart1.intrEnable       = "DISABLE";
    uart1.UART.$assign     = "USART3";
    uart1.UART.RXD.$assign = "ball.D16";
    uart1.UART.TXD.$assign = "ball.E16";
    
    uart2.$name            = "CONFIG_UART1";
    uart2.intrEnable       = "DISABLE";
    uart2.baudRate         = 9600;
    uart2.UART.$assign     = "USART2";
    uart2.UART.RXD.$assign = "ball.B16";
    uart2.UART.TXD.$assign = "ball.A16";
    
    freertos_fat1.$name                  = "CONFIG_FREERTOS_FAT0";
    freertos_fat1.media                  = "EMMC";
    freertos_fat1.peripheralDriver.$name = "CONFIG_MMCSD0";
    
    debug_log.enableCssLog  = false;
    debug_log.enableUartLog = true;
    debug_log.uartLog.$name = "CONFIG_UART2";
    
    mpu_armv71.$name        = "CONFIG_MPU_REGION0";
    mpu_armv71.size         = 31;
    mpu_armv71.attributes   = "Device";
    mpu_armv71.allowExecute = false;
    
    mpu_armv72.$name = "CONFIG_MPU_REGION1";
    mpu_armv72.size  = 15;
    
    mpu_armv73.$name    = "CONFIG_MPU_REGION2";
    mpu_armv73.baseAddr = 0x41010000;
    mpu_armv73.size     = 15;
    
    mpu_armv74.$name    = "CONFIG_MPU_REGION3";
    mpu_armv74.size     = 23;
    mpu_armv74.baseAddr = 0x70000000;
    
    mpu_armv75.$name    = "CONFIG_MPU_REGION4";
    mpu_armv75.size     = 31;
    mpu_armv75.baseAddr = 0x80000000;
    
    mpu_armv76.$name        = "CONFIG_MPU_REGION5";
    mpu_armv76.baseAddr     = 0x50000000;
    mpu_armv76.size         = 27;
    mpu_armv76.attributes   = "Device";
    mpu_armv76.allowExecute = false;
    
    timer1.$name         = "CONFIG_TIMER0";
    timer1.timerCallback = "AD5711";
    timer1.usecPerTick   = 500;
    timer1.clkSource     = "MAIN_PLL0_HSDIV7_CLKOUT";
    timer1.intrPriority  = 1;
    
    timer2.$name     = "CONFIG_TIMER1";
    timer2.clkSource = "MAIN_PLL0_HSDIV7_CLKOUT";
    
    timer3.$name           = "CONFIG_TIMER2";
    timer3.timerInputClkHz = 200000000;
    timer3.clkSource       = "MAIN_PLL0_HSDIV7_CLKOUT";
    timer3.startTimer      = true;
    timer3.enableIntr      = false;
    timer3.usecPerTick     = 1000000;
    
    enet_cpsw1.$name                        = "CONFIG_ENET_CPSW0";
    enet_cpsw1.PktInfoOnlyEnable            = true;
    enet_cpsw1.mdioMode                     = "MDIO_MODE_MANUAL";
    enet_cpsw1.macOnlyEn_macPort1           = true;
    enet_cpsw1.macOnlyEn_macPort2           = true;
    enet_cpsw1.macOnlyEn_hostPort           = true;
    enet_cpsw1.PktInfoOnlyCount             = 64;
    enet_cpsw1.LargePoolPktCount            = 192;
    enet_cpsw1.txDmaChannel[0].$name        = "ENET_DMA_TX_CH0";
    enet_cpsw1.txDmaChannel[0].PacketsCount = 64;
    enet_cpsw1.rxDmaChannel[0].$name        = "ENET_DMA_RX_CH0";
    enet_cpsw1.rxDmaChannel[0].macAddrCount = 2;
    enet_cpsw1.rxDmaChannel[0].PacketsCount = 192;
    enet_cpsw1.pinmux[0].$name              = "ENET_CPSW_PINMUX0";
    enet_cpsw1.pinmux[0].MDIO.$assign       = "MDIO0";
    enet_cpsw1.pinmux[0].MDIO.MDC.$assign   = "ball.R2";
    enet_cpsw1.pinmux[0].MDIO.MDIO.$assign  = "ball.P5";
    enet_cpsw1.pinmux[0].RGMII1.$assign     = "RGMII1";
    enet_cpsw1.pinmux[0].RGMII1.RD0.$assign = "ball.AA13";
    enet_cpsw1.pinmux[0].RGMII1.RD1.$assign = "ball.U12";
    enet_cpsw1.pinmux[0].RGMII2.$assign     = "RGMII2";
    enet_cpsw1.netifInstance.create(2);
    enet_cpsw1.netifInstance[0].$name       = "NETIF_INST_ID0";
    enet_cpsw1.netifInstance[1].$name       = "NETIF_INST_ID1";
    enet_cpsw1.netifInstance[1].isDefault   = false;
    
    enet_cpsw1.udmaDrv = udma1;
    
    /**
     * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
     * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
     * re-solve from scratch.
     */
    flash1.peripheralDriver.OSPI.$suggestSolution        = "OSPI0";
    flash1.peripheralDriver.OSPI.CLK.$suggestSolution    = "ball.N20";
    flash1.peripheralDriver.OSPI.CSn0.$suggestSolution   = "ball.L19";
    flash1.peripheralDriver.OSPI.DQS.$suggestSolution    = "ball.N19";
    flash1.peripheralDriver.OSPI.D7.$suggestSolution     = "ball.M17";
    flash1.peripheralDriver.OSPI.D6.$suggestSolution     = "ball.N18";
    flash1.peripheralDriver.OSPI.D5.$suggestSolution     = "ball.P20";
    flash1.peripheralDriver.OSPI.D4.$suggestSolution     = "ball.P21";
    flash1.peripheralDriver.OSPI.D3.$suggestSolution     = "ball.M21";
    flash1.peripheralDriver.OSPI.D2.$suggestSolution     = "ball.M20";
    flash1.peripheralDriver.OSPI.D1.$suggestSolution     = "ball.M18";
    flash1.peripheralDriver.OSPI.D0.$suggestSolution     = "ball.M19";
    ecap1.ECAP.$suggestSolution                          = "ECAP0";
    ecap1.ECAP.IN_APWM_OUT.$suggestSolution              = "ball.D18";
    i2c1.I2C.SCL.$suggestSolution                        = "ball.A18";
    i2c1.I2C.SDA.$suggestSolution                        = "ball.B18";
    freertos_fat1.peripheralDriver.MMC0.$suggestSolution = "MMC0";
    debug_log.uartLog.UART.$suggestSolution              = "USART0";
    debug_log.uartLog.UART.RXD.$suggestSolution          = "ball.D15";
    debug_log.uartLog.UART.TXD.$suggestSolution          = "ball.C16";
    timer1.TIMER.$suggestSolution                        = "DMTIMER2";
    timer2.TIMER.$suggestSolution                        = "DMTIMER1";
    timer3.TIMER.$suggestSolution                        = "DMTIMER0";
    enet_cpsw1.pinmux[0].RGMII1.RD2.$suggestSolution     = "ball.Y13";
    enet_cpsw1.pinmux[0].RGMII1.RD3.$suggestSolution     = "ball.V12";
    enet_cpsw1.pinmux[0].RGMII1.RX_CTL.$suggestSolution  = "ball.V13";
    enet_cpsw1.pinmux[0].RGMII1.RXC.$suggestSolution     = "ball.W13";
    enet_cpsw1.pinmux[0].RGMII1.TD0.$suggestSolution     = "ball.V15";
    enet_cpsw1.pinmux[0].RGMII1.TD1.$suggestSolution     = "ball.V14";
    enet_cpsw1.pinmux[0].RGMII1.TD2.$suggestSolution     = "ball.W14";
    enet_cpsw1.pinmux[0].RGMII1.TD3.$suggestSolution     = "ball.AA14";
    enet_cpsw1.pinmux[0].RGMII1.TX_CTL.$suggestSolution  = "ball.U15";
    enet_cpsw1.pinmux[0].RGMII1.TXC.$suggestSolution     = "ball.U14";
    enet_cpsw1.pinmux[0].RGMII2.RD0.$suggestSolution     = "ball.W11";
    enet_cpsw1.pinmux[0].RGMII2.RD1.$suggestSolution     = "ball.V11";
    enet_cpsw1.pinmux[0].RGMII2.RD2.$suggestSolution     = "ball.AA12";
    enet_cpsw1.pinmux[0].RGMII2.RD3.$suggestSolution     = "ball.Y12";
    enet_cpsw1.pinmux[0].RGMII2.RX_CTL.$suggestSolution  = "ball.W12";
    enet_cpsw1.pinmux[0].RGMII2.RXC.$suggestSolution     = "ball.U11";
    enet_cpsw1.pinmux[0].RGMII2.TD0.$suggestSolution     = "ball.AA10";
    enet_cpsw1.pinmux[0].RGMII2.TD1.$suggestSolution     = "ball.V10";
    enet_cpsw1.pinmux[0].RGMII2.TD2.$suggestSolution     = "ball.U10";
    enet_cpsw1.pinmux[0].RGMII2.TD3.$suggestSolution     = "ball.AA11";
    enet_cpsw1.pinmux[0].RGMII2.TX_CTL.$suggestSolution  = "ball.Y11";
    enet_cpsw1.pinmux[0].RGMII2.TXC.$suggestSolution     = "ball.Y10";
    

  • Thanks for sharing the example.syscfg file. I have checked the above and it looks okay.

    I have tried the same on my setup and it is working. I am able to read and write the data.

    Please compare the below project with yours and confirm it this works.

    Project - empty_am64x-evm_r5fss0-0_nortos_ti-arm-clang.zip

  • Hello,

        Based on our configuration and code, most read/write operations function normally. However, there occasionally occurs an issue where data read back after being written to address 0xff00 is incorrect. We are currently unsure if this is caused by a potential bug in the driver or a hardware issue. Therefore, we would like to inquire whether there have been any later modifications to the EEPROM driver or if similar types of issues have been encountered before.

        In fact, the hardware design is completely identical to that of the EVM development board, but for our own designed hardware, currently 3 out of 5 boards are experiencing this issue. We are also unsure if there are any special operations associated with address 0xff00.

  • One additional note: the example program from your end performs writes only once. The phenomenon I mentioned is intermittent and not consistent. So, is it possible that you haven't encountered it because the number of operations performed was too low?

  • Please confirm you are not passing the read size to be more than 0x100. Please refer below image.

    Therefore, we would like to inquire whether there have been any later modifications to the EEPROM driver or if similar types of issues have been encountered before.

    There are no modifications done and we have not faced this issue earlier.

    Regards,

    Tushar

  • Hello,

        Thanks for your reply.We have confirmed the data you provided. The write length is only 2 bytes, which does not exceed the specified size.

  • How many task are you running in your application?

    Have you tried replicating it with single task?

    Please provide a sample project which can replicate the above behavior on TI EVM.

  • Hi,

        Thank you for your reply. We are currently running only one task, which periodically writes 2 bytes to address 0xff00 in the EEPROM. Based on our tests, the issue appears to be related to the component itself. After swapping the components, we found that the phenomenon follows the specific component, so the root cause of this problem should now be identified.

  • Hello,

    Thanks for your reply.

    After swapping the components, we found that the phenomenon follows the specific component, so the root cause of this problem should now be identified.

    Does this means you have replaced the EEPROM with some other component and the issue doesn't appear?

    If this is the case, then the issue might be with the At24CM01 EEPROM provided via microchip. Please reach to Microchip support on EEPROM behavior.

  • Hello,

        Yes, you are correct in your understanding.

  • Hi,

    The assigned expert is currently out of office. Please expect delayed responses.

    Thanks for your patience.

    Regards,

    Vaibhav

  • Hello,

        We've recently made a discovery. Previously, it was reported that there were read-write errors with the EEPROM connected via the IIC interface on the AM6422. The hardware personnel removed the AT24C device that had experienced this issue and soldered it onto an STM32F407 hardware setup. Using a program that simulated the IIC interface, they found that the read-write operations were very stable. This phenomenon suggests that the issue might not lie with the device itself. Could there be an error in the driver library? Or is there a possibility related to the hardware design? The hardware design strictly follows the schematic of the evaluation board. We hope you can help us analyze this.

  • Hi,

    Thanks for sharing the detailed insights.

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

    Regards,

    Vaibhav