Interaction JLink and Power Profiler PPKII?

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?

Parents
  • Hi, these results seem a bit strange to me. It's normal to get some leakage current on the SWD interface (nRF uses SWD not Jtag). Whether the current goes up or down depends on the voltage on the JLink. Usually the voltages should be matched using the VRef pin, but I've seen many times that this is not the case and the JLink will either source or sink current. So you should always unplug the debugger before any current measurements, then you don't have to worry about any leakage currents.

    The fact that the current rises to 150 uA when then JLink is disconnected is strange. I think you should verify your measurement setup using a FW with a known current consumption. You can start with the ble_app_pwr_profiling example. It starts out in system off and you should see below 1 uA of current draw.

    Also please describe your measurement setup. Is the dongle plugged in to the USB port while measuring? The USB interface will often create lots of noise, making the measurements unreliable. Maybe the external debugger is somehow stabilizing this noise?

  • Thanx for your answer! The results also seem strange to me! You are right, of course we use SWD for the dongle. So it looks like the Debugger sources current in my case (though I have the Vref pin connected). I will try the example you suggest with the debugger disconnected and post my results here.

    In what I have posted so far the USB port was not plugged in, I don't use it at all. Power comes from a CR3032 cell and I have the PPKII in ampere mode, measuring directly what comes out of the cell.

  • OK I see. Are you connecting the CR3032 to the VDD_nRF pin?

    The PPK in ampere meter mode should also have a ground reference to the dongle. So connect one of the GND pins on the PPK to the negative side of the battery. I believe this might be the reason for the weird behavior you are seeing. Because when you connect the JLink the ground reference is made through the USB interface to the PPK

Reply Children
Related