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.

AM2634-Q1: IIC configuration issue

Part Number: AM2634-Q1

Tool/software:

When our boot jumps to the APP, Cdd_I2c_DeInit() is not called;

The configuration of IIC in boot is:

I2C_ICPSC=7;

I2C_ICCLKL=9;

I2C_ICCLKH=9;

The configuration of IIC in the APP is:

I2C_ICPSC=0xB;

I2C_ICCLKL=5;

I2C_ICCLKH=5;

At this point, when testing the IIC frequency, it was found that it was 380Khz in boot and 520Khz in APP.

With the same configuration, when boot jumps to the APP, Cdd_I2c_DeInit() is called;At this point, when testing the IIC frequency, it was found that it was 380Khz in boot and 360Khz in APP.

We found that this phenomenon was caused by the IRS configuration in Cdd_I2c_DeInit(). After calling Cdd_I2c_DeInit(), IRS=0;This is normal at this time.

When boot jumps to the APP, if Cdd_I2c_DeInit() is not called, that is, when IRS=1, the three registers I2C_ICPSC, I2C_ICCLKL, and I2C_ICCLKH are modified, the modification should not take effect at this time. Why does the frequency change to 520Khz?

  • By the way, the frequencies mentioned above all refer to the SCL clock frequency of I2C

  • Hi,

    You mentioned usage of CDD I2C deinit in boot.

    Are you using MCAL drivers in your bootloader? May I know if your bootloader also runs on Autosar?

    Thanks and Regards,

    Nikhil Dasan

  • Hi,

    The Boot only uses MCAL.

  • Hi,

    Let me look into this and get back to you by tomorrow

    Thanks and Regards,

    Nikhil Dasan

  • Hi,

    Apologies for the delay in response here.

    In the MCAL driver flow, as shown below, the HW clock configuration would only be done if the deinit is called as per the state machine or called for the first time in application as 

      

    So, in your case, since you are using MCAL I2C driver at both Boot and App, you would have to deinit the same in boot before entering the application, else there would be reinitialization of I2C without deinit (where the behaviour could be unpredictable)

    So would you be able to call deinit in your BOOT itself or is there any specific requirement for not doing the same?

    Thanks and Regards,

    Nikhil Dasan

  • Hi

    Yes, we can call deinit in boot . We're just wondering how the 520kHz frequency appeared and whether it might be the unpredictable behavior you mentioned?

  • yes, as the I2C init is happening again in this case, (i.e. clock is being set without putting the I2C into reset) this is the cause of this behaviour.

    As part of fix, in the upcoming SDK, we would be calling Cdd_I2c_Disable_master(pCddI2cInitParams->CddI2cHwCfgPtr[i].HwInstance); just before doing Cdd_I2c_Setup_HW_Unit_Clk() in driver so that this would not occur.

    Thanks and Regards,

    Nikhil Dasan