Can't start advertisement with SLOW settings

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
user_1669321
Level 5
Level 5
100 replies posted 50 replies posted 25 replies posted

Hi,

I'm trying to use the "Limited" discovery mode, with a timeout on the Fast advertising interval, and no timeout on the Slow advertising interval.

I realized that after the fast timeout, I need to call again Cy_BLE_GAPP_StartAdvertisement(), as it's not handled automatically.

But when I use this:

status = Cy_BLE_GAPP_StartAdvertisement(CY_BLE_ADVERTISING_SLOW, CY_BLE_PERIPHERAL_CONFIGURATION_0_INDEX);

status is set to CY_BLE_ERROR_INVALID_PARAMETER. This is also validated because after that, the function Cy_BLE_GetAdvertisementState() returns CY_BLE_ADV_STATE_STOPPED.

What am I doing wrong?

Thank you,

Fred

0 Likes
1 Solution

Hello Fredrick,

When we disable timeout for slow advertising interval it is not advertising but in this case it shall start continuous advertisement and if we enable the timeout advertisement is started. We will trace the issue regarding that and let you know once we find the solution.

Please enable timeout in slow advertising interval and use.

Thanks,

PSYU.

View solution in original post

11 Replies
user_1669321
Level 5
Level 5
100 replies posted 50 replies posted 25 replies posted

I just tested adding a timeout to the slow interval and it now seems to be working.

Furthermore, the switching from fast to slow now seems automatic, meaning that the statement "if (Cy_BLE_GetAdvertisementState() == CY_BLE_ADV_STATE_STOPPED)" is always false after the first Cy_BLE_GAPP_StartAdvertisement().

What is different in the behavior if I add/remove the timeout on the slow interval?

0 Likes

Hello Frederic,

In the below statement you used the slow advertising parameter (CY_BLE_ADVERTISING_SLOW) but you disabled the timeout to the Slow advertising interval in the BLE component due to this the advertisement does not started. If you use the fast advertising parameter (CY_BLE_ADVERTISING_FAST) in the function you can advertise.

status = Cy_BLE_GAPP_StartAdvertisement(CY_BLE_ADVERTISING_SLOW, CY_BLE_PERIPHERAL_CONFIGURATION_0_INDEX);

After adding the timeout to the slow interval the function started advertising without any error because it accepted only slow advertising interval.

Thanks,

PSYU.

0 Likes

Hi PSYU,

So the scheme that I want is not possible? Meaning that I want to advertise fast, but after the timeout, I want to advertise slowly indefinitely unless a certain event happens. The workaround that I have right now to never stop advertising is as follows:

if (Cy_BLE_GetAdvertisementState() == CY_BLE_ADV_STATE_STOPPED) {

    status = Cy_BLE_GAPP_StartAdvertisement(cy_ble_advertisingIntervalType, CY_BLE_PERIPHERAL_CONFIGURATION_0_INDEX);

}

cy_ble_advertisingIntervalType keeps track of the last advertisement speed used, so when the radio stops advertising, we restart it again. Ideally, I would like to remove the timeout on the slow advertisement interval, but you're telling that it cannot be done, right?

Thank you,

Fred

Hello Fredrick,

When we disable timeout for slow advertising interval it is not advertising but in this case it shall start continuous advertisement and if we enable the timeout advertisement is started. We will trace the issue regarding that and let you know once we find the solution.

Please enable timeout in slow advertising interval and use.

Thanks,

PSYU.

Thank you PSYU, I will continue to use the workaround until it's fixed.

Hello,

In limited mode FAST and SLOW must have Time Out. So for continuously advertising you should use General mode.

Thanks,

PSYU.

0 Likes
Anonymous
Not applicable

PSYU,

Thanks for the reply.  Actually I AM using GENERAL Discovery mode.

mode: General

type: Connectable undirected

I changed the SLOW to the follow per Apple BLE guidelines:

SLOW

min 1022.5

max 1285

Timeout 3600

Still nothing after FAST times out.

Wes

0 Likes
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello Anderson,

Can you please share your project.

Thanks,

PSYU.

0 Likes
Anonymous
Not applicable

void BleCallBack(uint32 event, void* eventParam)

{

    CYBLE_BLESS_CLK_CFG_PARAMS_T clockConfig;

    CYBLE_GATTS_WRITE_REQ_PARAM_T *wrReqParam;

  switch(event)

    {

        /* if there is a disconnect or the stack just turned on from a reset then start the advertising and turn on the LED blinking */

        case CYBLE_EVT_STACK_ON:

            /* load capacitors on the ECO should be tuned and the tuned value * must be set in the CY_SYS_XTAL_BLERD_BB_XO_CAPTRIM_REG */

            CY_SYS_XTAL_BLERD_BB_XO_CAPTRIM_REG = CAPACITOR_TRIM_VALUE; //without this value connections may drop randomly!!

            /* Get the configured clock parameters for BLE sub-system per AN96841 p.42 */

            CyBle_GetBleClockCfgParam(&clockConfig);// not sure if this is really needed per Corey-Cypress FAE

        case CYBLE_EVT_GAP_DEVICE_DISCONNECTED:  

             // GAH  ref CYBLE-224100-00 doc 002-11264 RevE  WHA12/28/17:moved to CYBLE_EVT_STACK_ON

            // Enable Skyworks SE2438T PA/LNA

            PowerAmpSetting(mode3_HiTxHiRx); //set to high power..may interfer with photoeye circuit

            // Configure the Link Layer to automatically switch PA control pin p3[2]

            // and LNA control pin P3[3]

            CY_SET_XTND_REG32( (void CYFAR*)(CYREG_BLE_BLESS_RF_CONFIG), 0x0331);

            CY_SET_XTND_REG32( (void CYFAR*)(CYREG_SRSS_TST_DDFT_CTRL), 0x80000302);

            CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);  //XR power was turned on above before advertising starts

            break;

....

0 Likes
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello Anderson,

Can you please check the Capacitance Trim value which was given for your module. Please refer the below link for setting ECO capacitance trim value in firmware.

ECO Capacitance Trim Values for EZ-BLE™ Modules - KBA218990

Thanks,

PSYU.

0 Likes
Anonymous
Not applicable

I have been having the same issue!  (PSOC4200 BLE).  In addition I find that the BLE component config (v3.40) will not let me adjust SLOW advertising interval to anything less that one second.  And turning on the timeout for SLOW does NOT help. After the FAST times out it appears to stop advertising regardless.

My settings are:

FAST

min 20ms

max 30 ms

Timeout 90 sec

SLOW

min 1000ms

max 4000ms

Timeout 1000s

0 Likes