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/CC1350: sendScanReq(ApiMac_scantype_t type)

Part Number: CC1350
Other Parts Discussed in Thread: CC1310

Tool/software: Code Composer Studio

Greetings to you all,

I try to send energy scan in my application using   sendScanReq(ApiMac_scantype_t type)  and process the result  using the function    scanCnfCb(ApiMac_mlmeScanCnf_t *pData) but here is the problem i am facing

every time the  scanCnfCb function  receives a value  only for 4 default channels (channel 0--3 )  even I sated  #define CONFIG_CHANNEL_MASK           { 0xFF, 0xFF, 0xFF,0x00,0x00,....} 

so where I need to check ?

for your information I am using CC1310, CC1350 and beglebone.

thank you 

  • Hello,

    CAn you explain more on the software and hardware side of things?

    What are you using in terms of software?

    What version of SDK?

    Where are you changing this channel mask?

    REgards,

    AB

  • Hi AB,

    First of all thank you very much for taking time and responding my question.

     Regarding the software side I am using :

    CCS V_8

    the SDK I am using is     simplelink_cc13x0_sdk_3_20_00_23 to be specific  

                                collector_CC1310_LAUNCHXL_tirtos_ccs  and collector CC1350_LAUNCHXL_tirtos_ccs.

    the changes I did  are as follows :  

    in config.h      the value of 

    #define CONFIG_CHANNEL_MASK { 0xFF, 0xFF, 0x11, 0x00, 0x00, 0x00, \
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
    0x00, 0x00, 0x00, 0x00, 0x00 }

    static void sendScanReq(ApiMac_scantype_t type)
    {
    ApiMac_mlmeScanReq_t scanReq;
    /* set common parameters for all scans */
    memset(&scanReq, 0, sizeof(ApiMac_mlmeScanReq_t));
    /* set scan channels from channel mask*/
    memcpy(scanReq.scanChannels, chanMask,
    APIMAC_154G_CHANNEL_BITMAP_SIZ);
    scanReq.scanType = type;
    scanReq.scanDuration = CONFIG_SCAN_DURATION;
    scanReq.maxResults = 6;/* Expecting beacon notifications */
    scanReq.permitJoining = false;
    scanReq.linkQuality = 1;
    scanReq.percentFilter = 0xFF;
    scanReq.channelPage = CONFIG_CHANNEL_PAGE;
    scanReq.phyID = CONFIG_PHY_ID;
    /* using no security for scan request command */
    memset(&scanReq.sec, 0, sizeof(ApiMac_sec_t));
    /* send scan Req */
    ApiMac_mlmeScanReq(&scanReq);
    }

    Hardware  types are  CC1310 and CC1350 launchpads 

    for your information  my  scanCnfCb(ApiMac_mlmeScanCnf_t *pData) function  is in collector.c file that is used to display the values returned from energy scan.

    Thank you . 

  • Hello,

    The problem could lie in the flash memory.

    The devices might have saved the last time they had a successful connection, and going back to this.

    you have two option:

    1. enable the erase entire flash, every time you reflash the device with new fw. (this is done in project properties -> Debug -> Flash settings)

    2. Disable NV_RESTORE predefined variable.

    Regards,

    AB

  • Hi AB,

    enable the erase entire flash is selected by default and I tried but not working.

    Regarding the 2nd option where I have to disable it ?

    I see  the file in : 

    1,  under      csf.c     

    void Csf_init(void *sem)
    {
    #ifdef NV_RESTORE
    /* Save off the NV Function Pointers */
    pNV = &Main_user1Cfg.nvFps;
    #endif

    2,    under        main.c 

    #ifdef NV_RESTORE
    mac_Config_t Main_user1Cfg =
    { 0 };
    #endif

    3,  under cllc.c

    #ifndef NV_RESTORE
    /* If NV_RESTORE is disabled device gets a new short address every time it
    joins i.e there may be duplicate entries in the Association table
    */
    devInfo.shortAddress = CSF_INVALID_SHORT_ADDR;
    #else
    /* Check to see if the device exists */
    devInfo.shortAddress = Csf_getDeviceShort(&pData->deviceAddress);
    #endif

    So where I have to look for disabling NV_RESTORE parameter?

    Thank you. 

  • Hi AB,

    For your information,  I am trying to develop a star network of collectors where one of them  would periodically send Energy scan measurements to the central  controller(BeagleBone Black). So my  question beside where to disable  NV_RESTORE is  disabling NV_RESTORE will not affect the normal functioning of the collector?

    Thank you.

  • kedir,

    If you are using a BBB as a gatway I recommend that you use our linux gateway sdk.

    http://www.ti.com/tool/TI-15.4-STACK-GATEWAY-LINUX-SDK

    Can you send me a screenshot of the project properties flash settings, by default it should not be enabled.

    to disable NV_RESTORE, you will need to go to project properties -> predefined symbols and remove from the list.

    Regards,

    AB

  • Hi  AB,

    First of all thank you for taking time and responding.

    Now I am getting the scanned  channels  and their  energy  level. but  still i have a problem with counting total number of channels returned from energy scan. 

    below attached the code  

    static uint8_t findBestChannel(uint8_t *pResults)
    {
    uint8_t chan;
    uint8_t currEnergy;
    uint8_t lastEnergy = CLLC_MAX_ENERGY;
    uint8_t coordStartChan = 0;
    LCD_WRITE_STRING_VALUE("Total number of channels: ", sizeof(pResults), 10,6);

    I tried   to get  through pData->resultListSize but it will return 129 which is the total channel not the number of scanned once. So, how can I solve ?

    Thank you.

  • Can you look at that location in memory while in debug mode, and make sure that it is not an array of 128 elements? I think this is a bit masked value, in which channels scanned will be 1s and not scanned 0s.