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

nRF52840 Power consumption issue

Hi All, 

I am developing one device using nRF52840 based on Zigbee protocol. 

Currently I am using nRF52840 Dev-kit and nRF5_SDK_for_Thread_and_Zigbee_v4.1.0_32ce5f8. 

I am working on power management part of the device. As per my study and Nordic instruction we have configured device as SED (Sleepy End Device).  

We followed the user guide to test the current but I am getting ~1mA current which too high. Setup tested using multi meter as well as power profile kit. (Current remains ~1mA)

I have started development using SDK 3.0 for Zigbee and Thread and here we got current ~1mA but then came to know that in SDK 4.1 for Zigbee and Thread SED is handled better way so we up graded our functions to SDK 4.1 but here also we got same result current = ~1mA.

Please find my attached document which explains the my device and current testing setup. 

In my end we are using following peripherals GPIO, UART, Timer, Internal Flash. 

Required current is 30uA. My end device would be using 2 AA cells to power and battery life should last for 2 years. So depending on this we need almost ~30uA current. 

1715.nRF52840 setup and comments.docx

- Attached code is developed using SDK 4.1 for Zigbee and Thread.

Radiator_nRF_v0.9.7.zip

- Power profile kit image while measuring current. we can see that we have peak current of around 40mA and the average seems to be the same as ~1mA.

Let me know how to reduce the power and get required current for my device.

Thanks and Regards

Rohit R

