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.

EnableModuleClock on I2C2 stops software from running on AM335X.

Hi all,

I'm trying to get three I2C interfaces running on my custom AM335X board using AM335X_StarterWare_02_00_01_01.  I2C0 and I2C1 both configure just fine, but when I use the enableModuleClock call on I2C2 the software stops at that location.  I've seen references stating that I2C2 is already enabled, but that does not seem to be the case.  I've also found some references stating that a patch is required, but they seem to revolve around linux.  Has anyone used starterware to get I2C2 working?  

Any help will be greatly appreciated.

Jeff

  • Moving this to the Starterware forum.

  • Hi Jeff,

    enableModuleClock function does not support the I2C2 instance. You can add the support my updating the ModuleClockList table with the relevant details for the instance using the I2C1 instance as reference.

    Additionaly you can refer some functions to enable clocks like I2C1ModuleClkConfig defined at platform/evmskAM335x/hsi2c.c

    The below code should work for I2C2 which is similar to I2C0 and I2C1 Clock implementation

     HWREG(SOC_PRCM_REGS + CM_PER_I2C2_CLKCTRL) |=

    CM_PER_I2C2_CLKCTRL_MODULEMODE_ENABLE;

    while((HWREG(SOC_PRCM_REGS + CM_PER_I2C2_CLKCTRL) &

         CM_PER_I2C2_CLKCTRL_MODULEMODE) != CM_PER_I2C2_CLKCTRL_MODULEMODE_ENABLE);

    while(!(HWREG(SOC_PRCM_REGS + CM_PER_L4LS_CLKSTCTRL) &

           (CM_PER_L4LS_CLKSTCTRL_CLKACTIVITY_L4LS_GCLK |

            CM_PER_L4LS_CLKSTCTRL_CLKACTIVITY_I2C_FCLK)));

    Regards

    Anant Pai

  • Anant,

    That worked.  Thanks.

    Jeff