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.

AM5738: I2C compilation errors

Hello,

I have an error : #20 identifier "I2C_CON_MST_MASK" is undefined   

due to the fact that  pdk_am57xx_1_0_15\packages\ti\csl\src\ip\i2c\V2\i2c.h is using I2C_CON_MST_MASK but the including file <ti/csl/src/ip/i2c/V2/cslr_i2c.h> has changed this define in CSL_I2C_CON_MST_MASK. Similar errors have the same source: i2c.h uses defines without the prefix CSL_ and this mismatch with cslr_i2c.h generates compilation errors when i2c.h is included.

Best regards,

Scianni Vincenzo

  • Hi Vincenzo,

    I2C_CON_MST_MASK is defined in below header file:

    ti/csl/src/ip/i2c/V2/hw_i2c.h

    #define I2C_CON_MST_MASK    (0x00000400U)


    And this header file is included in ti/csl/cslr_i2c.h header file:

    #if defined(SOC_AM574x) || defined(SOC_AM572x)|| defined(SOC_AM571x) || defined (SOC_TDA2XX) || defined (SOC_TDA2PX) || defined(SOC_DRA75x) || defined(SOC_TDA2EX) || defined(SOC_DRA72x) || defined(SOC_TDA3XX) || defined(SOC_DRA78x) || defined(SOC_AM65XX) || defined (SOC_J7) || defined (SOC_AM77X)
    #include <ti/csl/src/ip/i2c/V2/cslr_i2c.h>
    #include <ti/csl/src/ip/i2c/V2/hw_i2c.h>



    And ti/csl/cslr_i2c.h header file is included in ti/csl/src/ip/i2c/V2/priv/i2c.c:

    #include "ti/csl/cslr_i2c.h"

     

    So we use two cslr_i2c.h files:

    ti/csl/cslr_i2c.h    - this one include hw_i2c.h, which define I2C_CON_MST_MASK

    ti/csl/src/ip/i2c/V2/cslr_i2c.h - this one define CSL_I2C_CON_MST_MASK

     

    For reference you can use below CSL I2C example (it is using I2C_CFG_MST_TX, which use I2C_CON_MST_MASK)

    ti/csl/example/i2c/i2c_led_blink/

    I am able to build that example with below commands:

    1. ~/ti/pdk_am57xx_1_0_15/packages$ source pdksetupenv.sh

    2. ~/ti/pdk_am57xx_1_0_15/packages/ti/csl$ make app_clean

    3. ~/ti/pdk_am57xx_1_0_15/packages/ti/csl$ make csl_i2c_led_blink_app


    The result is available at:

    ti/binary/csl_i2c_led_blink_app/