Parents
  • Hi,

    Most likely, the increased current is caused by the UART peripheral and EasyDMA. Try disabling the UART peripheral, to see if you get lowered current consumption.

    Best regards,
    Jørgen

  • Hi Jørgen, 

    Thank you so much for the response, 

    As you suggested, I have removed the UART from code and I can see that current  ~33uA. 

    But Here, I need UART this is main part of set up means my Radiator and nRF communicate with each other using UART. 

    So, What I tried is when I am sending commands to Radiator (State machine as you can see in code) in Ready State Initialized the UART (uart_init()) function and started 3sec timer after init then once 3sec is over I used app_uart_close() functions to disable. But It didn't worked as expected means it gave me current again 1mA and also after 2/3 commands it always got stuck into one of SDK uart related files. 

    My commands exchange happens when I write on Zigbee attributes and GPIO interrupt so if you have any suggestion regarding disabling after command exchange would help me here. 

    As if it should do the communication in both case disable before going to sleep in SED behave. 

    Let me know your suggestion.

    Thanks and Regards

    Rohit R

  • Hi Jørgen,

    Thanks for the response, 

    Here is my complete code. 

    uart_config.c and .h file contains UART init functions. 

    And uart_statemachine.c  file contains the calling of uart_init() and app_uart_close() function in respected states. 

    -Below steps to init and close uart present in uart_statemachin.c file 

    When State_Ready I init the uart_init() function 

    When APP_E_EVENT_UART_IDLE I call the app_uart_close() function. 

    Radiator_nRFv0.9.10.zip

    - And, I have used UART not UARTE but why code getting stuck in while() loop of nrf_uarte.c file. As attached in previous post. I didn't get this reason?

    And, I have disabled NRF_UART_LOG from sdk_config.h file to reduce power. 

    As I was getting this while() loop stuck in uarte function so I tried to disabled it by setting 

    #define NRFX_UARTE_ENABLED 0. in sdk_config.h file but still it didn't work. Still getting stuck at this while loop only. 

    There are some changes in the nrfx UARTE driver for later SDK version (SDK 17.0.x), which is not available in the Thread and Zigbee SDK. You may try to replace this driver only from nrfx tag version 1.8.6.

    - Okay, I will go through this link. 

    But let me know your feedback on my code.

    Thanks and Regards

    Rohit R

  • Hi Jørgen,

    As per your suggestion. I have replaced the UARTE driver from link shared by you. 

    But still result remains same. Code getting stuck at while loop of nrfx_uarte() file. (Same as previous image)

    One more thing I am not understanding is I have used UART only not UARTE in code but still it going in uarte driver? 

    I think i am making any mistake in configuration. But unable to find it. 

    Let me know your feedback on this. 

    Thanks and Regards

    Rohi R

  • The usage of UART vs UARTE is configured in the UART driver when using app_uart. You can try to unset the following config in your sdk_config.h file to switch to legacy UART:

    // <q> UART0_CONFIG_USE_EASY_DMA  - Default setting for using EasyDMA
     
    
    #ifndef UART0_CONFIG_USE_EASY_DMA
    #define UART0_CONFIG_USE_EASY_DMA 0
    #endif

  • Hi Hi Jørgen, 

    Thank you for the feedback. 

    I tried your suggestion but same issue. Code halting at below line. 

    Attached is the image for reference. 

    But what i did is kept the, #define UART0_CONFIG_USE_EASY_DMA 1 (set 1) 

    and unset the #define UART_EASY_DMA_SUPPORT 0. 

    with this i am able to discover my device but I am not sure the about difference. 

    Can you please explain me? And will work uart_open and uart_close. And will I get current drop here with this config.

    Attached is the snippet for reference. 

    // <e> UART_ENABLED - nrf_drv_uart - UART/UARTE peripheral driver - legacy layer
    //==========================================================
    #ifndef UART_ENABLED
    #define UART_ENABLED 1
    #endif
    // <o> UART_DEFAULT_CONFIG_HWFC  - Hardware Flow Control
     
    // <0=> Disabled 
    // <1=> Enabled 
    
    #ifndef UART_DEFAULT_CONFIG_HWFC
    #define UART_DEFAULT_CONFIG_HWFC 0
    #endif
    
    // <o> UART_DEFAULT_CONFIG_PARITY  - Parity
     
    // <0=> Excluded 
    // <14=> Included 
    
    #ifndef UART_DEFAULT_CONFIG_PARITY
    #define UART_DEFAULT_CONFIG_PARITY 0
    #endif
    
    // <o> UART_DEFAULT_CONFIG_BAUDRATE  - Default Baudrate
     
    // <323584=> 1200 baud 
    // <643072=> 2400 baud 
    // <1290240=> 4800 baud 
    // <2576384=> 9600 baud 
    // <3862528=> 14400 baud 
    // <5152768=> 19200 baud 
    // <7716864=> 28800 baud 
    // <10289152=> 38400 baud 
    // <15400960=> 57600 baud 
    // <20615168=> 76800 baud 
    // <30801920=> 115200 baud 
    // <61865984=> 230400 baud 
    // <67108864=> 250000 baud 
    // <121634816=> 460800 baud 
    // <251658240=> 921600 baud 
    // <268435456=> 1000000 baud 
    
    #ifndef UART_DEFAULT_CONFIG_BAUDRATE
    #define UART_DEFAULT_CONFIG_BAUDRATE 30801920
    #endif
    
    // <o> UART_DEFAULT_CONFIG_IRQ_PRIORITY  - Interrupt priority
     
    
    // <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
    // <0=> 0 (highest) 
    // <1=> 1 
    // <2=> 2 
    // <3=> 3 
    // <4=> 4 
    // <5=> 5 
    // <6=> 6 
    // <7=> 7 
    
    #ifndef UART_DEFAULT_CONFIG_IRQ_PRIORITY
    #define UART_DEFAULT_CONFIG_IRQ_PRIORITY 6
    #endif
    
    // <q> UART_EASY_DMA_SUPPORT  - Driver supporting EasyDMA
     
    
    #ifndef UART_EASY_DMA_SUPPORT
    #define UART_EASY_DMA_SUPPORT 0
    #endif
    
    // <q> UART_LEGACY_SUPPORT  - Driver supporting Legacy mode
     
    
    #ifndef UART_LEGACY_SUPPORT
    #define UART_LEGACY_SUPPORT 1
    #endif
    
    // <e> UART0_ENABLED - Enable UART0 instance
    //==========================================================
    #ifndef UART0_ENABLED
    #define UART0_ENABLED 1
    #endif
    // <q> UART0_CONFIG_USE_EASY_DMA  - Default setting for using EasyDMA
     
    
    #ifndef UART0_CONFIG_USE_EASY_DMA
    #define UART0_CONFIG_USE_EASY_DMA 1
    #endif
    
    // </e>
    
    // <e> UART1_ENABLED - Enable UART1 instance
    //==========================================================
    #ifndef UART1_ENABLED
    #define UART1_ENABLED 0
    #endif

    Let me know your feedback on this. 

    Thanks and Regards

    Rohit R

  • Rohit Rajapure said:
    I tried your suggestion but same issue. Code halting at below line. 

    That is strange, are you sure that you unset the correct symbol (not NRFX_UART0...) and that it is not defined anywhere else in the project?

    Un-setting UART_EASY_DMA_SUPPORT should have the same effect, as it will entirely disable the UARTE driver.

    It should work with app_uart_open and close as well, and should give lowered current. Did you measure the current consumption again with this config?

Reply
  • Rohit Rajapure said:
    I tried your suggestion but same issue. Code halting at below line. 

    That is strange, are you sure that you unset the correct symbol (not NRFX_UART0...) and that it is not defined anywhere else in the project?

    Un-setting UART_EASY_DMA_SUPPORT should have the same effect, as it will entirely disable the UARTE driver.

    It should work with app_uart_open and close as well, and should give lowered current. Did you measure the current consumption again with this config?

Children
  • Hi Jørgen, 

    Thank you so much for the help. 

    Yes, unset UART_EASY_DMA_SUPPORT and Just now measured the current. 

    It is giving me ~25uA as average current and maximum 40mA current. I have testing this using power profile kit. 

    maximum current is high so how to get this down below 20mA. can you suggest me any?

    Thank you so much for constant help. 

    I will test functions and let you know if anything. 

    Thanks and Regards

    Rohit R

Related