I am trying to measure the power consumption of a PCA10040 board while debugging, using the PPK. I am using the setup shown here: "Measuring current on nRF5 DK while debugging" with the slight change that I am using another PCA10040 board as JLink probe (as the nRF Connect v2.4.0 does not yet support a "real" JLink probe).
In detail, my setup is as follows. One PCA10040 board (naming this “DK A”) is connected with USB. The PPK is piggyback on DK A.
Another PCA10040 (“DK B”) is connected to the PPK with a 10 pin cable (Debug out on DK B is connected to Debug in on the PPK).
The COM SW3 is set to EXT.
SEGGER JLink version is V632i.
Steps to reproduce this problem
Another way to reproduce this
A third way of reproducing the problem (which suggests that IAR has nothing to do with this):
6. Start nRF Connect v2.4.0 Power Profiler and to connect to DK B
7. Connect Segger RTTViewer to DK A
8. This will kick the Power Profiler app out (the measurement stops). After this, it is impossible to connect to DK A with the app, showing the error message of step 2 above
I think I found another issue reported 6 months ago regarding the same thing:
I just tested this with the setup you provided & I also received the same error code:
I will mention this internally to the developer.
It seems that this is an issue with a segger update. According to another colleague, it is not such a great idea to debug & measure the current consumption at the same time, as you will receive around 4 mA no matter what. This is because the debugger will turn on all regulators & clocks on the chip.
Yes, I know that the measurements will be wrong when measuring at the same time as debugging. What I want to solve is this workflow:
- Activate the measurement in the app RF Connect Power Profiler
- Run the debugger (yes, the current consumption is wrong here but I can still do my usual cycle of compile/debug/recompile/debug/... before finding a state where my code actually seems to work)
- When the code seems to be working, stop the debugger (or even remove the SWD 9 pin cable) to run the device in a "release" state, with realistic current measurements
- When I need to reflash the device or start a compile/debug cycle again, I just reattach the SWD cable (although I have seen that it is enough to just stop the debugger in EWARM and keep the SWD cable connected. Most of the time this gives me somewhat useful measurements)
But... My workflow right now looks like this, because of the above issue:
- Activate the measurement
- Run the debugger... But this crashes the Power Profiler app!
- Stop the debugger
- Close the Power Profiler app and open it again. Find the correct serial port. Start the measurement.... .... You see where this is going?
Edit: So my point is, I am not looking for a solution to get good measurements while debugging. I just want to avoid having to close and reopen the Power Profiler app all the time just because the JLink crashes.