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.

Soft resetting ble peripheral cc2541

Other Parts Discussed in Thread: CC2541

Hi all,

I have tried with following function to soft reset my ble peripheral

HAL_SYSTEM_RESET() and SystemReset()

Both functions resets the system but it take around 2sec to reset. After resetting system start advertising only after around 20sec which is much more than acceptable.

If i power reset the peripheral then it takes less than a second to start advertising.

In my application i need to reconfigure the registers and for this i need to reset the system when required. After reset, it should restart advertising as soon as possible(<1sec).

Can anyone please suggest me why it takes this much time to reset and advertise again? how this timing can be reduced? If not then i will have to use hardware reset through IO pins using transistor.

thanks

  • For resetting, I had tried to reset using hardware and IO pins by connecting P1_1 to base of transistor using 1K resistor and cc2541 reset pin connected to collector with emitter grounded. In software side i had configured P1_1 as o/p and set P1_1 = 0 in the very beginning of main() but this is leading to resetting the hardware continuously on its own. Can anyone please suggest me if i have made mistake in the circuit or if anyone can suggest some other way which can reset peripheral instantly and device start advertising?
  • Hi Kumar,

    How do you measure the 20 sec time before it starts to advertise? Are you sure the delay is after reset, and not before calling the reset function? It is not clear to me why you need to reset, can´t you just configure all the registers you have modified back to their reset values instead?

    P1_1 does not have internal pull. During reset the pin will be a floating input and I guess the transistor can easily be turned on in this state. Try adding a pull-down resistor.

    Cheers,
    Fredrik
  • Hi Fredrik,
    Thanks for your reply.
    1)Ya. I am sure that system resets about 2sec later the SystemReset() is called because before the system resets, my device is in connected state and i am able to get packets in sniffer log. when i call this function after about 2sec only it stops advertising.

    2)20 sec interval i have measured based on the advertisement starting using stop watch timer. after peripheral stops advertising, as stated above, next time i get advertising signal in sniffer only after 20sec. when i power reset it starts advertising within a second.

    3)I want to reset the system to change the connection interval. Actually i have to first record the voice and then transfer the recorded file. While recording, i am using for loop which needs to be processed for 30sec. to avoid disconnecting, i am using 1sec connection interval(min and max time). As throughput of BLE is very less so i need to decrease the connection interval to as less as possible(10ms for safe limit).

    As discussed by svendbt in e2e.ti.com/.../427337 android version<5 doesn't support updating connection interval, so its not possible to update/change the connection interval. once device is connected and central device assigns connection interval, it will use that interval until the system is reset but i need to set two connection interval as explained above which is possible only by resetting as i think.

    4)I have even tried by connecting 10K resistor in between base and emitter which is grounded but then also it doesn't work. In this set up device doesn't start advertising but as soon as i remove the setup, it starts advertising. I think this happens due to transistor is triggered again as soon as its power recycled. uC-Out is P1.1 in picture

    5)Can you please suggest if i need to do anything if i want my peripheral to be in connected state all the time?
    Please give me some suggestion either to hard or soft reset.

  • Hi Fredrik,

    I found some spike when i was power resetting which was resulting in triggering the transistor and hence system was resetting again and again. I had modified my circuit design and added one capacitor at the i/p to base.

    Now my circuit is resetting properly and advertising instantly but only drawback is its adding extra space to the circuitry for no reason. If soft reset would have worked fine then this extra circuitry would have been avoided. will try again to find if i can it do using soft reset.