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.

Compiler/CC2541SENSORTAG-RD: CC2541 not advertising.

Part Number: CC2541SENSORTAG-RD

Tool/software: TI C/C++ Compiler

CC2541 not advertising.

I am implementing code sensor tag, and I want to advertise after system init without passcode.

BLESDK version 1.3.2

IAR version 8.20.1

I have  below code  

// Setup the GAP Peripheral Role Profile
{
// Device starts advertising upon initialization
uint8 initial_advertising_enable = TRUE;//todo FALSE;

// By setting this to zero, the device will go into the waiting state after
// being discoverable for 30.72 second, and will not begin advertising again
// until the enabler is set back to TRUE
uint16 gapRole_AdvertOffTime = 0;
uint8 enable_update_request = DEFAULT_ENABLE_UPDATE_REQUEST;
uint16 desired_min_interval = DEFAULT_DESIRED_MIN_CONN_INTERVAL;
uint16 desired_max_interval = DEFAULT_DESIRED_MAX_CONN_INTERVAL;
uint16 desired_slave_latency = DEFAULT_DESIRED_SLAVE_LATENCY;
uint16 desired_conn_timeout = DEFAULT_DESIRED_CONN_TIMEOUT;

// Set the GAP Role Parameters
GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof( uint8 ), &initial_advertising_enable );
GAPRole_SetParameter( GAPROLE_ADVERT_OFF_TIME, sizeof( uint16 ), &gapRole_AdvertOffTime );

GAPRole_SetParameter( GAPROLE_SCAN_RSP_DATA, sizeof ( scanRspData ), (void *)scanRspData );
// Set default to general. We'll change this if we are bonded later
GAPRole_SetParameter( GAPROLE_ADVERT_DATA, sizeof( advertGeneralData ), (void *)advertGeneralData );

GAPRole_SetParameter( GAPROLE_PARAM_UPDATE_ENABLE, sizeof( uint8 ), &enable_update_request );
GAPRole_SetParameter( GAPROLE_MIN_CONN_INTERVAL, sizeof( uint16 ), &desired_min_interval );
GAPRole_SetParameter( GAPROLE_MAX_CONN_INTERVAL, sizeof( uint16 ), &desired_max_interval );
GAPRole_SetParameter( GAPROLE_SLAVE_LATENCY, sizeof( uint16 ), &desired_slave_latency );
GAPRole_SetParameter( GAPROLE_TIMEOUT_MULTIPLIER, sizeof( uint16 ), &desired_conn_timeout );
}

// Set the GAP Characteristics
GGS_SetParameter( GGS_DEVICE_NAME_ATT, osal_strlen(attDeviceName), attDeviceName );

//Set advertising interval
{
uint16 advInt = LONG_ADVERTISING_INTERVAL;

GAP_SetParamValue( TGAP_LIM_DISC_ADV_INT_MIN, advInt );
GAP_SetParamValue( TGAP_LIM_DISC_ADV_INT_MAX, advInt );
GAP_SetParamValue( TGAP_GEN_DISC_ADV_INT_MIN, advInt );
GAP_SetParamValue( TGAP_GEN_DISC_ADV_INT_MAX, advInt );
}

  //Setup the GAP Bond Manager

{

uint32 passkey = 0; // passkey "000000" //todo, testing
uint8 pairMode = GAPBOND_PAIRING_MODE_NO_PAIRING ;
uint8 mitm = FALSE;
uint8 ioCap = GAPBOND_IO_CAP_NO_INPUT_NO_OUTPUT;
uint8 bonding = FALSE;
GAPBondMgr_SetParameter( GAPBOND_DEFAULT_PASSCODE, sizeof ( uint32 ), &passkey );
GAPBondMgr_SetParameter( GAPBOND_PAIRING_MODE, sizeof ( uint8 ), &pairMode );
GAPBondMgr_SetParameter( GAPBOND_MITM_PROTECTION, sizeof ( uint8 ), &mitm );
GAPBondMgr_SetParameter( GAPBOND_IO_CAPABILITIES, sizeof ( uint8 ), &ioCap );
GAPBondMgr_SetParameter( GAPBOND_BONDING_ENABLED, sizeof ( uint8 ), &bonding );

}

  • Hello,

    There is no need to set/use a passcode to ADV.
    Why are you using an old SDK? BLE 1.4.2 is the latest.

    Best wishes
  • Hi,

      I have  upgrade code from BLESDK version 1.3.2 to 1.4.0 as my current IAR version is 8.20.1. I have successfully upgrade old project to new BLESDK version, however I am getting  Post-Build error. I don't have idea why error has occur, I have compared both old project and new project under option->Build Action->Post-build command line it is same.

    Error Message

    Performing Post-Build Action

    perl C:\Texas\Projects\ble\SensorTag\CC2541DB\gen_upgrade.pl C:\Texas\Projects\ble\SensorTag\CC2541DB\CC2541DK-Sensor\Exe C:\Texas\Projects\ble\

    SensorTag\CC2541DB

    Value in first 0x800 bytes!

    Error while running perl C:\Texas\Projects\ble\SensorTag\CC2541DB\gen_upgrade.pl C:\Texas\Projects\ble\SensorTag\CC2541DB\CC2541DK-Sensor\Exe C:\

    Texas\Projects\ble\SensorTag\CC2541DB

  • Hi,

    It looks like you added some custom build step?
    Note that the version of IAR EW8051 for BLE 1.4.0 is 8.10.4.

    Best wishes