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

Current consumption

Hi, 

I tried to monitor current consumption of my device. I used

 

sd_app_evt_wait();

and then used 

 // Wait for an event.
        __WFE();
        // Clear the internal event register.
        __SEV();
        __WFE();

I saw something like this

There are spikes on everywhere.

If I comment out sd_app_evt_wait(); or last __WFE(); it beacomes like that

I am using sdk 15.0.0, before this I was using sdk 14.2 and in 14.2 I was using sd_app_evt_wait function and there was no spikes. How can I fix it?

Thanks.

Parents
  • Hi

    Is this on a project you've migrated from the SDK v.14.2 to v.15.0? In that case, you should check out the migration guide to see that you did all of the required steps. It seems your device is not going to sleep properly, so you probably have some peripherals still running. Can you show me a snippet of your code on how you go to sleep/uninitialize your peripherals? Also, please keep in mind that you should refer to the compatibility matrix, to see that you use the correct SDK and Softdevice versions with the correct chip.

    Best regards,

    Simon

Reply
  • Hi

    Is this on a project you've migrated from the SDK v.14.2 to v.15.0? In that case, you should check out the migration guide to see that you did all of the required steps. It seems your device is not going to sleep properly, so you probably have some peripherals still running. Can you show me a snippet of your code on how you go to sleep/uninitialize your peripherals? Also, please keep in mind that you should refer to the compatibility matrix, to see that you use the correct SDK and Softdevice versions with the correct chip.

    Best regards,

    Simon

Children
  • Hi, thank you for the reply. 

    No, those projects are totally different, sorry for misrepresentation. I talked about project on sdk 14.2 because when I use sd_app_evt_wait function there were no spikes. Now I am using same function in totally different project on sdk 15.0 and that spikes happened. Those two pictures from project on sdk 15.0, if I dont use sd_app_evt_wait() --> no spikes, if I use sd_app_evt_wait() --> spikes. 

    Also I tried this:

    __WFE();
    __SEV();
    __WFE(); 

    Like this it has spikes.

    __WFE();
    __SEV();
    //__WFE();

    If I comment out last __WFE(); it doesnt have spikes.

    This is my for in the main.c

    for (;;) 
      {
        if (isWorkingIntervalFunc() == true && oneShotFlag1 == false) {
          goToWorkingState();
          oneShotFlag1 = true;
          oneShotFlag2 = false;
        } else if (isWorkingIntervalFunc() == false && oneShotFlag2 == false) {
          oneShotFlag1 = false;
          oneShotFlag2 = true;
          goToSleepState();
    
        } else {
        }
        stateMachineRun();
    
        sd_app_evt_wait();
      }

    I dont know which peripheral is still running. I dont use uart, gpio, or others. I only do scannning and advertising.

    Thanks.

Related