cancel
Showing results for 
Search instead for 
Did you mean: 

[Resolved] Why BlueNRG-LP deepstop current increases with time ?

jbie
Associate II

Hello,

I have a high power consumption during deepstop. The goal is less than 5µA (announced less than 1 in the datasheet).

I removed every other chips on my custom board to found the solution. It's a small board.

When I enter in deepstop mode (without RTC, without any wake-up to test), the current starts at 2-3µA and slowly increases to +-50µA in around 20 seconds. Then the current is stable. We think that it's related with the temperature, if the board is "hot", the starting current is higher.

If I freeze the board, the current change (increase or decrease, it's "random").

I setup PWRC_PUCRx and PWRC_PDCRx according to my board.

Do you know where this issue could come from?

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Laurent LOUAZON
ST Employee

Hello,

Two things here in my mind

  • Leakage problem could be related to PA7 / PB0 / PB1 / PB3 / PB9 / PB10 / PB11 / PB14 / PB15 that are configured as analog No pull while they are not used. If IOs are not used, you should not initialized them so that the pull used will be the one defined with LL_PWR_Enable. Please try not to initialize those IOs as analog if not used.

Again the problem you faced is typical of an IO set as input and no pull is present.

  • I am not sure to get why you are initiliazing IOs used as UART,SP�?, I2C etc as GPIO input with pull up/down. I guess they are programmed in other place with proper alternate function.

Regards

Laurent

View solution in original post

9 REPLIES 9
JWill.8
Associate III

This may be impractical for you, but if you had a second custom board identical to the one drawing the excessive current, it might be instructive to see if it exhibits the same behavior to rule out a defect in the physical board.

Also, I assume measuring the current is not adversely affecting your results.

If this is a dumb idea or I don't fully understand (likely), ignore it...

jbie
Associate II

We have 5 prototype boards with the same behavior. It's not a dumb idea

Laurent LOUAZON
ST Employee

Hello,

From description, really seems no pull are programmed during sleep mode.

Such slow increasing leakage would typically appear if an IO is set as input, physically floating and no pull are programmed.

Please ensure correct pull are set during sleep mode.

In BlueNRG-LP SDK code examples, function BSP_IO_Init() is used to configure all IOs in sleep for optimal power consumption with our STEVAL-IDB011 eval board. It can be reused and adapt for custom PCB.

Regards

Laurent

jbie
Associate II

Hello,

Thank you for your response, I already do this but when I check with multimeter, pull down are low state but pull up are floating around 0.03V.

My init code to set IO in sleep mode:

	__HAL_RCC_GPIOA_CLK_ENABLE();
	__HAL_RCC_GPIOB_CLK_ENABLE();
	__HAL_RCC_SYSCFG_CLK_ENABLE();
 
	HAL_PWREx_DisableGPIOPullUp(PWR_GPIO_A, 0xffff);
	HAL_PWREx_DisableGPIOPullDown(PWR_GPIO_A, 0xffff);
	HAL_PWREx_DisableGPIOPullUp(PWR_GPIO_B, 0xffff);
	HAL_PWREx_DisableGPIOPullDown(PWR_GPIO_B, 0xffff);
 
	LL_PWR_EnablePUA(LL_PWR_PUPD_IO0);
	LL_PWR_EnablePUA(LL_PWR_PUPD_IO1);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO2);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO3);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO4);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO5); // Output done in detection
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO6);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO7);
	LL_PWR_EnablePUA(LL_PWR_PUPD_IO8);
	LL_PWR_EnablePUA(LL_PWR_PUPD_IO9);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO10);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO11);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO12);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO13);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO14);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO15);
 
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO0);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO1);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO2); // Input wake up done in detection
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO3);
	LL_PWR_EnablePUB(LL_PWR_PUPD_IO4);
	LL_PWR_EnablePUB(LL_PWR_PUPD_IO5);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO6);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO7);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO8);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO9);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO10);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO11);
	// 12 & 13 are not done because XTAL
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO14);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO15);

Do you have any idea why pin are not pulled up?

Thank you,

Jean

Hello,

Could you maybe share your entire IO configuration (not only PWR register) and schematics.

Attached is short doc that may help you regrading power consumption with BlueNRG-LP.

Regards

Laurent

Thank I didn't have this doc. I already implemented everything except LSE driving.

during my test, UART and debugger are disconnected.

Part of the schematic that I can share:

0693W00000QOCdVQAX.png 

IO init:

