Temporarily disable BLE Stack

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

cross mob
KlFe_1102776
Level 1
Level 1
First question asked First reply posted

After the advertisement is ready the Bluetooth should only enabled as short as possible during a small time for transmitting (transmit period: 2 seconds).

If this period is over, no transmission should occur because of interaction with the other parts of the circuit (to avoid a small drop in the power supply).

Hardware: CY8CPROTO-063-BLE prototyping kit

Software: Based on the example "BLE_Battery_Level_FreeRTOS" from Cypress with ModusToolBox 2.0.

Actually the following (brachial) code is implemented

Enable BLE

    Cy_SysClk_IloEnable();

    vTaskResume(xHandleBle);

    NVIC_EnableIRQ(bless_interrupt_IRQn);

Disable BLE

    NVIC_DisableIRQ(bless_interrupt_IRQn);

    vTaskSuspend(xHandleBle);

    Cy_SysClk_IloDisable();

Any idea how this could solved in a different (elegant) way ?

Thanks in advance !

0 Likes
1 Solution
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

>>"After the advertisement is ready the Bluetooth should only enabled as short as possible during a small time for transmitting (transmit period: 2 seconds).

If this period is over, no transmission should occur because of interaction with the other parts of the circuit (to avoid a small drop in the power supply)."

Cypress--> By transmission you mean the device is advertising or transmitting data after connection?

In either case the best method is to Start and stop the advertisement whenever it is required (if it is advertising) instead of enabling and disabling the interrupt.

In case of connection, the devices have to communicate each other once for every connection interval. So when the ISR is not serviced the connection breaks after connection timeout. So it is not recommended.

Thanks

Ganesh

View solution in original post

2 Replies
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

>>"After the advertisement is ready the Bluetooth should only enabled as short as possible during a small time for transmitting (transmit period: 2 seconds).

If this period is over, no transmission should occur because of interaction with the other parts of the circuit (to avoid a small drop in the power supply)."

Cypress--> By transmission you mean the device is advertising or transmitting data after connection?

In either case the best method is to Start and stop the advertisement whenever it is required (if it is advertising) instead of enabling and disabling the interrupt.

In case of connection, the devices have to communicate each other once for every connection interval. So when the ISR is not serviced the connection breaks after connection timeout. So it is not recommended.

Thanks

Ganesh

Thanks Ganesh for your answer.

Ganesh--> In case of connection, the devices have to communicate each other once for every connection interval. So when the ISR is not serviced the connection breaks after connection timeout. So it is not recommended.

I understand the answer. The advertisement is not a problem, it is always finished before the interrupt is temporarily disabled.

Anyway, if the connection timeout is long enough the connection should not break - is this correct ?

I also understand that disabling the interrupt is a bad solution. But I didn`t find another solution to avoid small voltage drops in the power supply because of the activity of the BLE stack. Any advice and suggestions for the software will be greatly appreciated.

Thanks

Klaus

0 Likes