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.

LAUNCHXL-CC26X2R1: Migrating to CC2652 from CC2640

Part Number: LAUNCHXL-CC26X2R1
Other Parts Discussed in Thread: CC2640

Hi,

I'm trying to migrate form the CC2640 MCU to the newer CC2652 MCU for my application. However, I'm struggling with adjusting the GAP role changes while using the migration guide found here.

To give some more context, my approach has been to use the project_zero app [4.40 CC26X2 SDK] that I imported from Resource explorer as a reference to supplement the migration guide linked above. In project zero, the entire GAP configuration is done as follows using default settings from the looks of it:

// Configure GAP for param update
    {
        uint16_t paramUpdateDecision = DEFAULT_PARAM_UPDATE_REQ_DECISION;

        // Pass all parameter update requests to the app for it to decide
        GAP_SetParamValue(GAP_PARAM_LINK_UPDATE_DECISION, paramUpdateDecision);
    }

However, in the old CC2640 version of my code, we configured the GAP with custom settings as follows:

// Set GAP Parameters:
    GAP_SetParamValue(TGAP_CONN_PAUSE_PERIPHERAL,
                      DEFAULT_CONN_PAUSE_PERIPHERAL);

    // Setup the Peripheral GAPRole Profile.
    {
        // For all hardware platforms, device starts advertising upon initialization
        uint8_t initialAdvertEnable = TRUE;

        // By setting this to zero, the device will go into the waiting state after
        // being discoverable for 30.72 second, and will not being advertising again
        // until re-enabled by the application
        uint16_t advertOffTime = 0;

        uint8_t enableUpdateRequest = DEFAULT_ENABLE_UPDATE_REQUEST;
        uint16_t desiredMinInterval = DEFAULT_DESIRED_MIN_CONN_INTERVAL;
        uint16_t desiredMaxInterval = DEFAULT_DESIRED_MAX_CONN_INTERVAL;
        uint16_t desiredSlaveLatency = DEFAULT_DESIRED_SLAVE_LATENCY;
        uint16_t desiredConnTimeout = DEFAULT_DESIRED_CONN_TIMEOUT;

        // Set the GAP Role Parameters
        GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t),
                             &initialAdvertEnable);
        GAPRole_SetParameter(GAPROLE_ADVERT_OFF_TIME, sizeof(uint16_t),
                             &advertOffTime);

        // Set scanRspData
        GAPRole_SetParameter(GAPROLE_SCAN_RSP_DATA, sizeof(scanRspData),
                             scanRspData);
        GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(advertData),
                             advertData);

        GAPRole_SetParameter(GAPROLE_PARAM_UPDATE_ENABLE, sizeof(uint8_t),
                             &enableUpdateRequest);
        GAPRole_SetParameter(GAPROLE_MIN_CONN_INTERVAL, sizeof(uint16_t),
                             &desiredMinInterval);
        GAPRole_SetParameter(GAPROLE_MAX_CONN_INTERVAL, sizeof(uint16_t),
                             &desiredMaxInterval);
        GAPRole_SetParameter(GAPROLE_SLAVE_LATENCY, sizeof(uint16_t),
                             &desiredSlaveLatency);
        GAPRole_SetParameter(GAPROLE_TIMEOUT_MULTIPLIER, sizeof(uint16_t),
                             &desiredConnTimeout);
    }

Please NOTE: Definitions, like GAPROLE_ADVERT_ENABLED, are register addresses in accordance with the older CC2640 v1.50 SDK

Could you please advise as to what would be the best way to handle this aspect of the migration? Is replacing these statements with the appropriate API from the migration guide sufficient?

  • Kartavya,

    Please see my response to the other post, which I think applies here, too. 

    To answer your question, my advice is to look at the User's Guide and look at the simple_peripheral example.

    As a clarification, your statement: "GAP configuration is done as follows" is not exactly correct. In project_zero, most of the configuration of the advertising and scan response data is done in function ProjectZero_processGapMessage(), case GAP_DEVICE_INIT_DONE_EVENT.  There you will find the calls to GapAdv_create(), GapAdv_loadByHandle(), GapAdv_setEventMask(), GapAdv_enable() mentioned in the user's guide.

    I hope this helps.

    -Luis