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/LAUNCHXL-CC1310: Link error when using I2CSlave

Part Number: LAUNCHXL-CC1310
Other Parts Discussed in Thread: CC1310

Tool/software: TI-RTOS

I'm trying to use CC1310 as I2C slave.

TI-RTOS version: 

TI-RTOS for CC13xx and CC26xx  2.21.0.06

Compilation of my source works, but when linking, a particular object needed by TI-RTOS can't be resolved:

symbol: I2CSlave_config, 

first referenced in: products/tidrivers_cc13xx_cc26xx_2_21_00_04/packages/ti/drivers/lib/drivers_cc13xxware.aem3<I2CSlave.oem3>

error:

unresolved symbol I2CSlave_config, first referenced in C:/ti/tirex-content/tirtos_cc13xx_cc26xx_2_21_00_06/products/tidrivers_cc13xx_cc26xx_2_21_00_04/packages/ti/drivers/lib/drivers_cc13xxware.aem3<I2CSlave.oem3>

Code:

/* XDCtools Header files */
#include <xdc/std.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Error.h>
#include <xdc/cfg/global.h> // needed to get the global from the .cfg file

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

/* TI-RTOS Header files */
#include <ti/drivers/I2CSlave.h>

/* Example/Board Header files */
#include "Board.h"


uint8_t commandBuffer[10];
uint8_t mirrorRegister[100];

I2CSlave_Handle i2cSlave;

bool processBytes(uint8_t *command);

/*
 *  ======== fnTaskDisplay ========
 *  Handle (the optional) LCD display. The Task_sleep is determined by arg0 which
 *  is configured for the fnTaskDisplay Task instance.
 */
Void fnTaskI2CSlave(UArg arg0, UArg arg1) {

    I2CSlave_Params      i2cSlaveParams;
    int i = 0;

    /* Call driver init functions */

    I2CSlave_init();



    /* Initialize all buffers */
    for (i = 0;i < 10; i++) {
        /* Initializing the commandBuffer[0-9] = 0x00 */
        commandBuffer[i] = 0x00;
    }
    for (i = 0;i < 100; i++) {
        /* Initializing mirrorRegister[] with 1,2,3,....100 */
        mirrorRegister[i] = 0x55;
    }

    /* Create I2CSlave for usage */
    I2CSlave_Params_init(&i2cSlaveParams);
    i2cSlaveParams.transferMode = I2CSLAVE_MODE_BLOCKING;

    i2cSlave = I2CSlave_open(CC1310_LAUNCHXL_I2C0, &i2cSlaveParams);

    if (NULL == i2cSlave) {
//        log
    }

    /* Loop forever waiting for commands from master */
    while (1) {
        if (I2CSlave_read(i2cSlave, commandBuffer, 5))
            if (!processBytes(commandBuffer)) {
//                log
            }
    }


}

bool processBytes(uint8_t *command)
{
    bool retVal = true;

    switch (command[0])
    {
        /*
         * Command: GETSTATUS Cmd from Master.
         * command[0] = 0x01 [CMD]
         * Response: I2CSlave_write contents of mirrorRegister[0]
         * Content of mirrorRegister[0] is considered as Status byte
         */
        case 0x01:
            retVal = I2CSlave_write(i2cSlave, &mirrorRegister[0], 1);
            break;

        /*
         * Command: SETSTATUS Cmd from Master.
         * command[0] = 0x02 [CMD]
         * command[1] = Status value to be updated
         * Response: OverWrite content of mirrorRegister[0] with contents of
         * command[1]
         */
        case 0x02:
            mirrorRegister[0] = command[1];
            break;

         /*
         * READBLOCK Cmd from Master. I2CSlave_write requested bytes
         * of mirrorRegister
         * command[0] = 0x03 [READBLOCK CMD]
         * command[1] = start offset of bytes to be read from mirrorRegister
         * command[2] = numberOfBytes to be read
         * buffer
         */
        case 0x03:
            retVal = I2CSlave_write(i2cSlave, &mirrorRegister[command[1]],
                        command[2]);
            break;

         /*
         * Command: WRITEBLOCK Cmd from Master.
         * command[0] = 0x04 [CMD]
         * command[1] = start offset of bytes to be written to mirrorRegister
         * command[2] = numberOfBytes to be written
         * Response: Issue I2CSlave_read() to read command[2] number of bytes
         * from master
         */
        case 0x04:
            retVal = I2CSlave_read(i2cSlave, &mirrorRegister[command[1]],
                    command[2]);
            break;
    }

    return retVal;
}

  • Hi,

    there is no I2C Slave driver implementation for the CC13x0/CC26x0, but only for MSP432. That is why you cannot use the above structs. An I2C slave driver has been postponed due to lack of development resources and it is not clear if and when it is going to be released.

  • I assumed so, Richard. Thanks for the answer.
    The RTOS driver for CCxxxx (both CC1 and CC2) has a comment that slave isn't supported. The datasheet of the CC1310 says that the controller supports both i²c master and slave.

    Now go and get those missing development resources (hire me). The CC1310 is well positioned to be a slave that acts as a sub-1 GHz radio for a bigger design :)
  • I'm facing the same issue as Jan for CC26xx & TI-RTOS 2.21
    Is there any other way out ? besides waiting for TI to include it .

    Maybe using any old TI-RTOS that might have this support , like TI-RTOS 2.14 ?
  • Anurag Meena said:
    I'm facing the same issue as Jan for CC26xx & TI-RTOS 2.21
    Is there any other way out ? besides waiting for TI to include it .

    Yes, you could implement it on your own and then publish the result for others. You may have a look at this thread.