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.

CCS/66AK2H14: CCS/66AK2H14

Part Number: 66AK2H14
Other Parts Discussed in Thread: 66AK2H12

Tool/software: Code Composer Studio

Hi,

Iam using CCSV6.1.3 and ti-processor-sdk-rtos-k2hk-evm-03.02.00.05-Windows-x86-Install .

while building EEPROM test example Iam getting below errors

I have included the header files . I have attached my source code.

0081.main.c
#include <xdc/std.h>
#include <xdc/cfg/global.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Error.h>

/* BIOS Header files */
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>


#include <stdio.h>
#include <string.h>

/* TI-RTOS Header files */
#include <ti/board/src/bbbAM335x/include/board_cfg.h>
#include <ti/drv/i2c/I2C.h>
#include <ti/drv/i2c/soc/I2C_soc.h>
#include <ti/board/src/evmKeystone/include/board_utils.h>
#include <ti/drv/i2c/test/eeprom_read/src/I2C_log.h>
#include <ti/drv/i2c/test/eeprom_read/src/I2C_board.h>
//#include <board_cfg.h>
#define I2C_TRANSACTION_TIMEOUT 1000
char eeprom_data[I2C_EEPROM_RX_LENGTH];
bool CompareData(char *expData, char *rxData, unsigned int length);


/*
 *  ======== Board_initI2C ========
 */
void Board_initI2C(void)
{
    Board_initCfg boardCfg;

    I2C_HwAttrs i2c_cfg;

    /* Get the default I2C init configurations */
    I2C_socGetInitCfg(I2C_EEPROM_INSTANCE, &i2c_cfg);

    /* Modify the default I2C configurations if necessary */

    /* Set the default I2C init configurations */
    I2C_socSetInitCfg(I2C_EEPROM_INSTANCE, &i2c_cfg);

    boardCfg = BOARD_INIT_PINMUX_CONFIG |
        BOARD_INIT_MODULE_CLOCK |
        BOARD_INIT_UART_STDIO;
 Board_init(boardCfg);
}

void i2c_test(UArg arg0, UArg arg1)

{
    I2C_Params i2cParams;
    I2C_Handle handle = NULL;
    I2C_Transaction i2cTransaction;
    char txBuf[I2C_EEPROM_TEST_LENGTH + I2C_EEPROM_ADDR_SIZE] = {0x00, };
    char rxBuf[I2C_EEPROM_TEST_LENGTH];
    bool status_400kbps;
    int16_t status;



    Board_initI2C();


    /* Set the I2C EEPROM write/read address */
    txBuf[0] = (I2C_EEPROM_TEST_ADDR >> 8) & 0xff; /* EEPROM memory high address byte */
    txBuf[1] = I2C_EEPROM_TEST_ADDR & 0xff;        /* EEPROM memory low address byte */

    I2C_init();

    I2C_Params_init(&i2cParams);

    /* BitRate : 400 Kbps */
    i2cParams.bitRate = I2C_400kHz;

    handle = I2C_open(I2C_EEPROM_INSTANCE, &i2cParams);

 memcpy(&txBuf[I2C_EEPROM_ADDR_SIZE],eeprom_data, I2C_EEPROM_TEST_LENGTH);
    I2C_transactionInit(&i2cTransaction);
    i2cTransaction.slaveAddress = I2C_EEPROM_ADDR;
    i2cTransaction.writeBuf = (uint8_t *)&txBuf[0];
    i2cTransaction.writeCount = I2C_EEPROM_TEST_LENGTH + I2C_EEPROM_ADDR_SIZE;
    i2cTransaction.readBuf = NULL;
    i2cTransaction.readCount = 0;
    i2cTransaction.timeout   = I2C_TRANSACTION_TIMEOUT;
    status = I2C_transfer(handle, &i2cTransaction);

    if(I2C_STS_SUCCESS != status)
    {
        I2C_log("\n I2C Test: 400Kbps: Write Data Transfer failed. \n");

    }

    BOARD_delay(100);
    memset(rxBuf, 0, I2C_EEPROM_TEST_LENGTH);
    I2C_transactionInit(&i2cTransaction);
    i2cTransaction.slaveAddress = I2C_EEPROM_ADDR;
    i2cTransaction.writeBuf = (uint8_t *)&txBuf[0];
    i2cTransaction.writeCount = I2C_EEPROM_ADDR_SIZE;
    i2cTransaction.readBuf = (uint8_t *)&rxBuf[0];
    i2cTransaction.readCount = I2C_EEPROM_TEST_LENGTH;
    i2cTransaction.timeout   = I2C_TRANSACTION_TIMEOUT;
    status = I2C_transfer(handle, &i2cTransaction);

    if(I2C_STS_SUCCESS != status)
    {
        I2C_log("\n I2C Test: 400Kbps: Read Data Transfer failed. \n");
    }

    I2C_close(handle);
 status_400kbps = CompareData(&eeprom_data[0], &rxBuf[0], I2C_EEPROM_TEST_LENGTH);
    if(TRUE == status_400kbps)
    {
        I2C_log("\n I2C Test: 400Kbps: PASS \n");
    }
    else
    {
        I2C_log("\n I2C Test: 400Kbps: Data Mismatch \n");
    }


}
/*
 *  ======== main ========
 */
