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.

struct incomplete type error by using CodeComposer

Other Parts Discussed in Thread: CODECOMPOSER, CC2530

I try to compile CC2530 ZNP library with CodeComposer 5.2 and want to compile it for Stellaris but always I get error mesages by using struct from ZNP library.

At file application_configuration.h in folder ZNP there is a struct called applicationConfiguratio. I attached this file.

1731.application_configuration.h

/**
* @file application_configuration.c
*
* @brief Contains Zigbee Application Configuration methods. 
*
* This is used by both Simple API and AFZDO to configure the ZNP for the particular application.
* Simple API can register one applicationConfiguration; AFZDO can register multiple applicationConfigurations.
* Refer to Interface Specification for more information.
* 
* @see sapiRegisterApplication()
* @see afRegisterApplication()
*
* @see http://processors.wiki.ti.com/index.php/Tutorial_on_the_Examples and http://e2e.ti.com/support/low_power_rf/default.aspx
*
* $Rev: 586 $
* $Author: dsmith $
* $Date: 2010-06-11 10:17:22 -0700 (Fri, 11 Jun 2010) $
*
* YOU ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE PROVIDED �AS IS� WITHOUT WARRANTY 
* OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, 
* TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL TEXAS INSTRUMENTS 
* OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, 
* BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
* INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, 
* LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY 
* CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
*/
#include "../HAL/hal.h"
#include "application_configuration.h"  


/** Creates an application configuration for a Coordinator.
Modify the values in this for your application.
@return the applicationConfiguration for a router
@see applicationConfiguration */
struct applicationConfiguration getApplicationConfigurationForCoordinator()
{
    printf("Getting Application Configuration For Coordinator\r\n");       
    struct applicationConfiguration ac;
    ac.endPoint =                       DEFAULT_ENDPOINT;       //must be same for all devices on the network
    ac.profileId =                      DEFAULT_PROFILE_ID;     //must be same for all devices on the network
    ac.deviceId =                       DEVICE_ID;              //doesn't matter
    ac.deviceVersion =                  DEVICE_VERSION;         //doesn't matter
    ac.latencyRequested =               LATENCY_NORMAL;
    ac.numberOfBindingInputClusters =   1; 
    ac.bindingInputClusters[0] =        0x0001;    
    ac.numberOfBindingOutputClusters =  0;   
    return ac;
}

/** Creates an application configuration for a Router. 
Modify the values in this for your application.
@return the applicationConfiguration for a router
@see applicationConfiguration */
struct applicationConfiguration getApplicationConfigurationForRouter()
{
    printf("Getting Application Configuration For Router\r\n");    
    struct applicationConfiguration ac;
    ac.endPoint =                       DEFAULT_ENDPOINT;       //must be same for all devices on the network
    ac.profileId =                      DEFAULT_PROFILE_ID;     //must be same for all devices on the network
    ac.deviceId =                       DEVICE_ID;              //doesn't matter
    ac.deviceVersion =                  DEVICE_VERSION;         //doesn't matter
    ac.latencyRequested =               LATENCY_NORMAL;
    ac.numberOfBindingInputClusters =   0;   
    ac.numberOfBindingOutputClusters =  1; //1 
    ac.bindingOutputClusters[0] =       0x0001;
    return ac;
}

/** Displays the applicationConfiguration in a human readable format
@param ac the applicationConfiguration to print
@see applicationConfiguration */
void printApplicationConfiguration(struct applicationConfiguration ac)
{
    printf("Application Configuration:\r\n");    
    printf("    endpoint = 0x%02X\r\n", ac.endPoint);
    printf("    profileId = 0x%04X\r\n", ac.profileId);
    printf("    deviceId = 0x%04X\r\n", ac.deviceId);
    printf("    deviceVersion = 0x%04X\r\n", ac.deviceVersion);
    printf("    latencyRequested = "); 
    switch (ac.latencyRequested)
    {
    case LATENCY_NORMAL: printf("NORMAL"); break;
    case LATENCY_FAST_BEACONS: printf("FAST_BEACONS"); break;
    case LATENCY_SLOW_BEACONS: printf("SLOW_BEACONS"); break;
    }
    printf("\r\n");
    printf("    Number of Binding Input Clusters = %u ", ac.numberOfBindingInputClusters);
    if (ac.numberOfBindingInputClusters > 0)
    {
        printf("{");
        for (int i=0; i< ac.numberOfBindingInputClusters; i++)
            printf("0x%02X ", ac.bindingInputClusters[i]);
        printf("}");
    }
    printf("\r\n");
    printf("    Number of Binding Output Clusters = %u ", ac.numberOfBindingOutputClusters);
    if (ac.numberOfBindingOutputClusters > 0)
    {
        printf("{");
        for (int i=0; i< ac.numberOfBindingOutputClusters; i++)
            printf("0x%02X ", ac.bindingOutputClusters[i]);
        printf("}");
    }
        printf("\r\n");
}

But then I get some errors about this struct:

/ZNP/application_configuration.c", line 36: error #411: function "getApplicationConfigurationForCoordinator" returns incomplete type "struct applicationConfiguration"

ZNP/application_configuration.c", line 39: error #71: incomplete type is not allowed

The whole source files can be found here: http://www.ti.com/litv/zip/swrc211a

  • What is the exact version of the compiler being used? You can check it from within your project properties.
    Also what are the options being passed to the compiler? You can find this in the CCS build console. Please copy and paste the full output of the build console to a text file and attach it here.

  • It is likely you have made some error in your build configuration.  I recommend you search and/or post to the forum mentioned in the comments to the source: http://e2e.ti.com/support/low_power_rf/default.aspx .

    Thanks and regards,

    -George

  • This is my full debug console output.

    3225.debug console.txt (this file is old)

    Update:

    tBoolean errors already fixed in my code, but I have no idea how I can fix struct errors.

    I fixed some other errors, so here is a new console output:

    1348.console output.txt

    Additionally console output error messages summary:

    Description	Resource	Path	Location	Type
    #411 function "getApplicationConfigurationForCoordinator" returns incomplete type "struct applicationConfiguration"	application_configuration.c	/weatherDemo/ZNP	line 35	C/C++ Problem
    #411 function "getApplicationConfigurationForRouter" returns incomplete type "struct applicationConfiguration"	application_configuration.c	/weatherDemo/ZNP	line 54	C/C++ Problem
    #71 incomplete type is not allowed	af_zdo.c	/weatherDemo/ZNP	line 57	C/C++ Problem
    #71 incomplete type is not allowed	application_configuration.c	/weatherDemo/ZNP	line 38	C/C++ Problem
    #71 incomplete type is not allowed	application_configuration.c	/weatherDemo/ZNP	line 57	C/C++ Problem
    #71 incomplete type is not allowed	application_configuration.c	/weatherDemo/ZNP	line 72	C/C++ Problem
    #71 incomplete type is not allowed	simple_api.c	/weatherDemo/ZNP	line 55	C/C++ Problem
    

    My problm is fixed. I created a new project. Now without any compiler or linker errors.

  • Thanks for the update and glad to hear that you now have a build without any errors.