• TI Thinks Resolved

CCS/CC1352P: Collection Board is not connected with Sensor Board!

Intellectual 280 points

Replies: 14

Views: 185

Part Number: CC1352P

Tool/software: Code Composer Studio

Hello Sir!

Now i test that two board (collector & sensor) are connection test

I used that sdk is simplelink_cc13x2_26x2_sdk_3_20_00_68 and boards are not cc1352p_lunchxl(there are developed for my system)

RF Configuration is set by syscfg tool

It looks like below that

1.sensor board run unlimit loop

void Sensor_process(void)
{
/* Start the collector device in the network */
if(Sensor_events & SENSOR_START_EVT)
{

GPIO_write(Board_PIN_LED0,0); // GPIO_write() is operating
GPIO_write(Board_PIN_LED1,0); // GPIO_write() is operating

ApiMac_deviceDescriptor_t devInfo;
Llc_netInfo_t parentInfo;
#ifdef USE_DMM
uint32_t frameCounter = 0;

/* update policy */
DMMPolicy_updateStackState(DMMPolicy_StackRole_154Sensor, DMMPOLICY_STACKSTATE_154SENSOR_PROVISIONING);

Sensor_securityInit(frameCounter);
#endif /* USE_DMM */

if(Ssf_getNetworkInfo(&devInfo, &parentInfo ) == true)
{
Ssf_configSettings_t configInfo;
#ifdef FEATURE_MAC_SECURITY
ApiMac_status_t stat;
#endif /* FEATURE_MAC_SECURITY */

/* Do we have config settings? */
if(Ssf_getConfigInfo(&configInfo) == true)
{
/* Save the config information */
configSettings.frameControl = configInfo.frameControl;
configSettings.reportingInterval = configInfo.reportingInterval;
configSettings.pollingInterval = configInfo.pollingInterval;

/* Update the polling interval in the LLC */
Jdllc_setPollRate(configSettings.pollingInterval);
}

/* Initially, setup the parent as the collector */
if(parentInfo.fh == true && CONFIG_RX_ON_IDLE)
{
collectorAddr.addrMode = ApiMac_addrType_extended;
memcpy(&collectorAddr.addr.extAddr,
parentInfo.devInfo.extAddress, APIMAC_SADDR_EXT_LEN);
}
else
{
collectorAddr.addrMode = ApiMac_addrType_short;
collectorAddr.addr.shortAddr = parentInfo.devInfo.shortAddress;
}

#ifdef FEATURE_MAC_SECURITY
/* Put the parent in the security device list */
stat = Jdllc_addSecDevice(parentInfo.devInfo.panID,
parentInfo.devInfo.shortAddress,
&parentInfo.devInfo.extAddress, 0);
if(stat != ApiMac_status_success)
{
Ssf_displayError("Auth Error: 0x", (uint8_t)stat);
}
#endif /* FEATURE_MAC_SECURITY */

#ifdef FEATURE_SECURE_COMMISSIONING
if(!CONFIG_FH_ENABLE)
{
nvDeviceKeyInfo_t devKeyInfo;
SM_seedKey_Entry_t * pSeedKeyEnty;
if(Ssf_getDeviceKeyInfo(&devKeyInfo) == TRUE)
{
/* Update the seedKeyTable and MAC Key Table */
/* Use its own ext address */
updateSeedKeyFromNV(&devInfo,&devKeyInfo);
pSeedKeyEnty = getEntryFromSeedKeyTable(devInfo.extAddress,devInfo.shortAddress);
/* Do not change the order below to lines */
/* Copy collector ext Address first */
memcpy(commissionDevInfo.extAddress, parentInfo.devInfo.extAddress, sizeof(ApiMac_sAddrExt_t));
addDeviceKey(pSeedKeyEnty,devKeyInfo.deviceKey, true);
LCD_WRITE_STRING("KeyInfo recovered", 6);
}
}
#endif
Jdllc_rejoin(&devInfo, &parentInfo);
rejoining = true;

}
else
{

GPIO_write(Board_PIN_LED0,1); // GPIO_write() is operating
GPIO_write(Board_PIN_LED1,1); // GPIO_write() is operating
/* Get Start Timestamp */
#ifdef OSAL_PORT2TIRTOS                                                                  <-- sensor board run and not action anyother  
joinTimeTicks = Clock_getTicks();
#else
joinTimeTicks = ICall_getTicks();
#endif
Jdllc_join();
}

}

So i thank that 

If Ssf_getNetworkinfo() function is reading data from Flash memory but I not write data to Flash memory so flash memory is empty

2.Collector board is run unlimit repeat 

 Collector_events & COLLECTOR_TRACKING_TIMEOUT_EVT -> Collector_events & COLLECTOR_BROADCAST_TIMEOUT_EVT

 ->Collector_events & COLLECTOR_TRACKING_TIMEOUT_EVT

void Collector_process(void)
{

/* Start the collector device in the network */
if(Collector_events & COLLECTOR_START_EVT)
{
if(cllcState == Cllc_states_initWaiting)
{
processStartEvent();
}



}

/* Is it time to send the next tracking message? */
if(Collector_events & COLLECTOR_TRACKING_TIMEOUT_EVT)
{
/* Process Tracking Event */
generateTrackingRequests();
display = Display_open(Display_Type_HOST, NULL);
Display_printf(display, 0, 0, "Collect tracking timeout event", NULL, NULL);
GPIO_write(Board_STATE_LED2,0); // GPIO_write() is operating
GPIO_write(Board_STATE_LED1,1); // GPIO_write() is operating
GPIO_write(Board_STATE_LED3,1); // GPIO_write() is operating

/* Clear the event */
Util_clearEvent(&Collector_events, COLLECTOR_TRACKING_TIMEOUT_EVT);
}

/*
The generate a config request for all associated devices that need one
*/
if(Collector_events & COLLECTOR_CONFIG_EVT)
{
#ifdef FEATURE_SECURE_COMMISSIONING
if(SM_Last_State != SM_CM_InProgress) {
generateConfigRequests();
}
#else
generateConfigRequests();
#endif

/* Clear the event */
Util_clearEvent(&Collector_events, COLLECTOR_CONFIG_EVT);
}

/*
Collector generate a broadcast command message for FH mode
*/
if(Collector_events & COLLECTOR_BROADCAST_TIMEOUT_EVT)
{
/* Clear the event */
Util_clearEvent(&Collector_events, COLLECTOR_BROADCAST_TIMEOUT_EVT);
if(FH_BROADCAST_INTERVAL > 0 && (!CERTIFICATION_TEST_MODE))
{
generateBroadcastCmd();
/* set clock for next broadcast command */
Csf_setBroadcastClock(FH_BROADCAST_INTERVAL);
}
display = Display_open(Display_Type_HOST, NULL);
Display_printf(display, 0, 0, "Collect broadcast timeout event", NULL, NULL);
GPIO_write(Board_STATE_LED1,1); // GPIO_write() is operating
GPIO_write(Board_STATE_LED2,1); // GPIO_write() is operating
GPIO_write(Board_STATE_LED3,1); // GPIO_write() is operating
}

/* Process LLC Events */
Cllc_process();

/* Allow the Specific functions to process */
Csf_processEvents();

#ifdef FEATURE_SECURE_COMMISSIONING
/* Allow the security manager specific functions to process */
SM_process();
#endif /* FEATURE_SECURE_COMMISSIONING */
/*
Don't process ApiMac messages until all of the collector events
are processed.
*/
#ifdef FEATURE_SECURE_COMMISSIONING
if((Collector_events == 0) && (SM_events == 0))
#else
if(Collector_events == 0)
#endif
{
/* Wait for response message or events */
ApiMac_processIncoming();
}
}

It is not connect with collector and sensor but i don't why 

I always thank that your answer. 

  • In reply to sung keun lee:

    Hi,

    To address your questions:

    1. Yes, that's likely what is happening. When the sensor joins, there should be a call to Ssf_stateChangeUpdate with state == Jdllc_states_joined. Please check this.

    2. The NVS can be used for external flash. The collector/sensor both use internal flash.

    3. The collector/sensor uses internal flash, which is managed with function pointers (by default, the function pointers are loaded with NVOCTP_loadApiPtrs.

    However, I would like to develop a baseline for debugging:

    My understanding is that you are using custom boards and have made modifications to the default collector/sensor examples.

    - To check software:
    - Please begin with evaluating the default collector/sensor on launchpads: http://dev.ti.com/tirex/content/simplelink_academy_cc13x2_26x2sdk_3_30_01_00/modules/154-stack/154-stack_01_sensor_collector/154-stack_01_sensor_collector.html
    - After functionality is verified, add any of your code modifications, then evaluate them on the launchpads.

    - To check hardware:
    - Please begin with default collector/sensor on your custom boards. You can also use the following for this: http://dev.ti.com/tirex/content/simplelink_academy_cc13x2_26x2sdk_3_30_01_00/modules/154-stack/154-stack_01_sensor_collector/154-stack_01_sensor_collector.html

    Once we have narrowed down whether the issue is in HW or SW, we will have a better idea on how to resolve the issue.



    Regards,
    Toby

  • In reply to Toby Pan:

    Thank sir!

    I am to check software so i download sdk3_3 and ccs9.2

    And example project collector and opened collector.syscfg by ccs9.2.

    I changed GPIO setting for fix in my system.

    Try compile and it is error like blow that 

    error: CONFIG_I2C_0(/ti/drivers/I2C) i2c.sdaPin: Resource conflict
    DIO_5 appears valid, but was marked as an error in the suggested solution
    error: CONFIG_I2C_0(/ti/drivers/I2C) i2c.sclPin: Resource conflict
    DIO_6 appears valid, but was marked as an error in the suggested solution
    error: CONFIG_I2S_0(/ti/drivers/I2S) i2s.SD0Pin: Resource conflict
    DIO_23 appears valid, but was marked as an error in the suggested solution
    error: CONFIG_I2S_0(/ti/drivers/I2S) i2s.SD1Pin: Resource conflict
    DIO_24 appears valid, but was marked as an error in the suggested solution
    error: CONFIG_I2S_0(/ti/drivers/I2S) i2s.SCKPin: Resource conflict
    DIO_15 appears valid, but was marked as an error in the suggested solution
    error: CONFIG_I2S_0(/ti/drivers/I2S) i2s.WSPin: Resource conflict
    DIO_14 appears valid, but was marked as an error in the suggested solution
    error: CONFIG_I2S_0(/ti/drivers/I2S) i2s.MCLKPin: Resource conflict
    DIO_13 appears valid, but was marked as an error in the suggested solution

    It is not problem in sdk3.1 and ccs9.0.

  • In reply to sung keun lee:

    Are you using a launchpad or your custom board for this?

    If you are using a custom board, can you try running the collector/sensor without any code modifications?
    I understand that your project specifics may require use of other peripherals, but for this stage of debugging, please refrain from that if possible...

    Also, can you attach the collector.syscfg file so I can see what's happening?

  • In reply to sung keun lee:

    Thank sir!

    I want that, data transmit to sensor from collector, so source program(sdk 3.2) changed like blow for test.

    This is located process_collector function in collector.c

    /*
    Collector generate a broadcast command message for FH mode
    */
    if(Collector_events & COLLECTOR_BROADCAST_TIMEOUT_EVT)
    {
    /* Clear the event */
    Util_clearEvent(&Collector_events, COLLECTOR_BROADCAST_TIMEOUT_EVT);
    if(FH_BROADCAST_INTERVAL > 0 && (!CERTIFICATION_TEST_MODE))
    {
    generateBroadcastCmd();
    /* set clock for next broadcast command */
    Csf_setBroadcastClock(FH_BROADCAST_INTERVAL);
    }
    }/* Process LLC Events */
    
    Cllc_process();
    
    /* Allow the Specific functions to process */
    Csf_processEvents();
    
    /*============================================
    * Added by SKLEE
    ============================================*/
    bool TransError;
    //if(FirstTranData == 0)
    //{
    //sendMsg(Smgs_cmdIds_CommissionMsg, uint16_t dstShortAddr, bool rxOnIdle, uint16_t len, uint8_t * pData)
    if(FirstTranData == 0)
    {
    TransError = sendMsg(Smgs_cmdIds_CommissionMsg, item.devInfo.shortAddress, item.capInfo.rxOnWhenIdle, sizeof(Test_data), Test_data);
    if(TransError == true)
    {
    //FirstTranData = 1;
    Display_printf(disHandle, 0, 0, "start %s", Test_data, NULL);
    }
    }

    I check that sendMsg function returns true.

    sendMsg function is unlimit run

     

    And i check receive data at dataIndCB() function in sensor.c

    static void dataIndCB(ApiMac_mcpsDataInd_t *pDataInd)
    {
    uint8_t cmdBytes[SMSGS_TOGGLE_LED_RESPONSE_MSG_LEN];
    
    if((pDataInd != NULL) && (pDataInd->msdu.p != NULL)
    && (pDataInd->msdu.len > 0))
    {
    Smsgs_cmdIds_t cmdId = (Smsgs_cmdIds_t)*(pDataInd->msdu.p);
    
    #ifdef FEATURE_MAC_SECURITY
    {
    if(Jdllc_securityCheck(&(pDataInd->sec)) == false)
    {
    /* reject the message */
    return;
    }
    }
    #endif /* FEATURE_MAC_SECURITY */
    
    switch(cmdId)
    {
    case Smsgs_cmdIds_configReq:
    processConfigRequest(pDataInd);
    Sensor_msgStats.configRequests++;
    break;
    
    case Smsgs_cmdIds_trackingReq:
    /* Make sure the message is the correct size */
    if(pDataInd->msdu.len == SMSGS_TRACKING_REQUEST_MSG_LENGTH)
    {
    /* Update stats */
    Sensor_msgStats.trackingRequests++;
    
    /* Indicate tracking message received */
    Ssf_trackingUpdate(&pDataInd->srcAddr);
    
    /* send the response message directly */
    cmdBytes[0] = (uint8_t) Smsgs_cmdIds_trackingRsp;
    Sensor_sendMsg(Smsgs_cmdIds_trackingRsp,
    &pDataInd->srcAddr, true,
    1, cmdBytes);
    }
    break;
    
    case Smsgs_cmdIds_toggleLedReq:
    /* Make sure the message is the correct size */
    if(pDataInd->msdu.len == SMSGS_TOGGLE_LED_REQUEST_MSG_LEN)
    {
    
    /* send the response message directly */
    cmdBytes[0] = (uint8_t) Smsgs_cmdIds_toggleLedRsp;
    cmdBytes[1] = Ssf_toggleLED();
    Sensor_sendMsg(Smsgs_cmdIds_toggleLedRsp,
    &pDataInd->srcAddr, true,
    SMSGS_TOGGLE_LED_RESPONSE_MSG_LEN,
    cmdBytes);
    }
    break;
    
    case Smgs_cmdIds_broadcastCtrlMsg:
    if(parentFound)
    {
    /* Node has successfully associated with the network */
    processBroadcastCtrlMsg(pDataInd);
    /*====================================================
    * Added by SKLEE
    ====================================================*/
    LCD_WRITE_STRING("Smgs_cmdIds_broadcastCtrlMsg", 4);
    /*====================================================
    * Added end
    ====================================================*/
    }
    break;
    #ifdef POWER_MEAS
    case Smsgs_cmdIds_rampdata:
    Sensor_pwrMeasStats.rampDataRcvd++;
    break;
    #endif
    
    #ifdef FEATURE_NATIVE_OAD
    case Smsgs_cmdIds_oad:
    //Index past the Smsgs_cmdId
    OADProtocol_ParseIncoming((void*) &(pDataInd->srcAddr), pDataInd->msdu.p + 1);
    break;
    #endif //FEATURE_NATIVE_OAD
    #ifdef FEATURE_SECURE_COMMISSIONING
    case Smgs_cmdIds_CommissionStart:
    {
    ApiMac_sec_t devSec;
    extern ApiMac_sAddrExt_t ApiMac_extAddr;
    
    /* Obtain MAC level security information. Use network key for SM */
    Jdllc_securityFill(&devSec);
    
    uint8_t *pBuf = pDataInd->msdu.p;
    pBuf += sizeof(Smsgs_cmdIds_t);
    SMMsgs_cmdIds_t CMMsgId = (SMMsgs_cmdIds_t)Util_buildUint16(pBuf[0], pBuf[1]);
    
    /* read the current value */
    ApiMac_mlmeGetReqBool(ApiMac_attribute_autoRequest, &currAutoReq);
    
    /* beacon-mode of operation and autoRequest is set to true and sleepy device */
    if((CONFIG_MAC_BEACON_ORDER != 15) && (currAutoReq == true) && (!CONFIG_RX_ON_IDLE))
    {
    /* set autoRequest to false and enable explicit polling */
    ApiMac_mlmeSetReqBool(ApiMac_attribute_autoRequest, false);
    Util_setEvent(&Jdllc_events, JDLLC_POLL_EVT);
    }
    
    if (CMMsgId == SMMsgs_cmdIds_keyRefreshRequest)
    {
    if(SM_Last_State != SM_CM_InProgress)
    {
    /* Kick off key refreshment process if SM state machine is not being run */
    SM_startKeyRefreshProcess(&parentInfo.devInfo, &devSec,
    parentInfo.fh, true);
    }
    }
    else if(CMMsgId == SMMsgs_cmdIds_processRequest)
    {
    /* Kick off commissioning process to obtain security information */
    SM_startCMProcess(&parentInfo.devInfo, &devSec, parentInfo.fh,
    true, SM_type_device, SM_SENSOR_AUTH_METHOD);
    }
    }
    break;
    case Smgs_cmdIds_CommissionMsg:
    {
    /* Process Security manager commissioning data */
    //SM_processCommData(pDataInd); // Removed command after test 
    LCD_WRITE_STRING("Recever Data", 4);  <= Added for check
    }
    break;
    
    
    #endif /* FEATURE_SECURE_COMMISSIONING */
    
    default:
    /* Should not receive other messages */
    break;
    }
    }
    }

     I add LCD_WRITE_STRING() function at switch{} -> case Smgs_cmdIds_CommissionMsg for check.

    But sensor is only run at case Smgs_cmdIds_broadcastCtrlMsg.

    So i want know that how to transmit data to sensor from collector, when i want time

    please tel me how to that!