int main(void)
{
    Board_initI2C();

    Task_Handle task;
    Error_Block eb;

    Error_init(&eb);

    task = Task_create(i2c_test, NULL, &eb);
    if (task == NULL) {
        System_printf("Task_create() failed!\n");
        BIOS_exit(0);
    }


    /* Start BIOS */
    BIOS_start();
    return (0);
}

bool CompareData(char *expData, char *rxData, unsigned int length)
{
    uint32_t idx = 0;
    uint32_t match = 1;
    bool retVal = false;

    for(idx = 0; ((idx < length) && (match != 0)); idx++)
    {
        if(*expData != *rxData) match = 0;
        expData++;
        rxData++;
    }

    if(match == 1) retVal = true;

    return retVal;

}

Please help me to solve these errors.

Thank you

  • Hi,

    I've notified the RTOS team. Their feedback will be posted directly here.

    Best Regards,
    Yordan
  • Hi,

    Please clarify what exact test project you tried to build, is it I2C_BasicExample_K2H_Evm_c66xExampleProject or I2C_BasicExample_K2H_Evm_c66xTestProject or something else?

    The build error showed that you don't have borad, I2C, UART libraries linked, did you put them in your .cfg file?

    Regards, Eric
  • Hi , Thank you
    I am trying to build C:\ti\pdk_k2hk_4_0_4\packages\ti\drv\i2c\test\eeprom_read\src
    I dont know how to add Board, I2C and UART in .cfg file .
    Please help me with this
    Regards ,
    Mahima shanbag
  • Hi,

    Please follow the processors.wiki.ti.com/.../Rebuilding_The_PDK to use the script creating I2C test CCS project. The .cfg contains the libraries requested.

    Regards, Eric
  • Hi

    Thank you for suggestion

    I have gone through the link

    when i give gmake  i2c_clean

    *************************************************************************

    C:\ti\pdk_k2hk_4_0_4\packages>gmake i2c_clean

    gmake -C ./ti/drv/i2c clean

    gmake[1]: Entering directory `C:/ti/pdk_k2hk_4_0_4/packages/ti/drv/i2c'

    gmake clean_libcores SOC=k2h

    process_begin: CreateProcess(C:\ti\xdctools_3_32_01_22_core\gmake.exe, gmake clean_libcores SOC=k2h, ...) failed.

    make (e=234): More data is available.

    gmake[1]: *** [k2h_lclean] Error 234

    gmake[1]: Leaving directory `C:/ti/pdk_k2hk_4_0_4/packages/ti/drv/i2c'

    gmake: *** [i2c_clean] Error 2

    C:\ti\pdk_k2hk_4_0_4\packages>

    and For pdkprojectceate.bat

    C:\ti\pdk_k2hk_4_0_4\packages> pdkProjectCreate.bat K2H all little i2c example arm

    =========================================================================

    Configuration:

      SOC             :   K2H

      BOARD           :   all

      ENDIAN          :   little

      MODULE          :   i2c

      PROCESSOR       :   example

      PDK_SHORT_NAME  :   arm

    =========================================================================

    Checking Configuration...

    ERROR: Processor (example) is invalid

    Exiting...

    =========================================================================

    C:\ti\pdk_k2hk_4_0_4\packages>

    when I try to import project in C:\ti\pdk_k2hk_4_0_4\packages\ti\drv\i2c\test\src

    please help me to solve the errors and I didnt get any information about how to add I2C .cfg file.

  • First you don't need to gmake i2c_clean, unless you want to rebuild the i2c library.

    Second, please download the latest Processor SDK 4.1 and try. The syntax for creating project are slightly different for earlier release.

    If you used 4.0.4 or 4.0.5,

    C:\ti\pdk_k2hk_4_0_5\packages>pdkProjectCreate.bat K2H all little i2c arm

    =========================================================================

    Configuration:

      SOC             :   K2H

      BOARD           :   all

      ENDIAN          :   little

      MODULE          :   i2c

      PROCESSOR       :   arm

      PDK_SHORT_NAME  :   C:\ti\PD0581~1\packages\

    =========================================================================

    Checking Configuration...

    Complete

    =========================================================================

      PDK_PARTNO         : TCI6636

      PDK_ECLIPSE_ID     : com.ti.pdk.k2hk

      RTSC_PLATFORM_NAME : ti.platforms.evmTCI6636K2H

      RTSC_TARGET        : gnu.targets.arm.A15F

      CCS_DEVICE         : "Cortex A.66AK2H12"

    *****************************************************************************

    Detecting all projects in PDK and importing them in the workspace C:\ti\PD0581~1

    \packages\\MyExampleProjects

    Detected Test Project: I2C_BasicExample_K2H_armExampleProject

    --------------------------------------------------------------------------------

    Creating project 'I2C_BasicExample_K2H_armExampleProject'...

    Done!

    Copying macro.ini

           1 file(s) copied.

    Detected Test Project: I2C_BasicExample_K2H_armTestProject

    --------------------------------------------------------------------------------

    Creating project 'I2C_BasicExample_K2H_armTestProject'...

    Done!

    Copying macro.ini

           1 file(s) copied.

    No projects detected

    Project generation complete

    *****************************************************************************

    C:\ti\pdk_k2hk_4_0_5\packages>

    Regards, Eric

  • Hi ,
    I have installed new version of sdk ti-processor-sdk-rtos-k2hk-evm-04.01.00.06-Windows-x86-Install and I tried running the copmmand

    C:\ti\pdk_k2hk_4_0_7\packages>pdkProjectCreate.bat K2H all little i2c arm
    =========================================================================
    Configuration:
    SOC : K2H
    BOARD : all
    ENDIAN : little
    MODULE : i2c
    PROJECT_TYPE : arm
    PROCESSOR : arm
    PDK_SHORT_NAME : C:\ti\PDK_K2~2\packages\
    =========================================================================
    Checking Configuration...
    ERROR: Project type (arm) is invalid
    Exiting...
    =========================================================================

    C:\ti\pdk_k2hk_4_0_7\packages>


    I am not able to find what is going wrong. Please help me to solve.
  • Use: pdkProjectCreate.bat K2H all little i2c all arm

    See 

    Regards, Eric

  • Hi

    Thank you Eric.

    pdkProjectCreate.bat K2H all little i2c all arm   this worked for I2C and project is created.

    but when i give pdkProjectCreate.bat K2H all little hyplnk all arm   it didn't  give me any error but at the same time project is also not created. I have attached the screen shot.

     

    Please help me with this.


    Thanks and Regards,

    Mahima Shanbag

  • Hi,

    For Hyperlink on K2H, there is no ARM example project. You need to use pdkProjectCreate.bat K2H all little hyplnk all dsp.

    Regards, Eric