void BSP_IO_Init(void)
{
	GPIO_InitTypeDef   GPIO_InitStructure = {0};
 
	__HAL_RCC_GPIOA_CLK_ENABLE();
	__HAL_RCC_GPIOB_CLK_ENABLE();
	__HAL_RCC_SYSCFG_CLK_ENABLE();
 
	HAL_PWREx_DisableGPIOPullUp(PWR_GPIO_A, 0xffff);
	HAL_PWREx_DisableGPIOPullDown(PWR_GPIO_A, 0xffff);
	HAL_PWREx_DisableGPIOPullUp(PWR_GPIO_B, 0xffff);
	HAL_PWREx_DisableGPIOPullDown(PWR_GPIO_B, 0xffff);
 
	LL_PWR_EnablePUA(LL_PWR_PUPD_IO0);
	LL_PWR_EnablePUA(LL_PWR_PUPD_IO1);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO2);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO3);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO4);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO5); // Output done in detection
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO6);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO7);
	LL_PWR_EnablePUA(LL_PWR_PUPD_IO8);
	LL_PWR_EnablePUA(LL_PWR_PUPD_IO9);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO10);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO11);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO12);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO13);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO14);
	LL_PWR_EnablePDA(LL_PWR_PUPD_IO15);
 
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO0);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO1);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO2); // Input wake up done in detection
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO3);
	LL_PWR_EnablePUB(LL_PWR_PUPD_IO4);
	LL_PWR_EnablePUB(LL_PWR_PUPD_IO5);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO6);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO7);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO8);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO9);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO10);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO11);
	// 12 & 13 are not done because XTAL
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO14);
	LL_PWR_EnablePDB(LL_PWR_PUPD_IO15);
 
	// Do nothing when not in sleep
	// SWDIO / SWCLK / XTAL0 / XTAL1
 
 
	// Input pull down
	// RTC_CAL / OUT_CAP / LCDCTRL_nRST / BOOT_FORCE / LCDCTRL_POWER / LCDCTRL_SPI_NSS / LCDCTRL_SPI_SCK / LCDCTRL_SPI_MISO / LCDCTRL_SPI_MOSI / IN_CAP / I2C_SCL_ISO / I2C_SDA_ISO / NFC_POW
	GPIO_InitStructure.Mode = GPIO_MODE_INPUT;
	GPIO_InitStructure.Pull = GPIO_PULLDOWN;
 
	GPIO_InitStructure.Pin = GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
	HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);
 
	GPIO_InitStructure.Pin = GPIO_PIN_2 | GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_8;
	HAL_GPIO_Init(GPIOB, &GPIO_InitStructure);
 
 
	// Input pull up
	// I2C_SCL / I2C_SDA / UART_RX / UART_TX / LPUART_TX / ISO_GPO
	GPIO_InitStructure.Mode = GPIO_MODE_INPUT;
	GPIO_InitStructure.Pull = GPIO_PULLUP;
 
	GPIO_InitStructure.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_8 | GPIO_PIN_9;
	HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);
 
	GPIO_InitStructure.Pin = GPIO_PIN_4 | GPIO_PIN_5;
	HAL_GPIO_Init(GPIOB, &GPIO_InitStructure);
 
 
	// Input no pull
 
 
	// Analog
	// PA7 / PB0 / PB1 / PB3 / PB9 / PB10 / PB11 / PB14 / PB15
	GPIO_InitStructure.Mode = GPIO_MODE_ANALOG;
	GPIO_InitStructure.Pull = GPIO_NOPULL;
 
	GPIO_InitStructure.Pin = GPIO_PIN_7;
	HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);
 
	GPIO_InitStructure.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_3 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_14 | GPIO_PIN_15;
	HAL_GPIO_Init(GPIOB, &GPIO_InitStructure);
 
}

Laurent LOUAZON
ST Employee

Hello,

Two things here in my mind

  • Leakage problem could be related to PA7 / PB0 / PB1 / PB3 / PB9 / PB10 / PB11 / PB14 / PB15 that are configured as analog No pull while they are not used. If IOs are not used, you should not initialized them so that the pull used will be the one defined with LL_PWR_Enable. Please try not to initialize those IOs as analog if not used.

Again the problem you faced is typical of an IO set as input and no pull is present.

  • I am not sure to get why you are initiliazing IOs used as UART,SP�?, I2C etc as GPIO input with pull up/down. I guess they are programmed in other place with proper alternate function.

Regards

Laurent

jbie
Associate II

Hello,

It's working with the first remark, thank you ! I does not know that "normal state" init override "sleep state" init.

Regards,

Jean

Laurent LOUAZON
ST Employee

Hello Jean,

Good to read.

Please tag this request as answered if you don't mind.

Regards

Laurent