2024-01-23 05:57 AM - edited 2024-01-23 05:58 AM
Hi
I am using X-NUCLEO-LPM01A to measure some currents on P-NUCLEO-WB55 according to video:
https://www.youtube.com/watch?v=7IVs-nuoXj8.
To keep ST Link enbaled the commentator asks to put some pins to analog state , no internal pull-up , and pull-down state
See here:
How do I do that?
2024-01-23 06:37 AM - edited 2024-01-23 06:38 AM
You can link to a specific time in a YouTube video:
eg, https://youtu.be/7IVs-nuoXj8?t=736
@DS.4 wrote:To keep ST Link enbaled the commentator asks to put some pins to analog state
I think you may have misunderstood what he meant: that will still break the debug connection - it just saves you having to physically fit & remove the jumpers.
Also, if you're trying to get your application down to really the lowest possible current level, this will still leave some leakage - so you'll still need to physically disconnect.
Anyhow ...
@DS.4 wrote:How do I do that?
Something like this:
GPIO_InitTypeDef GPIO_InitStruct;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Pin = GPIO_PIN_All;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
2024-01-23 01:02 PM - edited 2024-01-23 01:05 PM
"that will still break the debug connection" - why?
Prior to adding PIN13 and PIN5 to be analog, I Ran a quick test , programmed the WB55 in debug mode (CubeIDE) , and ran.
Have some weird base current of 1 mA on advertising during sleep. (BleHeartRate example)
But then, I do get to hold a breakpoint on connection event , debug doesn't break. But I see the current jump high to 3mA while I am holding the break point. here:
Exiting debug:
Pressing the" Reset button" on WB55 does not exit debug.
Only if I press "RESET TARGET" on STM32CubeMonitor-Power than I lose it. And only then I see datasheet sleep currents. (3uA). See here:
So what's going on? and what is then the correct way to keep debug with sleep if I need it?
2024-01-24 01:45 AM - edited 2024-01-24 01:49 AM
@DS.4 wrote:"that will still break the debug connection" - why?
Because you are disconnecting the SWD connection - which goes through those pins.
@DS.4 wrote:So what's going on? and what is then the correct way to keep debug with sleep if I need it?
You will never get true low power readings with a debugger connected - the debugger keeps the CPU awake.
Also, as mentioned earlier, the physical connection will give you some leakage/stray currents.
As well as the SWD connections, also check:
It is a non-trivial exercise to find & disconnect all these things, and the ST documentation is often incomplete; eg:
(unfortunately the link in that post seems to be broken)
EDIT: I found what it should link to:
@DS.4 wrote:what is then the correct way to keep debug with sleep if I need it?
You can't have both sleep and debug - choose one.
2024-01-24 02:05 AM
2024-01-25 01:48 AM
Thanks @Andrew Neil
if there is a base current that draws by keeping debug that's fine by me , I will deduct it in the end. My issue is that @ST didn't make a full video showing what that current levels should be.
Even having this information for their specific board and code example will be fine.
So as you said, I am not sure the 1mA is good or I am having something else drawing current ...
Would like @ST to give us their expected numbers for the current draw in that case, and maybe describe the correct way to debug sleep and keep debug on their example.
2024-01-25 02:18 AM
@DS.4 wrote:My issue is that @ST didn't make a full video showing what that current levels should be.
Not everything is best presented as a video!
Current consumption figures are given in the datasheet:
As it says, the consumption depends on many things - and not just the physical characteristics of the chip but also the nature of the particular application (hardware & software).
So it's really not possible to give a simple statement, "current consumption is X".
But it would be useful if ST would give some figures for a specific reference application on a specific board under specific conditions - with full details of the conditions of measurement.