2 Replies Latest reply on Apr 12, 2020 11:57 AM by KlFe_1102776

    Temporarily disable BLE Stack

    KlFe_1102776

      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 !

        • 1. Re: Temporarily disable BLE Stack
          GaneshD_41

          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

          1 of 1 people found this helpful
          • 2. Re: Temporarily disable BLE Stack
            KlFe_1102776

            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