This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to enable and disable all interrupts ?

Hi Team,

Is there any way to enable/disable all interrupts? Will BLE connection get disconnected because of this? If yes the what are the possible ways to maintain the connection?

Parents
    1. Is there a way to enable/disable all interrupts. Yes, set primask. There's a __disable_irq() and an __enable_irq() macro to do that .. however
    2. Will BLE connection get disconnected because of this? Yes, it will, perhaps not instantly, perhaps not every time. The longer you have them disabled, the more likely the SD will break that time but even if you have them disabled for a really, really short time, it will eventually and randomly break. So don't use the __disable_irq() or attempt to disable all interrupts. It will not work.
    3. What are the possible ways to maintain the connection? Don't disable all interrupts is the way to maintain the connection. You can use the sd_nvic_critical_region_enter()/exit() functions to turn off all interrupts the softdevice isn't using. That is the most you can do.

    What problem are you actually trying to solve?

  • My mobile application gets connected to nordic-slave-device, it sends some some command to nordic-slave-device. After this there is no real data exchange and only low level handshaking packets are transferred between ble-master and ble-slave(i.e. nordic-slave-device). Considering this following questions hangs my mind:

    1. After asking timeslot, is there any need to disable interrupts? If yes then how to do that?

    2. What is the maximum timeslot (in ms) we can ask for?

    3. What is the probability that we ask for a timeslot and we do not get it and ultimately loose some bytes over uart?

    Or I just need to go for separate UART chip for better performance?

Reply
  • My mobile application gets connected to nordic-slave-device, it sends some some command to nordic-slave-device. After this there is no real data exchange and only low level handshaking packets are transferred between ble-master and ble-slave(i.e. nordic-slave-device). Considering this following questions hangs my mind:

    1. After asking timeslot, is there any need to disable interrupts? If yes then how to do that?

    2. What is the maximum timeslot (in ms) we can ask for?

    3. What is the probability that we ask for a timeslot and we do not get it and ultimately loose some bytes over uart?

    Or I just need to go for separate UART chip for better performance?

Children
No Data
Related