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.

CC2674P10: where is ZC or ZED to set?

Part Number: CC2674P10
Other Parts Discussed in Thread: SYSBIOS

Tool/software:

HELLO

 The demo code 

int main()
{
#ifndef USE_DEFAULT_USER_CFG
    zstack_user0Cfg.macConfig.pAssertFP = assertHandler;
#endif

    /* enable iCache prefetching */
    VIMSConfigure(VIMS_BASE, TRUE, TRUE);

#if defined(USE_CACHE_RAM)
    /* Disable cache */
    VIMSModeSet( VIMS_BASE, VIMS_MODE_DISABLED);
#else
    /* Enable cache */
    VIMSModeSet( VIMS_BASE, VIMS_MODE_ENABLED);
#endif

    /*
     Initialization for board related stuff such as LEDs
     following TI-RTOS convention
     */
    Board_initGeneral();

// #ifdef THOR_FPGA
    // FPGA can't sleep
    Power_setConstraint(PowerCC26XX_IDLE_PD_DISALLOW);
    Power_setConstraint(PowerCC26XX_SB_DISALLOW);
// #endif

// OTA client projects use BIM, so CCFG isn't present in this image
#if !((defined OTA_CLIENT_STANDALONE) || (defined OTA_CLIENT_INTEGRATED))
    /*
     * Copy the extended address from the CCFG area
     * Assumption: the memory in CCFG_IEEE_MAC_0 and CCFG_IEEE_MAC_1
     * is contiguous and LSB first.
     */
    /* Used to check for a valid extended address */
    static const uint8_t dummyExtAddr[] =
        { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };

    OsalPort_memcpy(zstack_user0Cfg.extendedAddress, (uint8_t *)&(__ccfg.CCFG_IEEE_MAC_0),
           (APIMAC_SADDR_EXT_LEN));
    /* Check to see if the CCFG IEEE is valid */
    if(memcmp(zstack_user0Cfg.extendedAddress, dummyExtAddr, APIMAC_SADDR_EXT_LEN) == 0)
#endif // (defined OTA_CLIENT_STANDALONE) || (defined OTA_CLIENT_INTEGRATED
    {
        /* No, it isn't valid.  Get the Primary IEEE Address */
        OsalPort_memcpy(zstack_user0Cfg.extendedAddress, (uint8_t *)(FCFG1_BASE + EXTADDR_OFFSET),
                       (APIMAC_SADDR_EXT_LEN));
    }

    /* Setup the NV driver */
    NVOCMP_loadApiPtrs(&zstack_user0Cfg.nvFps);
#ifdef NVOCMP_MIN_VDD_FLASH_MV
    NVOCMP_setLowVoltageCb(&Main_lowVoltageCb);
#endif
    if(zstack_user0Cfg.nvFps.initNV)
    {
        zstack_user0Cfg.nvFps.initNV(NULL);
    }

#ifdef ZSTACK_GPD
    OsalPort_memcpy(ApiMac_extAddr, zstack_user0Cfg.extendedAddress,
           (APIMAC_SADDR_EXT_LEN));
    _macTaskId = macTaskInit(&zstack_user0Cfg.macConfig);
#else
    /* configure stack task */
    stackTask_init(&zstack_user0Cfg);
#endif // ZSTACK_GPD

#ifdef NPI
    extern void NPITask_createTask(void);
    NPITask_createTask();

    Semaphore_Params semParam;
    Semaphore_Params_init(&semParam);
    semParam.mode = ti_sysbios_knl_Semaphore_Mode_COUNTING;
    Semaphore_construct(&npiInitializationMutex, 0, &semParam);
    npiInitializationMutexHandle = Semaphore_handle(&npiInitializationMutex);
#endif

// ZNP does not need an application task
#ifndef ZNP_NPI

#ifndef CUI_DISABLE
    CUI_params_t cuiParams;

    CUI_paramsInit(&cuiParams);
    CUI_init(&cuiParams);
#endif
    Task_Params taskParams;

    /* Configure app task. */
    Task_Params_init(&taskParams);
    taskParams.stack = myTaskStack;
    taskParams.stackSize = APP_TASK_STACK_SIZE;
    taskParams.priority = 2;
    Task_construct(&myTask, taskFxn, &taskParams, NULL);

#endif

#ifdef DEBUG_SW_TRACE
    IOCPortConfigureSet(IOID_8, IOC_PORT_RFC_TRC, IOC_STD_OUTPUT
                    | IOC_CURRENT_4MA | IOC_SLEW_ENABLE);
#endif /* DEBUG_SW_TRACE */

    BIOS_start(); /* enable interrupts and start SYS/BIOS */

    return 0; // never executed
}
where  is ZC or ZED to set? 
  • Hello whong,

    Stack/Config/f8wcoord.opts defined ZDO_COORDINATOR and RTR_NWK for a Coordinator project, which Stack/Config/f8wenddev.opts does not contain in an End Device project, and thus zglobals.h can set the correct value for ZSTACK_DEVICE_BUILD.

    #if !defined ( ZSTACK_DEVICE_BUILD )
    #if defined ( ZDO_COORDINATOR )
    
    #define ZSTACK_DEVICE_BUILD (DEVICE_BUILD_COORDINATOR)
    #elif defined ( RTR_NWK )
    
    #define ZSTACK_DEVICE_BUILD (DEVICE_BUILD_ROUTER)
    #else
    
    #define ZSTACK_DEVICE_BUILD (DEVICE_BUILD_ENDDEVICE)
    #endif
    #endif
    

    These are compile time settings, as there are pre-build library files differentiating the two nodes, so it is recommended to use the default Node Type which is delivered with the project or use the ZNP example for which any node can be selected through the MT API.

    Regards,
    Ryan