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.

RTOS/AM5718: Adding I2C support for custom board

Part Number: AM5718
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Prerequisite
Custom board, named P2HMI, built upon idkAM571x where some of the original functionality is keept to match oriignal code, for example the custom board have an EEPROM as the idkAM571x board
The board build itself is building without any under .../ti/pdk_am57xx_1_0_13
The SYS/BIOS project uses evm571X as target
The .cfg file have been modified with the following
 
 
/* Load the Board package and set the board name */
var Board = xdc.loadPackage('ti.board');
Board.Settings.boardName = "P2HMI";
 
And we added the following to the begginging of the main() function
 
    Board_init(BOARD_INIT_UNLOCK_MMR |
               BOARD_INIT_PLL |
               BOARD_INIT_MODULE_CLOCK |
               BOARD_INIT_DDR |
               BOARD_INIT_WATCHDOG_DISABLE |
               BOARD_INIT_PINMUX_CONFIG |
               BOARD_INIT_UART_STDIO |
               BOARD_INIT_ICSS_ETH_PHY
               );
    
When we compile the project we get the follwoing errors
    
makefile:145: recipe for target 'Test15.out' failed
C:\ti\pdk_am57xx_1_0_13\packages\ti\board\lib\P2HMI\a15\release\ti.board.aa15fg(idkAM571x_lld_init.oa15fg): In function `Board_internalInitI2C':
C:\ti\pdk_am57xx_1_0_13\packages\ti\board/src/P2HMI/idkAM571x_lld_init.c:56: undefined reference to `I2C_init'
C:\ti\pdk_am57xx_1_0_13\packages\ti\board/src/P2HMI/idkAM571x_lld_init.c:58: undefined reference to `I2C_Params_init'
C:\ti\pdk_am57xx_1_0_13\packages\ti\board/src/P2HMI/idkAM571x_lld_init.c:61: undefined reference to `I2C_open'
   
Which is due to the missing (we assume LLD level) I2C drivers
   
Question 1:
Is it correct understood that the functions I2C_init, I2C_Params_init and I2C_open belong to the LLD layer?
Which, in turn will call/use the drivers included in the board build, such how pinmux setup the SoC.
   
We copy the following from .../ti/pdk_am57xx_1_0_13/packages/ti/drv/uartuart/example/sample/am571x/m4/bios/uart_m4_idkAM571x.cfg into the our .cfg file
   
/*use CSL package*/
var socType           = "am571x";
var Csl = xdc.loadPackage('ti.csl');
Csl.Settings.deviceType = socType;
/* Load the I2C package */
var I2c    = xdc.loadPackage('ti.drv.i2c');
I2c.Settings.socType = socType;
   

Question 2:
Do we need to include the CSL layer?, is that not included in our custom board build ?
But then we get the following error?
   
generating custom ti.sysbios library makefile ...
 Linking with library ti.board:./lib/P2HMI/a15/release/ti.board.aa15fg
subdir_rules.mk:12: recipe for target 'build-615168287-inproc' failed
js: "C:/ti/pdk_am57xx_1_0_13/packages/ti/drv/i2c/package.xs", line 128: Error:  Library not found: C:/ti/pdk_am57xx_1_0_13/packages/ti/drv/i2c/./lib/am571x/a15/release/ti.drv.i2c.aa15fg
   
Question 3:
Do we have to build the LLD layer of the drivers as well ?
Regards
  • An update

    By reading other posts and some trial and error the project compiled and linked if the following was added 

      

    /*use CSL package*/
    var socType         = "am571x";
    var osType          = "tirtos";
     
    /*use CSL package*/
    var Csl = xdc.loadPackage('ti.csl');
    Csl.Settings.deviceType = socType;
     
    var Osal = xdc.useModule('ti.osal.Settings');
    Osal.osType = osType;
    Osal.socType = socType;
     
    /* Load the I2C package */
    var I2c    = xdc.loadPackage('ti.drv.i2c');
    I2c.Settings.socType = socType;
     
    /* Load the I2C package */
    var UART    = xdc.loadPackage('ti.drv.uart');
    UART.Settings.socType = socType;
     
    /* Load the Board package and set the board name */
    var Board = xdc.loadPackage('ti.board');
    Board.Settings.boardName = "P2HMI";

      

    Is it correct, not sure but it link at least

    Another post suggested to add the following

      

    var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
    var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
    /* Load Profiling package */
    var Utils = xdc.loadPackage('ti.utils.profiling');

      

    But it seems not to make any difference

  • Hi Stefan,

    Thanks for sharing the solution.

    Regards,
    Pavel