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

disconnection

HI,

If I insert in the main loop (in the connection branch) the instruction "idle_state_handle();"

    for (;;)
    {
         if (flag_connected==0)
        {
                       idle_state_handle();
        }
        else
        {

                       idle_state_handle();
.....

.....

         }

after the first connection, without send or receive nothing, the connection is self closed after 5 minut and 28 second

if I remove the instruction the connection is always ON.

I need to insert the instruction because with this the power comsuction is 0,5 mA, otherwise 5 mA.

Why with the instruction " idle_state_handle();"  the conncection is lost it self ?

I'm using SDK 15.0.0 and SD 6.0

Marco

Parents
  • Hi Marco,

    I do not understand your code snippet here, is the idle_state_handle is called anyway both in "if" and also in "else"? 

    The connection is not normally lost in idle_state_handler because this function makes the chip go the system_idle (WFE sleep) and the softdevice event management still can wake the chip and keep the connection alive. I am not sure if the idle_state_handle is the sole reason for you to see the connection loss.

    Adding more code and context would help us in the forum understand more on why your system is losing connection.

  • I have insert  "idle_state_handle" in both branch, just to understand.

    what I discovered is that I have (after 5 min and 25 second) a reset of the micro, then the reinitialization of the SD produces the disconnection. But if I remove the "idle_state_handle" the reset do not occour.

    The problem was the WDT. If I use the call "idle_state_handle" I must disable before the WDT.

    I think that il low power mode the time go very slow and the WDT condiction occour not after 4 second but after about 5 minute.

    You confirm ?

    thanks for your help

    Marco

  • unfortunately I just discovered that it is impossible to disable the WDT.

    So, I need  the "idle_state_handle" and I need the WDT, but the WDT causes the micro reset.

    to solve the problem I could put a timer that causes periodic exit from the "idle_state_handle"  in order to refresh the WDT, but it doesn't seem like an elegant solution

    Marco

  • It is an architectural decision to choose the correct timeout of the WDT (which is different for different applications) so that there is a timer that wakes the chip before the WDT timesout. Tou need to choose the WDT timeout large enough for the wakeup timer frequency to make sense power efficiency wise.

    Yes, I understand it is a difficult decision to make and might need you to benchmark and come to an optimal values that suit your application.

Reply
  • It is an architectural decision to choose the correct timeout of the WDT (which is different for different applications) so that there is a timer that wakes the chip before the WDT timesout. Tou need to choose the WDT timeout large enough for the wakeup timer frequency to make sense power efficiency wise.

    Yes, I understand it is a difficult decision to make and might need you to benchmark and come to an optimal values that suit your application.

Children
No Data
Related