Hello Nordic Team,
I am using nRF5340-DK and I have a PPK-2 for current measurements. My development environment is NRF Connect SDK v2.5.2. I used https://infocenter.nordicsemi.com/pdf/PPK_2_User_Guide_20201201.pdf this guide to configure my board and ppk2. Firstly, I used section 6.3 Measuring current in Ampere Meter mode.
On board side, switches status are like below:
Firstly, I erased both application and network cores. After that, I used very simple app to measure current consumption.
main.cpp #include <zephyr/kernel.h> #include <zephyr/device.h> #include "Leds.h" LOG_MODULE_REGISTER(main, ATM_LOG_LEVEL_INF); int main(void) { LOG_INF("SLEEP TEST PROJECT!"); LEDS::Init(); LEDS::GreenOn(); LEDS::RedOn(); k_sleep(K_MSEC(1000)); LEDS::GreenOff(); LEDS::RedOff(); // Start operations... LOG_INF("Started operations..."); while(1) { k_sleep(K_FOREVER); } return 0; }
# Config Peripherals CONFIG_GPIO=y CONFIG_PM_DEVICE=y CONFIG_BOARD_ENABLE_DCDC_APP=y CONFIG_BOARD_ENABLE_DCDC_NET=y #### # CPP CONFIG_CPP=y CONFIG_GLIBCXX_LIBCPP=y CONFIG_NEWLIB_LIBC=y CONFIG_STD_CPP17=y CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y CONFIG_NEWLIB_LIBC_FLOAT_SCANF=y #### # General Settings CONFIG_FPU=y CONFIG_RESET_ON_FATAL_ERROR=n CONFIG_ASSERT=y CONFIG_RING_BUFFER=y CONFIG_REBOOT=y CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_MAIN_STACK_SIZE=16384 #### # # Config LOGGER (Close while sleep test) # CONFIG_LOG=y # CONFIG_USE_SEGGER_RTT=y # CONFIG_LOG_BACKEND_RTT=y # CONFIG_LOG_BACKEND_UART=n # CONFIG_LOG_PRINTK=y # CONFIG_LOG_MODE_IMMEDIATE=n # # to see DBG messages # #CONFIG_LOG_DEFAULT_LEVEL=4 # #### # Necessary options for low power consumption (Enabled while sleep test) CONFIG_CONSOLE=n CONFIG_UART_CONSOLE=n CONFIG_RTT_CONSOLE=n CONFIG_USB_DEVICE_STACK=n CONFIG_DEBUG_OPTIMIZATIONS=n CONFIG_SERIAL=n CONFIG_LOG=n CONFIG_BT_DEBUG_LOG=n ####
According to following settings I am seeing 3.7 - 3.8uA as idle current and there are no peaks. I am seeing this idle current constantly. However, according to online power profiler web page, I must see 3.1uA. (There is no big difference between the results. So, I feel that my settings are correct. Is there way to decrease idle current or my settings are correct?)
After that, I want to add network core to my project. Again, I prepared a simple ble scanner example. (Because, I will use nRF5340 as a scanner on my project.)
#include <zephyr/kernel.h> #include <zephyr/device.h> #include "Leds.h" #include "BLECentralScan.h" LOG_MODULE_REGISTER(main, LOG_LEVEL_INF); int main(void) { LOG_INF("SLEEP TEST PROJECT!"); LEDS::Init(); LEDS::GreenOn(); LEDS::RedOn(); k_sleep(K_MSEC(1000)); int err = BLECentralScan::Init(); if(err != 0) ATM_LOG_ERR("Scanner initilazation failed: %d!", err); LEDS::GreenOff(); LEDS::RedOff(); // Start operations... // BLECentralScan::StartScan(); ATM_LOG_INF("Started operations..."); while(1) { k_sleep(K_FOREVER); } return 0; }
nrf5340dk_nrf5340_cpuapp.conf CONFIG_SPI=n CONFIG_NCS_SAMPLES_DEFAULTS=n CONFIG_BOARD_ENABLE_DCDC_NET=y CONFIG_BOARD_ENABLE_DCDC_APP=y # IF RUNNING DIRECTLY ON A LIPO, CONNECTED TO VDDH # CONFIG_BOARD_ENABLE_DCDC_HV=y
// child_image/hci_rpmsg.conf CONFIG_BOARD_ENABLE_DCDC_NET=y # Necessary options for low power consumption CONFIG_SERIAL=n CONFIG_LOG=n CONFIG_BT_DEBUG_LOG=n CONFIG_CONSOLE=n CONFIG_UART_CONSOLE=n CONFIG_RTT_CONSOLE=n CONFIG_USB_DEVICE_STACK=n CONFIG_DEBUG_OPTIMIZATIONS=n #### CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=4000000 CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 CONFIG_BT_BUF_ACL_RX_SIZE=502 CONFIG_BT_BUF_ACL_TX_SIZE=502 CONFIG_BT_MAX_CONN=1 CONFIG_BT_CTLR_PHY_2M=y # CONFIG_BT_CTLR_PHY_CODED=y # CONFIG_BT_CTLR_RX_BUFFERS=2
By using these project settings, I am getting 5.81uA average current and I am starting to see peak currents at every seconds. Is this expected behavior? Also, even DCDC converter is enabled for both mcu cores, I am seeing 4.45uA idle current. (Again, according to online power profiler, it is 3.1uA. There is a huge difference. Is this normal or I must apply some other configuration or I must use different app instead of hci_rpmsg?)
There, I have one more question. If I configure board and ppk2 according to section 6.3, I am not able to measure any external sensor currents. I even connect board's VDD and GND pins a power led but average current stays same. Because of that, I configured my board and ppk2 according to section 6.2. Now, I am able to sense external components current like a LED. However,my average current jumps from 5.81uA to 12uA and idle current jump form 4.45uA to 10.4uA. Is this expected behavior? (Which components I must removed from DK to decrease sleep current?)
Thanks.