2025-06-25 1:04 AM
Hello
I have a nucleo wb05kz programmed with BLE_Power_Consumption example project (STM32Cube_FW_WB0_V1.1.0 package) and i want to measure the current consumption.
Following the UM3343, I removed the JP1 and JP2 jumpers and connected my power supply (3.3V) to pin 2 of JP2. I placed a multimeter in series with the power supply to measure the current.
The board seems to be working correctly (I can see the advertising using a second Nucleo as a P2P client), however, the current consumption is 2.3mA. There is certainly still something to be done on the hardware side, but I can't figure out what. Could you give me a suggestion?
2025-06-25 1:46 AM
Hello @utelettronico2
Could you please keep the JP1 fitted and just Connect the Nucleo Board to an amperometer in the JP2 connector. To have a Clear Vision on the Power consumption of the Board in the different states (Low power, ADV,...), i suggest you use the STM32CubeMonPwr - Graphical tool displaying on PC power data coming from STLink-V3PWR - STMicroelectronics with your board and the BLE_Power_Consumption example project
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-06-25 1:52 AM
@utelettronico2 wrote:I placed a multimeter in series with the power supply to measure the current.
As @STTwo-32 suggested, that isn't going to give you a useful view of the actual current consumption.
A meter can only give a very slow, averaged reading.
But the actual current consumption will be changing vastly from "sleep" (possibly uA) to "active" (mA) to transmitting (maybe tens of mA).
So you really do need a tool which can show that dynamic behaviour. @STTwo-32 obviously mentioned the ST tools, but other providers are available ...
2025-06-25 3:38 AM
Thanks for the replies.
I had already tried the solution suggested by STTwo-32 and I got a measurement between 2µA (in sleep) and 150µA (during advertising).
The reason I was trying to power the board through JP2 was to be 100% sure of the current consumption (and it's one of the two methods recommended in the user manual).
I did some further testing, and it seems that, with the same firmware, when powering from JP2, the board is no longer able to enter sleep mode (although advertising still seems to be working).
Is the ST-Link connection required for the board to enter sleep mode? Is there a section of the Nucleo board that must be powered from 5V for sleep mode to work?
Regarding the quality of the measurement: I know the meter isn’t very precise, but it’s definitely enough to give me the correct order of magnitude (I’m mostly interested in the sleep mode current).
2025-06-25 3:52 AM - edited 2025-06-25 3:53 AM
@utelettronico2 wrote:Is the ST-Link connection required for the board to enter sleep mode?
No, but having the ST-Link connected will affect the current draw.
Having a debug session active will prevent entering low-power modes.
PS:
Also, after having a had a debug session active, it may be necessary to power-cycle (not just reset) before low-power modes will work again
2025-06-25 4:58 AM
I only have two wires connected: one to GND and the other to pin 2 of JP2.
So, I'm not in debug mode, the USB is not connected, and I performed a power reset.
There must be another condition preventing the board from entering sleep mode when powered via JP2.
2025-06-25 11:28 PM - last edited on 2025-06-26 1:20 AM by Andrew Neil
It's something related to the usart.
In this function,if i remove __HAL_RCC_USART1_CLK_DISABLE() after wakeup sleep mode starts to work again. Still power consumption is more than expected (50uA in sleep).
void UTIL_SEQ_Idle( void )
{
#if (CFG_LPM_SUPPORTED == 1)
/* Need to consume some CSTACK on WB05, due to bootloader CSTACK usage. */
volatile uint32_t dummy[15];
uint8_t i;
for (i=0; i<10; i++)
{
dummy[i] = 0;
__NOP();
}
PowerSaveLevels app_powerSave_level, vtimer_powerSave_level, final_level, pka_level;
if ((BLE_STACK_SleepCheck() != POWER_SAVE_LEVEL_RUNNING) &&
((app_powerSave_level = App_PowerSaveLevel_Check()) != POWER_SAVE_LEVEL_RUNNING))
{
vtimer_powerSave_level = HAL_RADIO_TIMER_PowerSaveLevelCheck();
pka_level = (PowerSaveLevels) HW_PKA_PowerSaveLevelCheck();
final_level = (PowerSaveLevels)MIN(vtimer_powerSave_level, app_powerSave_level);
final_level = (PowerSaveLevels)MIN(pka_level, final_level);
switch(final_level)
{
case POWER_SAVE_LEVEL_RUNNING:
/* Not Power Save device is busy */
return;
break;
case POWER_SAVE_LEVEL_CPU_HALT:
UTIL_LPM_SetStopMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE);
UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE);
break;
case POWER_SAVE_LEVEL_STOP_LS_CLOCK_ON:
UTIL_LPM_SetStopMode(1 << CFG_LPM_APP, UTIL_LPM_ENABLE);
UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE);
break;
case POWER_SAVE_LEVEL_STOP:
UTIL_LPM_SetStopMode(1 << CFG_LPM_APP, UTIL_LPM_ENABLE);
UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_ENABLE);
break;
}
/* USER CODE BEGIN UTIL_SEQ_IDLE_BEGIN */
/* Enable UART CLOCK to save the register settings */
__HAL_RCC_USART1_CLK_ENABLE();
/* USER CODE END UTIL_SEQ_IDLE_BEGIN */
UTIL_LPM_EnterLowPower();
/* USER CODE BEGIN UTIL_SEQ_IDLE_END */
/* Disable UART CLOCK to reduce the power consumption */
/* USER CODE END UTIL_SEQ_IDLE_END */
}
#endif /* CFG_LPM_SUPPORTED */
}
I also tried to remove the debug trace with this line.
#define CFG_DEBUG_APP_TRACE (0)
but in this case it hangs forever here.
void UTIL_SEQ_PreIdle( void )
{
#if (CFG_LPM_SUPPORTED == 1)
/* USER CODE BEGIN UTIL_SEQ_PREIDLE */
/* Wait until the UART FIFO is empty */
while ((__HAL_UART_GET_FLAG(&hcom_uart[COM1], UART_FLAG_TXFNF) == 0) ||
(__HAL_UART_GET_FLAG(&hcom_uart[COM1], UART_FLAG_TC) == 0));
/* USER CODE END UTIL_SEQ_PREIDLE */
#endif /* CFG_LPM_SUPPORTED */
return;
}
do you have any idea how to fix it properly?
Edited to apply source code formatting - please see How to insert source code for future reference.