Hi, I am trying to measure power consumption (the device is an nRF52840 dongle) and I get different results when the board is connected or not to a JLink external debugger. The surprising result is that generally the current is _lower_ when the JLink is connected. My config is
# add button and led library CONFIG_DK_LIBRARY=y # turn on/off logger, also selects CONFIG_PRINTK CONFIG_LOG=n # send printk messages to log # CONFIG_LOG_PRINTK=y # use RTT console CONFIG_UART_CONSOLE=n CONFIG_RTT_CONSOLE=n # enable Segger RTT libs CONFIG_USE_SEGGER_RTT=n #FOTA: CONFIG_MCUMGR=y CONFIG_MCUMGR_CMD_OS_MGMT=y CONFIG_MCUMGR_CMD_IMG_MGMT=y CONFIG_BOOTLOADER_MCUBOOT=y # Allow for large Bluetooth data packets. CONFIG_BT_L2CAP_TX_MTU=252 CONFIG_BT_BUF_ACL_RX_SIZE=256 # Enable the Bluetooth (unauthenticated) mcumgr transport. CONFIG_MCUMGR_SMP_BT=y CONFIG_MCUMGR_SMP_BT_AUTHEN=n # Add 256 bytes to accommodate upload command (lfs_stat overflows) CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304
When the Jtag interface is connected (and the debugger powered up/connected to USB) my "Idle" code (which is a k_sleep() with some gpios initialized for the leds and the button) gives me between 3-4 uA.

When the app goes into bt advertising mode the current goes up to around 400-500uA. I don't know if these values are to be expected, but it seems reasonable to me (current goes up due to radio activity)
However, when I remove the jtag interface cable I get around 150uA while idle which then slowly goes down to 70-80uA. The mean value is obtained averaging over short spikes around 2mA

When I now start bluetooth advertising from this state, the current goes down(!) to 25-30uA (with the blue led on!).
I don't understand why this is happening, the JTag is interfering a lot in the power measurements, can anyone shed a light on this?